1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-03-28 05:50:01 +08:00

Remove excessive verbosity and unncessary string formatting.

This commit is contained in:
ddmgy 2018-06-12 19:09:21 -04:00
parent 990f14755a
commit c8d612bfd2

View File

@ -78,12 +78,7 @@ class RoosterTeethIE(InfoExtractor):
created_at = response.get('created_at', 0) created_at = response.get('created_at', 0)
expires_in = response.get('expires_in', 0) expires_in = response.get('expires_in', 0)
self._set_cookie( self._set_cookie('.roosterteeth.com', 'rt_access_token', self._ACCESS_TOKEN, created_at + expires_in)
'.roosterteeth.com',
'rt_access_token',
self._ACCESS_TOKEN,
created_at + expires_in
)
def _real_initialize(self): def _real_initialize(self):
self._login() self._login()
@ -93,7 +88,7 @@ class RoosterTeethIE(InfoExtractor):
headers = {} headers = {}
if self._ACCESS_TOKEN: if self._ACCESS_TOKEN:
headers['Authorization'] = 'Bearer {}'.format(self._ACCESS_TOKEN) headers['Authorization'] = 'Bearer ' + self._ACCESS_TOKEN
api_response = self._call_api( api_response = self._call_api(
display_id, display_id,
@ -178,11 +173,7 @@ class RoosterTeethIE(InfoExtractor):
if path: if path:
url = url + path url = url + path
return self._download_json( return self._download_json(url, video_id, **kwargs)
url,
video_id,
**kwargs
)
def _get_cookie(self, name): def _get_cookie(self, name):
for cookie in self._downloader.cookiejar: for cookie in self._downloader.cookiejar: