]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/twitch.py
[cleanup] Misc
[yt-dlp.git] / yt_dlp / extractor / twitch.py
index 028e7a1e892359e5a3501bfa956d5b0ba33406db..975e09c30209b726fdbdb978293b556e371bd477 100644 (file)
@@ -19,6 +19,7 @@
     dict_get,
     float_or_none,
     int_or_none,
+    make_archive_id,
     parse_duration,
     parse_iso8601,
     parse_qs,
@@ -1162,10 +1163,13 @@ def _real_extract(self, url):
                 })
             thumbnails.append(thumb)
 
+        old_id = self._search_regex(r'%7C(\d+)(?:-\d+)?.mp4', formats[-1]['url'], 'old id', default=None)
+
         return {
             'id': clip.get('id') or video_id,
+            '_old_archive_ids': [make_archive_id(self, old_id)] if old_id else None,
             'display_id': video_id,
-            'title': clip.get('title') or video_id,
+            'title': clip.get('title'),
             'formats': formats,
             'duration': int_or_none(clip.get('durationSeconds')),
             'view_count': int_or_none(clip.get('viewCount')),