]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/puhutv.py
[ie/youtube] Extract upload timestamp if available (#9856)
[yt-dlp.git] / yt_dlp / extractor / puhutv.py
index a5dac1dff563794b13e185f44a94a762987041ea..fc4c29e95fea8f732c3f85d2b9938e1186a15f3d 100644 (file)
@@ -1,12 +1,10 @@
 from .common import InfoExtractor
-from ..compat import (
-    compat_HTTPError,
-    compat_str,
-)
+from ..compat import compat_str
+from ..networking.exceptions import HTTPError
 from ..utils import (
     ExtractorError,
-    int_or_none,
     float_or_none,
+    int_or_none,
     parse_resolution,
     str_or_none,
     try_get,
@@ -72,7 +70,7 @@ def _real_extract(self, url):
                 display_id, 'Downloading video JSON',
                 headers=self.geo_verification_headers())
         except ExtractorError as e:
-            if isinstance(e.cause, compat_HTTPError) and e.cause.code == 403:
+            if isinstance(e.cause, HTTPError) and e.cause.status == 403:
                 self.raise_geo_restricted()
             raise
 
@@ -111,7 +109,6 @@ def _real_extract(self, url):
                 format_id += '-%sp' % quality
             f['format_id'] = format_id
             formats.append(f)
-        self._sort_formats(formats)
 
         creator = try_get(
             show, lambda x: x['producer']['name'], compat_str)