aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2019-01-09 19:17:58 +0100
committerRemita Amine <remitamine@gmail.com>2019-01-09 19:17:58 +0100
commit65615be36874fe98d5a972546e8024cda3879c86 (patch)
tree87a7814d4a12ebffda53cc42d82189c4ffe2c0b0 /youtube_dl
parent3c1089dba41f137dcc6c373daacdc19a24aef81c (diff)
[globo] set GLBID cookie manually(closes #17346)
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/globo.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/youtube_dl/extractor/globo.py b/youtube_dl/extractor/globo.py
index c2140c362..fb8f7679b 100644
--- a/youtube_dl/extractor/globo.py
+++ b/youtube_dl/extractor/globo.py
@@ -72,7 +72,7 @@ class GloboIE(InfoExtractor):
return
try:
- self._download_json(
+ glb_id = (self._download_json(
'https://login.globo.com/api/authentication', None, data=json.dumps({
'payload': {
'email': email,
@@ -81,7 +81,9 @@ class GloboIE(InfoExtractor):
},
}).encode(), headers={
'Content-Type': 'application/json; charset=utf-8',
- })
+ }) or {}).get('glbId')
+ if glb_id:
+ self._set_cookie('.globo.com', 'GLBID', glb_id)
except ExtractorError as e:
if isinstance(e.cause, compat_HTTPError) and e.cause.code == 401:
resp = self._parse_json(e.cause.read(), None)