A feature-rich command-line audio/video downloader
[ie/youtube] Extract `media_type` for livestreams (#11605)
nosoop421bc72103d1
diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.pyindex f1c055f3b8..738ade1b02 100644--- a/yt_dlp/extractor/youtube.py+++ b/yt_dlp/extractor/youtube.py@@ -2646,16 +2646,17 @@ class YoutubeIE(YoutubeBaseInfoExtractor):'timestamp': 1657627949,'release_date': '20220712','channel_url': 'https://www.youtube.com/channel/UCSJ4gkVC6NrvII8umztf0Ow',- 'description': 'md5:13a6f76df898f5674f9127139f3df6f7',+ 'description': 'md5:452d5c82f72bb7e62a4e0297c3f01c23','age_limit': 0,'thumbnail': 'https://i.ytimg.com/vi/jfKfPfyJRdk/maxresdefault.jpg','release_timestamp': 1657641570,'uploader_url': 'https://www.youtube.com/@LofiGirl','channel_follower_count': int,'channel_is_verified': True,- 'title': r're:^lofi hip hop radio π - beats to relax/study to',+ 'title': r're:^lofi hip hop radio π beats to relax/study to','view_count': int,'live_status': 'is_live',+ 'media_type': 'livestream','tags': 'count:32','channel': 'Lofi Girl','availability': 'public',@@ -2816,6 +2817,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):'skip': 'Age-restricted; requires authentication',},{+ 'note': 'Support /live/ URL + media type for post-live content','url': 'https://www.youtube.com/live/qVv6vCqciTM','info_dict': {'id': 'qVv6vCqciTM',@@ -2838,6 +2840,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):'channel_id': 'UCIdEIHpS0TdkqRkHL5OkLtA','categories': ['Entertainment'],'live_status': 'was_live',+ 'media_type': 'livestream','release_timestamp': 1671793345,'channel': 'γγͺγ‘γγγγ','description': 'md5:6aebf95cc4a1d731aebc01ad6cc9806d',@@ -4806,6 +4809,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):'tags': keywords,'playable_in_embed': get_first(playability_statuses, 'playableInEmbed'),'live_status': live_status,+ 'media_type': 'livestream' if get_first(video_details, 'isLiveContent') else None,'release_timestamp': live_start_time,'_format_sort_fields': ( # source_preference is lower for potentially damaged formats'quality', 'res', 'fps', 'hdr:12', 'source', 'vcodec', 'channels', 'acodec', 'lang', 'proto'),