]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/polsatgo.py
[ie/youtube] Suppress "Unavailable videos are hidden" warning (#10159)
[yt-dlp.git] / yt_dlp / extractor / polsatgo.py
index 1524a1fb9f8e8b8f903d3aa23bbd4a150cdfaffc..d4a0d6ab872a82cddb8c165665ac1bf4bf6ca79a 100644 (file)
@@ -1,12 +1,12 @@
-from uuid import uuid4
 import json
+import uuid
 
 from .common import InfoExtractor
 from ..utils import (
+    ExtractorError,
     int_or_none,
     try_get,
     url_or_none,
-    ExtractorError,
 )
 
 
@@ -33,7 +33,7 @@ def _extract_formats(self, sources, video_id):
                 continue
             yield {
                 'url': url,
-                'height': int_or_none(try_get(source, lambda x: x['quality'][:-1]))
+                'height': int_or_none(try_get(source, lambda x: x['quality'][:-1])),
             }
 
     def _real_extract(self, url):
@@ -47,11 +47,11 @@ def _real_extract(self, url):
             'id': video_id,
             'title': media['displayInfo']['title'],
             'formats': formats,
-            'age_limit': int_or_none(media['displayInfo']['ageGroup'])
+            'age_limit': int_or_none(media['displayInfo']['ageGroup']),
         }
 
     def _call_api(self, endpoint, media_id, method, params):
-        rand_uuid = str(uuid4())
+        rand_uuid = str(uuid.uuid4())
         res = self._download_json(
             f'https://b2c-mobile.redefine.pl/rpc/{endpoint}/', media_id,
             note=f'Downloading {method} JSON metadata',
@@ -77,7 +77,7 @@ def _call_api(self, endpoint, media_id, method, params):
                     'clientId': rand_uuid,
                     'cpid': 1,
                 },
-            }).encode('utf-8'),
+            }).encode(),
             headers={'Content-type': 'application/json'})
         if not res.get('result'):
             if res['error']['code'] == 13404: