]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/zattoo.py
[youtube] Enforce UTC (#2402)
[yt-dlp.git] / yt_dlp / extractor / zattoo.py
index 32dcc03b1192436e6bcd38e4ff82d294b5d15d98..9435920b243524c5a81e0e54cfe91bc3e827fc70 100644 (file)
@@ -12,6 +12,7 @@
 from ..utils import (
     ExtractorError,
     int_or_none,
+    join_nonempty,
     try_get,
     url_or_none,
     urlencode_postdata,
@@ -156,15 +157,9 @@ def _extract_formats(self, cid, video_id, record_id=None, is_live=False):
                 watch_url = url_or_none(watch.get('url'))
                 if not watch_url:
                     continue
-                format_id_list = [stream_type]
-                maxrate = watch.get('maxrate')
-                if maxrate:
-                    format_id_list.append(compat_str(maxrate))
                 audio_channel = watch.get('audio_channel')
-                if audio_channel:
-                    format_id_list.append(compat_str(audio_channel))
                 preference = 1 if audio_channel == 'A' else None
-                format_id = '-'.join(format_id_list)
+                format_id = join_nonempty(stream_type, watch.get('maxrate'), audio_channel)
                 if stream_type in ('dash', 'dash_widevine', 'dash_playready'):
                     this_formats = self._extract_mpd_formats(
                         watch_url, video_id, mpd_id=format_id, fatal=False)
@@ -192,7 +187,7 @@ def _extract_video(self, channel_name, video_id, record_id=None, is_live=False):
             cid = self._extract_cid(video_id, channel_name)
             info_dict = {
                 'id': channel_name,
-                'title': self._live_title(channel_name),
+                'title': channel_name,
                 'is_live': True,
             }
         else:
@@ -217,7 +212,7 @@ class QuicklineIE(QuicklineBaseIE):
     }
 
     def _real_extract(self, url):
-        channel_name, video_id = re.match(self._VALID_URL, url).groups()
+        channel_name, video_id = self._match_valid_url(url).groups()
         return self._extract_video(channel_name, video_id)
 
 
@@ -262,7 +257,7 @@ class ZattooIE(ZattooBaseIE):
     }]
 
     def _real_extract(self, url):
-        channel_name, video_id, record_id = re.match(self._VALID_URL, url).groups()
+        channel_name, video_id, record_id = self._match_valid_url(url).groups()
         return self._extract_video(channel_name, video_id, record_id)