1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-03-10 21:57:15 +08:00

Fixed error with packages to conform to youtube-dl

This commit is contained in:
cclloyd 2018-10-09 19:42:50 -04:00
parent a91995620a
commit 044664e448

View File

@ -2,7 +2,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import re import re
import requests import json
import time import time
from .common import InfoExtractor from .common import InfoExtractor
@ -73,10 +73,12 @@ class RoosterTeethIE(InfoExtractor):
'scope': 'user public', 'scope': 'user public',
'grant_type': 'password', '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: try:
self._OAUTH_TOKEN = response.json()['access_token'] self._OAUTH_TOKEN = login['access_token']
except KeyError: except KeyError:
raise self.raise_login_required("Login required.") raise self.raise_login_required("Login required.")
return return
@ -133,4 +135,3 @@ class RoosterTeethIE(InfoExtractor):
'comment_count': comment_count, 'comment_count': comment_count,
'formats': formats, 'formats': formats,
} }