mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
[youku] PEP8
This commit is contained in:
parent
8268e94cd4
commit
aed473ccf9
1 changed files with 40 additions and 40 deletions
|
@ -11,6 +11,7 @@
|
|||
|
||||
bytes_is_str = (bytes == str) # for compatible
|
||||
|
||||
|
||||
class YoukuIE(InfoExtractor):
|
||||
IE_NAME = 'youku'
|
||||
_VALID_URL = r'''(?x)
|
||||
|
@ -52,8 +53,8 @@ def yk_t(s1, s2):
|
|||
|
||||
sid, token = yk_t(
|
||||
'becaf9be',
|
||||
base64.b64decode(bytes(data2['ep'], 'ascii')) \
|
||||
if not bytes_is_str \
|
||||
base64.b64decode(bytes(data2['ep'], 'ascii'))
|
||||
if not bytes_is_str
|
||||
else base64.b64decode(data2['ep'])
|
||||
).split('_')
|
||||
|
||||
|
@ -89,13 +90,13 @@ def generate_ep(format, n):
|
|||
fileid = get_fileid(format, n)
|
||||
ep_t = yk_t(
|
||||
'bf7e5f01',
|
||||
bytes('%s_%s_%s' % (sid, fileid, token), 'ascii') \
|
||||
if not bytes_is_str \
|
||||
bytes('%s_%s_%s' % (sid, fileid, token), 'ascii')
|
||||
if not bytes_is_str
|
||||
else ('%s_%s_%s' % (sid, fileid, token))
|
||||
)
|
||||
ep = base64.b64encode(
|
||||
bytes(ep_t, 'latin') \
|
||||
if not bytes_is_str \
|
||||
bytes(ep_t, 'latin')
|
||||
if not bytes_is_str
|
||||
else ep_t
|
||||
).decode()
|
||||
return ep
|
||||
|
@ -194,7 +195,6 @@ def _real_extract(self, url):
|
|||
# construct info
|
||||
entries = []
|
||||
for fm in data1['streamtypes']:
|
||||
#formats = []
|
||||
video_urls = video_urls_dict[fm]
|
||||
for i in range(len(video_urls)):
|
||||
if len(entries) < i + 1:
|
||||
|
|
Loading…
Reference in a new issue