mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
[globo] set GLBID cookie manually(closes #17346)
This commit is contained in:
parent
3c1089dba4
commit
65615be368
1 changed files with 4 additions and 2 deletions
|
@ -72,7 +72,7 @@ def _real_initialize(self):
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self._download_json(
|
glb_id = (self._download_json(
|
||||||
'https://login.globo.com/api/authentication', None, data=json.dumps({
|
'https://login.globo.com/api/authentication', None, data=json.dumps({
|
||||||
'payload': {
|
'payload': {
|
||||||
'email': email,
|
'email': email,
|
||||||
|
@ -81,7 +81,9 @@ def _real_initialize(self):
|
||||||
},
|
},
|
||||||
}).encode(), headers={
|
}).encode(), headers={
|
||||||
'Content-Type': 'application/json; charset=utf-8',
|
'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:
|
except ExtractorError as e:
|
||||||
if isinstance(e.cause, compat_HTTPError) and e.cause.code == 401:
|
if isinstance(e.cause, compat_HTTPError) and e.cause.code == 401:
|
||||||
resp = self._parse_json(e.cause.read(), None)
|
resp = self._parse_json(e.cause.read(), None)
|
||||||
|
|
Loading…
Reference in a new issue