mirror of
https://github.com/l1ving/youtube-dl
synced 2025-03-18 06:57:24 +08:00
Correct code style
This commit is contained in:
parent
56359a6db7
commit
dda218eece
@ -1620,9 +1620,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
||||
# due to the padding multiple video ids can lead to the same video
|
||||
# these wrong ids work but not always (not for age-gated videos)
|
||||
# it can be detected and corrected
|
||||
video_id_padded = video_id + '=' * ((4 - len(video_id) % 4) % 4) # add padding, required for decode
|
||||
video_id_padded = video_id + '=' * ((4 - len(video_id) % 4) % 4) # add padding, required for decode
|
||||
decoded_bytes = base64.urlsafe_b64decode(video_id_padded)
|
||||
real_video_id = base64.urlsafe_b64encode(decoded_bytes).decode("utf-8").replace('=','') # remove padding again
|
||||
real_video_id = base64.urlsafe_b64encode(decoded_bytes).decode("utf-8").replace('=', '') # remove padding again
|
||||
|
||||
if real_video_id != video_id:
|
||||
self.to_screen('Detected wrong video id %s, trying corrected id %s' % (video_id, real_video_id))
|
||||
|
Loading…
x
Reference in New Issue
Block a user