]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/orf.py
Ensure `_type` is present in `info.json`
[yt-dlp.git] / yt_dlp / extractor / orf.py
index ed8a9a84147e5e7944e1ae4cd79847d7c6eb19e8..e2b7038805e232d1c4a08c6077af1524b41d6690 100644 (file)
@@ -11,6 +11,7 @@
     float_or_none,
     HEADRequest,
     int_or_none,
+    join_nonempty,
     orderedSet,
     remove_end,
     str_or_none,
@@ -82,12 +83,7 @@ def _real_extract(self, url):
                 src = url_or_none(fd.get('src'))
                 if not src:
                     continue
-                format_id_list = []
-                for key in ('delivery', 'quality', 'quality_string'):
-                    value = fd.get(key)
-                    if value:
-                        format_id_list.append(value)
-                format_id = '-'.join(format_id_list)
+                format_id = join_nonempty('delivery', 'quality', 'quality_string', from_dict=fd)
                 ext = determine_ext(src)
                 if ext == 'm3u8':
                     m3u8_formats = self._extract_m3u8_formats(
@@ -98,6 +94,9 @@ def _real_extract(self, url):
                 elif ext == 'f4m':
                     formats.extend(self._extract_f4m_formats(
                         src, video_id, f4m_id=format_id, fatal=False))
+                elif ext == 'mpd':
+                    formats.extend(self._extract_mpd_formats(
+                        src, video_id, mpd_id=format_id, fatal=False))
                 else:
                     formats.append({
                         'format_id': format_id,
@@ -180,7 +179,7 @@ def _real_extract(self, url):
 
 class ORFRadioIE(InfoExtractor):
     def _real_extract(self, url):
-        mobj = re.match(self._VALID_URL, url)
+        mobj = self._match_valid_url(url)
         show_date = mobj.group('date')
         show_id = mobj.group('show')