projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d81ffc3
)
[globo] use compat_str
author
Remita Amine
<remitamine@gmail.com>
Mon, 21 May 2018 16:46:52 +0000
(17:46 +0100)
committer
Remita Amine
<remitamine@gmail.com>
Mon, 21 May 2018 16:46:52 +0000
(17:46 +0100)
youtube_dl/extractor/globo.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/globo.py
b/youtube_dl/extractor/globo.py
index 8e6c38742d2646dee0f2097deff0ebdd67269bd2..81d6d36d325eb0af5c03a6e93536c34ae2da5bce 100644
(file)
--- a/
youtube_dl/extractor/globo.py
+++ b/
youtube_dl/extractor/globo.py
@@
-126,16
+126,16
@@
class GloboIE(InfoExtractor):
continue
hash_code = security_hash[:2]
continue
hash_code = security_hash[:2]
- received_time =
int(security_hash[2:12])
+ received_time =
security_hash[2:12]
received_random = security_hash[12:22]
received_md5 = security_hash[22:]
received_random = security_hash[12:22]
received_md5 = security_hash[22:]
- sign_time =
received_time + 86400
+ sign_time =
compat_str(int(received_time) + 86400)
padding = '%010d' % random.randint(1, 10000000000)
padding = '%010d' % random.randint(1, 10000000000)
- md5_data = (received_md5 + s
tr(sign_time)
+ padding + '0xFF01DD').encode()
+ md5_data = (received_md5 + s
ign_time
+ padding + '0xFF01DD').encode()
signed_md5 = base64.urlsafe_b64encode(hashlib.md5(md5_data).digest()).decode().strip('=')
signed_md5 = base64.urlsafe_b64encode(hashlib.md5(md5_data).digest()).decode().strip('=')
- signed_hash = hash_code +
compat_str(received_time) + received_random + compat_str(sign_time)
+ padding + signed_md5
+ signed_hash = hash_code +
received_time + received_random + sign_time
+ padding + signed_md5
signed_url = '%s?h=%s&k=%s' % (resource_url, signed_hash, 'flash')
if resource_id.endswith('m3u8') or resource_url.endswith('.m3u8'):
signed_url = '%s?h=%s&k=%s' % (resource_url, signed_hash, 'flash')
if resource_id.endswith('m3u8') or resource_url.endswith('.m3u8'):