Skip to content

Commit

Permalink
[globo] set GLBID cookie manually(closes #17346)
Browse files Browse the repository at this point in the history
  • Loading branch information
remitamine committed Jan 9, 2019
1 parent 3c1089d commit 65615be
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions youtube_dl/extractor/globo.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def _real_initialize(self):
return

try:
self._download_json(
glb_id = (self._download_json(
'https://login.globo.com/api/authentication', None, data=json.dumps({
'payload': {
'email': email,
Expand All @@ -81,7 +81,9 @@ def _real_initialize(self):
},
}).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)
Expand Down

0 comments on commit 65615be

Please sign in to comment.