]> Raphaƫl G. Git Repositories - youtubedl/blobdiff - youtube_dl/extractor/globo.py
debian/patches: Remove patch cherry-picked from upstream.
[youtubedl] / youtube_dl / extractor / globo.py
index c2140c36274b0bd0b82a59a81eb35aa6aca9ab9e..fb8f7679b0366ad7accdf802af34a644b03aea01 100644 (file)
@@ -72,7 +72,7 @@ class GloboIE(InfoExtractor):
             return
 
         try:
             return
 
         try:
-            self._download_json(
+            glb_id = (self._download_json(
                 'https://login.globo.com/api/authentication', None, data=json.dumps({
                     'payload': {
                         'email': email,
                 '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',
                     },
                 }).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)
         except ExtractorError as e:
             if isinstance(e.cause, compat_HTTPError) and e.cause.code == 401:
                 resp = self._parse_json(e.cause.read(), None)