From 044664e4489fbfcce3007bc79c490552f949ae53 Mon Sep 17 00:00:00 2001 From: cclloyd Date: Tue, 9 Oct 2018 19:42:50 -0400 Subject: [PATCH] Fixed error with packages to conform to youtube-dl --- youtube_dl/extractor/roosterteeth.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/youtube_dl/extractor/roosterteeth.py b/youtube_dl/extractor/roosterteeth.py index b9f19dabc..bc991959f 100644 --- a/youtube_dl/extractor/roosterteeth.py +++ b/youtube_dl/extractor/roosterteeth.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import re -import requests +import json import time from .common import InfoExtractor @@ -73,10 +73,12 @@ class RoosterTeethIE(InfoExtractor): 'scope': 'user public', 'grant_type': 'password', } - response = requests.post(self._LOGIN_URL, data=login_data) + if login_data: + login_data = json.dumps(login_data).encode() + login = self._download_json(self._LOGIN_URL, '1', note="Downloading token JSON data", data=login_data) try: - self._OAUTH_TOKEN = response.json()['access_token'] + self._OAUTH_TOKEN = login['access_token'] except KeyError: raise self.raise_login_required("Login required.") return @@ -133,4 +135,3 @@ class RoosterTeethIE(InfoExtractor): 'comment_count': comment_count, 'formats': formats, } -