]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/infoq.py
[ie/youtube] Extract upload timestamp if available (#9856)
[yt-dlp.git] / yt_dlp / extractor / infoq.py
index abf7d36ef06304797cf1af92a96da577e4dfc93a..2bb48508caba6f43a6301c4033ba1d0134819e82 100644 (file)
@@ -1,13 +1,15 @@
+from .bokecc import BokeCCBaseIE
 from ..compat import (
     compat_b64decode,
     compat_urllib_parse_unquote,
     compat_urlparse,
 )
 from ..utils import (
+    ExtractorError,
     determine_ext,
+    traverse_obj,
     update_url_query,
 )
-from .bokecc import BokeCCBaseIE
 
 
 class InfoQIE(BokeCCBaseIE):
@@ -34,6 +36,7 @@ class InfoQIE(BokeCCBaseIE):
             'ext': 'flv',
             'description': 'md5:308d981fb28fa42f49f9568322c683ff',
         },
+        'skip': 'Sorry, the page you visited does not exist',
     }, {
         'url': 'https://www.infoq.com/presentations/Simple-Made-Easy',
         'md5': '0e34642d4d9ef44bf86f66f6399672db',
@@ -86,8 +89,10 @@ def _extract_http_video(self, webpage):
         }]
 
     def _extract_http_audio(self, webpage, video_id):
-        fields = self._form_hidden_inputs('mp3Form', webpage)
-        http_audio_url = fields.get('filename')
+        try:
+            http_audio_url = traverse_obj(self._form_hidden_inputs('mp3Form', webpage), 'filename')
+        except ExtractorError:
+            http_audio_url = None
         if not http_audio_url:
             return []
 
@@ -123,8 +128,6 @@ def _real_extract(self, url):
                 + self._extract_http_video(webpage)
                 + self._extract_http_audio(webpage, video_id))
 
-        self._sort_formats(formats)
-
         return {
             'id': video_id,
             'title': video_title,