projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1e02bc7
)
[theplatform] sign https urls
author
remitamine
<remitamine@gmail.com>
Fri, 1 Apr 2016 08:55:46 +0000
(09:55 +0100)
committer
remitamine
<remitamine@gmail.com>
Fri, 1 Apr 2016 08:58:02 +0000
(09:58 +0100)
youtube_dl/extractor/theplatform.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/theplatform.py
b/youtube_dl/extractor/theplatform.py
index 236c999724ee90f86ecad4bc2b771aefca0bf6f5..bf6f82f5ae52af83706807f7112c9bdd74138461 100644
(file)
--- a/
youtube_dl/extractor/theplatform.py
+++ b/
youtube_dl/extractor/theplatform.py
@@
-154,7
+154,7
@@
class ThePlatformIE(ThePlatformBaseIE):
def hex_to_str(hex):
return binascii.a2b_hex(hex)
- relative_path =
url.split('http://link.theplatform.com/s/')[1].split('?')[0]
+ relative_path =
re.match(r'https?://link.theplatform.com/s/([^?]+)', url).group(1)
clear_text = hex_to_str(flags + expiration_date + str_to_hex(relative_path))
checksum = hmac.new(sig_key.encode('ascii'), clear_text, hashlib.sha1).hexdigest()
sig = flags + expiration_date + checksum + str_to_hex(sig_secret)