]> jfr.im git - yt-dlp.git/commitdiff
[extractor] Standardize `_live_title`
authorpukkandan <redacted>
Wed, 15 Dec 2021 16:00:46 +0000 (21:30 +0530)
committerpukkandan <redacted>
Wed, 15 Dec 2021 16:39:07 +0000 (22:09 +0530)
67 files changed:
yt_dlp/YoutubeDL.py
yt_dlp/extractor/abc.py
yt_dlp/extractor/adobeconnect.py
yt_dlp/extractor/arcpublishing.py
yt_dlp/extractor/ard.py
yt_dlp/extractor/awaan.py
yt_dlp/extractor/bitwave.py
yt_dlp/extractor/bongacams.py
yt_dlp/extractor/brightcove.py
yt_dlp/extractor/cam4.py
yt_dlp/extractor/cammodels.py
yt_dlp/extractor/ceskatelevize.py
yt_dlp/extractor/chaturbate.py
yt_dlp/extractor/common.py
yt_dlp/extractor/dailymotion.py
yt_dlp/extractor/dlive.py
yt_dlp/extractor/douyutv.py
yt_dlp/extractor/drtv.py
yt_dlp/extractor/filmon.py
yt_dlp/extractor/francetv.py
yt_dlp/extractor/freshlive.py
yt_dlp/extractor/hitbox.py
yt_dlp/extractor/imggaming.py
yt_dlp/extractor/ivideon.py
yt_dlp/extractor/laola1tv.py
yt_dlp/extractor/line.py
yt_dlp/extractor/livestream.py
yt_dlp/extractor/mangomolo.py
yt_dlp/extractor/matchtv.py
yt_dlp/extractor/muenchentv.py
yt_dlp/extractor/nbc.py
yt_dlp/extractor/ndr.py
yt_dlp/extractor/nfl.py
yt_dlp/extractor/npo.py
yt_dlp/extractor/odnoklassniki.py
yt_dlp/extractor/oktoberfesttv.py
yt_dlp/extractor/picarto.py
yt_dlp/extractor/playtvak.py
yt_dlp/extractor/radiode.py
yt_dlp/extractor/rai.py
yt_dlp/extractor/rtbf.py
yt_dlp/extractor/rtve.py
yt_dlp/extractor/rutv.py
yt_dlp/extractor/showroomlive.py
yt_dlp/extractor/skyit.py
yt_dlp/extractor/skylinewebcams.py
yt_dlp/extractor/stripchat.py
yt_dlp/extractor/svt.py
yt_dlp/extractor/telebruxelles.py
yt_dlp/extractor/threeqsdn.py
yt_dlp/extractor/trovo.py
yt_dlp/extractor/tunein.py
yt_dlp/extractor/turner.py
yt_dlp/extractor/tv2.py
yt_dlp/extractor/tvnet.py
yt_dlp/extractor/tvplayer.py
yt_dlp/extractor/twitch.py
yt_dlp/extractor/vgtv.py
yt_dlp/extractor/vimeo.py
yt_dlp/extractor/vk.py
yt_dlp/extractor/vlive.py
yt_dlp/extractor/vyborymos.py
yt_dlp/extractor/wdr.py
yt_dlp/extractor/yahoo.py
yt_dlp/extractor/younow.py
yt_dlp/extractor/youtube.py
yt_dlp/extractor/zattoo.py

index 39fd2e1fd7ab527241806607b1b31dba03fb879d..317526d1017435b1110acbae752b5d6a99dd3216 100644 (file)
@@ -2673,6 +2673,9 @@ def process_info(self, info_dict):
             if self._num_downloads >= int(max_downloads):
                 raise MaxDownloadsReached()
 
+        if info_dict.get('is_live'):
+            info_dict['title'] += ' ' + datetime.datetime.now().strftime('%Y-%m-%d %H:%M')
+
         # TODO: backward compatibility, to be removed
         info_dict['fulltitle'] = info_dict['title']
 
index 3e202168ed39947baa38ad710622f12b8bed71e3..e3369306c5298cdc0f353a91834a918cd4ef45a3 100644 (file)
@@ -233,8 +233,6 @@ def tokenize_url(url, token):
             }]
 
         is_live = video_params.get('livestream') == '1'
-        if is_live:
-            title = self._live_title(title)
 
         return {
             'id': video_id,
index 728549eb92510e9ad3d7c1ca2d083ecdb6ffab9e..e688dddcbb98f8d2df33d095b65f9c744e8b45ce 100644 (file)
@@ -31,7 +31,7 @@ def _real_extract(self, url):
 
         return {
             'id': video_id,
-            'title': self._live_title(title) if is_live else title,
+            'title': title,
             'formats': formats,
             'is_live': is_live,
         }
index 5a9b8181a5d391a76ea038d7c660ed9016938a68..1943fd5f838c98dbf72a41c8e43ae1140c34019b 100644 (file)
@@ -158,7 +158,7 @@ def _real_extract(self, url):
 
         return {
             'id': uuid,
-            'title': self._live_title(title) if is_live else title,
+            'title': title,
             'thumbnail': try_get(video, lambda x: x['promo_image']['url']),
             'description': try_get(video, lambda x: x['subheadlines']['basic']),
             'formats': formats,
index f8d57109e1c6ee810acb19c0b2154b591b44411c..1aff0361c15ae3bfc47002e9a2d028e99c317b65 100644 (file)
@@ -280,7 +280,7 @@ def _real_extract(self, url):
 
         info.update({
             'id': video_id,
-            'title': self._live_title(title) if info.get('is_live') else title,
+            'title': title,
             'description': description,
             'thumbnail': thumbnail,
         })
index 22cc10d98872b583c0aa054532bd314de5d5596b..b5d1b57af286ed2b539640e251a7873df399afe6 100644 (file)
@@ -41,7 +41,7 @@ def _parse_video_data(self, video_data, video_id, is_live):
 
         return {
             'id': video_id,
-            'title': self._live_title(title) if is_live else title,
+            'title': title,
             'description': video_data.get('description_en') or video_data.get('description_ar'),
             'thumbnail': 'http://admin.mangomolo.com/analytics/%s' % img if img else None,
             'duration': int_or_none(video_data.get('duration')),
index eb16c469df3a90a763ff2ecc8339b97ed0365324..e6e093f5977d53279db6d624cef0c7b354274ffc 100644 (file)
@@ -51,7 +51,7 @@ def _real_extract(self, url):
 
         return {
             'id': username,
-            'title': self._live_title(channel['data']['title']),
+            'title': channel['data']['title'],
             'uploader': username,
             'uploader_id': username,
             'formats': formats,
index 9e7551136e2f05de45732f627ce771313cbbbb53..4e346e7b6ec47efe9f0c40465799aa0d74b34284 100644 (file)
@@ -49,7 +49,7 @@ def _real_extract(self, url):
 
         return {
             'id': channel_id,
-            'title': self._live_title(uploader or uploader_id),
+            'title': uploader or uploader_id,
             'uploader': uploader,
             'uploader_id': uploader_id,
             'like_count': like_count,
index 82bb76f2998d0aa8143a239a763b832f9653bb2d..6fd15653c5ae379efc56328477643006b2586115 100644 (file)
@@ -581,7 +581,7 @@ def build_format_id(kind):
 
         return {
             'id': video_id,
-            'title': self._live_title(title) if is_live else title,
+            'title': title,
             'description': clean_html(json_data.get('description')),
             'thumbnail': json_data.get('thumbnail') or json_data.get('poster'),
             'thumbnials': thumbnails,
index 30daf2be9aa0038ab1d2e5e24f2f39a8fb295b00..f47de9176ddc33718afc98d649d89bd972fff763 100644 (file)
@@ -25,7 +25,7 @@ def _real_extract(self, url):
 
         return {
             'id': channel_id,
-            'title': self._live_title(channel_id),
+            'title': channel_id,
             'is_live': True,
             'age_limit': 18,
             'formats': formats,
index eb2a8b4c6a5428f6aeb8e3375de27fc9dd4a801d..3dc19377b30533c8c701979fac2931bdd5f59c84 100644 (file)
@@ -91,7 +91,7 @@ def _real_extract(self, url):
 
         return {
             'id': user_id,
-            'title': self._live_title(user_id),
+            'title': user_id,
             'is_live': True,
             'formats': formats,
             'age_limit': 18
index 6ca2f38b5fa3e544210d721fde1554012a62f215..6c90b247ee87a754ff24e209e9f6581215377e0e 100644 (file)
@@ -212,8 +212,6 @@ def _real_extract(self, url):
 
                 if playlist_len == 1:
                     final_title = playlist_title or title
-                    if is_live:
-                        final_title = self._live_title(final_title)
                 else:
                     final_title = '%s (%s)' % (playlist_title, title)
 
index a459dcb8d5fbedc00f068da023392f0898d687a2..8da51f91964356247fcfad80b4e8046747802e56 100644 (file)
@@ -101,7 +101,7 @@ def _real_extract(self, url):
 
         return {
             'id': video_id,
-            'title': self._live_title(video_id),
+            'title': video_id,
             'thumbnail': 'https://roomimg.stream.highwebmedia.com/ri/%s.jpg' % video_id,
             'age_limit': self._rta_search(webpage),
             'is_live': True,
index 5562d1862395db25cef8cbe91b6a2bb32742a4c3..431d59351217842d9b970ecda6a65e836d6fe0ab 100644 (file)
@@ -3456,10 +3456,8 @@ def _parse_jwplayer_formats(self, jwplayer_sources_data, video_id=None,
         return formats
 
     def _live_title(self, name):
-        """ Generate the title for a live video """
-        now = datetime.datetime.now()
-        now_str = now.strftime('%Y-%m-%d %H:%M')
-        return name + ' ' + now_str
+        self._downloader.deprecation_warning('yt_dlp.InfoExtractor._live_title is deprecated and does not work as expected')
+        return name
 
     def _int(self, v, name, fatal=False, **kwargs):
         res = int_or_none(v, **kwargs)
index e04e10b8659cd478688e96c6950530c937de8258..b4211e1e446b41817a415056bc0be50e10db7e7c 100644 (file)
@@ -305,7 +305,7 @@ def _real_extract(self, url):
 
         return {
             'id': video_id,
-            'title': self._live_title(title) if is_live else title,
+            'title': title,
             'description': clean_html(media.get('description')),
             'thumbnails': thumbnails,
             'duration': int_or_none(metadata.get('duration')) or None,
index 90462c0abb07b25a2521fa38f5e9354f30856b16..7410eb6c8707f03986d9fe6c3c9c3f112347c11c 100644 (file)
@@ -84,7 +84,7 @@ def _real_extract(self, url):
         self._sort_formats(formats)
         return {
             'id': display_name,
-            'title': self._live_title(title),
+            'title': title,
             'uploader': display_name,
             'uploader_id': username,
             'formats': formats,
index 9757f442259d5678cf3bd6ebeb1dbec28eb03184..26a8d645cd69b8b231941aa0d2ece6ae8f023569 100644 (file)
@@ -105,7 +105,7 @@ def _real_extract(self, url):
                 'aid': 'pcclient'
             })['data']['live_url']
 
-        title = self._live_title(unescapeHTML(room['room_name']))
+        title = unescapeHTML(room['room_name'])
         description = room.get('show_details')
         thumbnail = room.get('room_src')
         uploader = room.get('nickname')
index 7bb15f8d4cdba5e6400b8c5093c1f49849545962..70134204c5d2ea145ea699847becddb7166a01b2 100644 (file)
@@ -321,7 +321,7 @@ def _real_extract(self, url):
         channel_data = self._download_json(
             'https://www.dr.dk/mu-online/api/1.0/channel/' + channel_id,
             channel_id)
-        title = self._live_title(channel_data['Title'])
+        title = channel_data['Title']
 
         formats = []
         for streaming_server in channel_data.get('StreamingServers', []):
index f775fe0baebe47eebfd1f9bcd0eea7c76623abd9..7b43ecc0f975607e80b13d7aaa3ffd7ec76e1af4 100644 (file)
@@ -170,7 +170,7 @@ def _real_extract(self, url):
         return {
             'id': channel_id,
             'display_id': channel_data.get('alias'),
-            'title': self._live_title(title) if is_live else title,
+            'title': title,
             'description': channel_data.get('description'),
             'thumbnails': thumbnails,
             'formats': formats,
index bc5ef4df97ff49cd1611fe9bf9446149a849e34e..877c5c0556b1fe23e7ff15415311f691836b3ab7 100644 (file)
@@ -203,7 +203,7 @@ def _extract_video(self, video_id, catalogue=None):
 
         return {
             'id': video_id,
-            'title': self._live_title(title) if is_live else title,
+            'title': title,
             'thumbnail': image,
             'duration': duration,
             'timestamp': timestamp,
index 72a8459453bb2702df66664eec2ff16c0c78f1a9..ad19b81094e9564df190afa9894769423fa3a521 100644 (file)
@@ -59,9 +59,6 @@ def _real_extract(self, url):
             stream_url, video_id, 'mp4',
             'm3u8_native', m3u8_id='hls')
 
-        if is_live:
-            title = self._live_title(title)
-
         return {
             'id': video_id,
             'formats': formats,
index 3e5ff2685e0cea5f57ffbbebbe8a8129767358f5..0470d0a99c5ee5493efe00d489d7c22c5dd710a8 100644 (file)
@@ -209,6 +209,6 @@ def _real_extract(self, url):
             'https://www.smashcast.tv/api/media/live', video_id)
         metadata['formats'] = formats
         metadata['is_live'] = True
-        metadata['title'] = self._live_title(metadata.get('title'))
+        metadata['title'] = metadata.get('title')
 
         return metadata
index ef20a4b9e80d6c6f45d54067606e25c0e2b97028..14d3fad55d4aa4ae68dcb78f91a95d8b605142d3 100644 (file)
@@ -88,7 +88,7 @@ def _real_extract(self, url):
         video_data = self._download_json(dve_api_url, media_id)
         is_live = media_type == 'live'
         if is_live:
-            title = self._live_title(self._call_api('event/', media_id)['title'])
+            title = self._call_api('event/', media_id)['title']
         else:
             title = video_data['name']
 
index 01e7b22d4c2547beefafc59da2743836df1316c1..44b2208468046d9d538b578f9e7fa5919dcb5d25 100644 (file)
@@ -75,7 +75,7 @@ def _real_extract(self, url):
 
         return {
             'id': server_id,
-            'title': self._live_title(camera_name or server_id),
+            'title': camera_name or server_id,
             'description': description,
             'is_live': True,
             'formats': formats,
index fa217365a37853f471440d8138d0e20bc4115d52..b5d27c2f0758c627b35b6e8150503385ca63115c 100644 (file)
@@ -112,7 +112,7 @@ def get_flashvar(x, *args, **kwargs):
 
         return {
             'id': video_id,
-            'title': self._live_title(title) if is_live else title,
+            'title': title,
             'upload_date': unified_strdate(_v('time_date')),
             'uploader': _v('meta_organisation'),
             'categories': categories,
@@ -161,7 +161,7 @@ def _extract_video(self, url):
         return {
             'id': video_id,
             'display_id': display_id,
-            'title': self._live_title(title) if is_live else title,
+            'title': title,
             'description': video_data.get('description'),
             'thumbnail': video_data.get('image'),
             'categories': categories,
index d4bcae6c1c6db7e176252d9c09bf0b6d7257b959..e1d5f21e17416a41fa38cfb9f3ca25f51a920fda 100644 (file)
@@ -116,7 +116,7 @@ def _parse_broadcast_item(self, item):
 
         return {
             'id': broadcast_id,
-            'title': self._live_title(title) if is_live else title,
+            'title': title,
             'thumbnails': thumbnails,
             'timestamp': int_or_none(item.get('createdAt')),
             'channel': channel.get('name'),
index f591289ecde938e2aa0d5d095bb6c204ce06d99d..45bf26d26cab1b4a80dd6e19abd5e7c39daa14a3 100644 (file)
@@ -176,7 +176,7 @@ def _extract_stream_info(self, stream_info):
         return {
             'id': broadcast_id,
             'formats': formats,
-            'title': self._live_title(stream_info['stream_title']) if is_live else stream_info['stream_title'],
+            'title': stream_info['stream_title'],
             'thumbnail': stream_info.get('thumbnail_url'),
             'is_live': is_live,
         }
@@ -344,7 +344,7 @@ def _real_extract(self, url):
             is_live = video_data.get('isLive')
             info.update({
                 'id': content_id,
-                'title': self._live_title(info['title']) if is_live else info['title'],
+                'title': info['title'],
                 'formats': self._extract_video_formats(video_data, content_id),
                 'is_live': is_live,
             })
index acee370e931602bd3972eb631109e71c74c97ce8..68ce138b3e4818c8179d6883d485284f26cef2a0 100644 (file)
@@ -33,7 +33,7 @@ def _real_extract(self, url):
 
         return {
             'id': page_id,
-            'title': self._live_title(page_id) if self._IS_LIVE else page_id,
+            'title': page_id,
             'uploader_id': hidden_inputs.get('userid'),
             'duration': int_or_none(hidden_inputs.get('duration')),
             'is_live': self._IS_LIVE,
index bc9933a8134eea759918aad3475dd42c7f6b406e..e003b8d259fbcf8b19bd89ae9bf45bcb7ec8d6f1 100644 (file)
@@ -49,7 +49,7 @@ def _real_extract(self, url):
         self._sort_formats(formats)
         return {
             'id': video_id,
-            'title': self._live_title('Матч ТВ - Прямой эфир'),
+            'title': 'Матч ТВ - Прямой эфир',
             'is_live': True,
             'formats': formats,
         }
index d256236d18d2e9a244d2b170ffa9b1b4146ac588..a53929e1b4bb21f60f4d3b62de37c463d9bf1c99 100644 (file)
@@ -33,7 +33,7 @@ def _real_extract(self, url):
         display_id = 'live'
         webpage = self._download_webpage(url, display_id)
 
-        title = self._live_title(self._og_search_title(webpage))
+        title = self._og_search_title(webpage)
 
         data_js = self._search_regex(
             r'(?s)\nplaylist:\s*(\[.*?}\]),',
index f304f191afa658903ef6540230102b090b8871ec..cd573690b2bce97d509b9f14be33c035a346cbd3 100644 (file)
@@ -305,7 +305,7 @@ def _real_extract(self, url):
         self._sort_formats(formats)
         return {
             'id': video_id,
-            'title': self._live_title(title) if is_live else title,
+            'title': title,
             'description': live_source.get('description'),
             'formats': formats,
             'is_live': is_live,
@@ -545,8 +545,6 @@ def _real_extract(self, url):
 
         title = event_config['eventTitle']
         is_live = {'live': True, 'replay': False}.get(event_config.get('eventStatus'))
-        if is_live:
-            title = self._live_title(title)
 
         source_url = self._download_json(
             f'https://api-leap.nbcsports.com/feeds/assets/{pid}?application=NBCOlympics&platform=desktop&format=nbc-player&env=staging',
index f2bae2c1a0090a94a7d4ce96cf1f25f3e53df1ee..1917254b8d663b0e2e3005e61cc88f0d2a33c540 100644 (file)
@@ -245,8 +245,6 @@ def _real_extract(self, url):
 
         live = playlist.get('config', {}).get('streamType') in ['httpVideoLive', 'httpAudioLive']
         title = config['title']
-        if live:
-            title = self._live_title(title)
         uploader = ppjson.get('config', {}).get('branding')
         upload_date = ppjson.get('config', {}).get('publicationDate')
         duration = int_or_none(config.get('duration'))
index 871923e4c66afd4076db3022e59f502bba4881c4..821276a31b5aa67c59f6e85555e6468f69691d78 100644 (file)
@@ -89,7 +89,7 @@ def _parse_video_config(self, video_config, display_id):
                     'ext': determine_ext(image_url, 'jpg'),
                 }]
             info.update({
-                'title': self._live_title(title) if is_live else title,
+                'title': title,
                 'is_live': is_live,
                 'description': clean_html(item.get('description')),
                 'thumbnails': thumbnails,
index ed547d04b39af643e00a5ef90753ee2e43452c4d..a8aaef6f16f739c97df0091d8749a77561273239 100644 (file)
@@ -467,7 +467,7 @@ def add_format_url(format_url):
 
         return {
             'id': video_id,
-            'title': self._live_title(title) if is_live else title,
+            'title': title,
             'description': metadata.get('info'),
             'thumbnail': metadata.get('images', [{'url': None}])[-1]['url'],
             'upload_date': unified_strdate(metadata.get('gidsdatum')),
@@ -561,7 +561,7 @@ def _real_extract(self, url):
         return {
             'id': video_id,
             'url': stream['url'],
-            'title': self._live_title(title),
+            'title': title,
             'acodec': codec,
             'ext': codec,
             'is_live': True,
index eeb57f2fed5869884cae80e6baa37d9616915023..42f210a9b7200f37056971e851fb5b352a8a5609 100644 (file)
@@ -235,7 +235,7 @@ def _extract_desktop(self, url):
 
         assert title
         if provider == 'LIVE_TV_APP':
-            info['title'] = self._live_title(title)
+            info['title'] = title
 
         quality = qualities(('4', '0', '1', '2', '3', '5'))
 
index a914068f958943eddb79a992413d86bad1c343fa..276567436bcb64024dfa18908b9b096425a559d0 100644 (file)
@@ -25,8 +25,8 @@ def _real_extract(self, url):
         video_id = self._match_id(url)
         webpage = self._download_webpage(url, video_id)
 
-        title = self._live_title(self._html_search_regex(
-            r'<h1><strong>.*?</strong>(.*?)</h1>', webpage, 'title'))
+        title = self._html_search_regex(
+            r'<h1><strong>.*?</strong>(.*?)</h1>', webpage, 'title')
 
         clip = self._search_regex(
             r"clip:\s*\{\s*url:\s*'([^']+)'", webpage, 'clip')
index 17d08d69ee6528e0712e54a9f7bbe22e8029e23b..adf21fda87454a79a847d3fecd6dfc471b130b9d 100644 (file)
@@ -77,7 +77,7 @@ def _real_extract(self, url):
 
         return {
             'id': channel_id,
-            'title': self._live_title(title.strip()),
+            'title': title.strip(),
             'is_live': True,
             'channel': channel_id,
             'channel_id': metadata.get('id'),
index 84e92dda492466e9abea8da3bd3783c51da3719c..30c8a599e7036baede0c350b511c4338626b7835 100644 (file)
@@ -167,8 +167,6 @@ def _real_extract(self, url):
 
         title = item['title']
         is_live = item['type'] == 'stream'
-        if is_live:
-            title = self._live_title(title)
         description = self._og_search_description(webpage, default=None) or self._html_search_meta(
             'description', webpage, 'description', default=None)
         timestamp = None
index 2c06c8b1e416c4d8c0d98f3a917c0823064458f8..0382873637b44c194f56b01580fb204c019b942e 100644 (file)
@@ -29,7 +29,7 @@ def _real_extract(self, url):
             webpage, 'broadcast')
 
         broadcast = self._parse_json(jscode, radio_id)
-        title = self._live_title(broadcast['name'])
+        title = broadcast['name']
         description = broadcast.get('description') or broadcast.get('shortDescription')
         thumbnail = broadcast.get('picture4Url') or broadcast.get('picture4TransUrl') or broadcast.get('logo100x100')
 
index 4699fe17ec25012c865430636b5fd248e78467b5..39e57decd51a4ae626cb468935383c9e98bca07d 100644 (file)
@@ -318,8 +318,7 @@ def _real_extract(self, url):
         info = {
             'id': remove_start(media.get('id'), 'ContentItem-') or video_id,
             'display_id': video_id,
-            'title': self._live_title(title) if relinker_info.get(
-                'is_live') else title,
+            'title': title,
             'alt_title': strip_or_none(alt_title),
             'description': media.get('description'),
             'uploader': strip_or_none(media.get('channel')),
index f9979d0a4928789513abf736f0a77838a10f5653..4b61fdb17e8804f38414d0a03a1cf358e1466a4a 100644 (file)
@@ -85,8 +85,6 @@ def _real_extract(self, url):
 
         title = data['title']
         is_live = data.get('isLive')
-        if is_live:
-            title = self._live_title(title)
         height_re = r'-(\d+)p\.'
         formats = []
 
index 59832eeac813ec901008f0735ad6ffe32e8dca20..0654fb08b5ac94a42fd43d62fe8c52a42e5750b4 100644 (file)
@@ -160,7 +160,7 @@ def _real_extract(self, url):
 
         return {
             'id': video_id,
-            'title': self._live_title(title) if is_live else title,
+            'title': title,
             'formats': formats,
             'thumbnail': info.get('image'),
             'subtitles': subtitles,
@@ -230,7 +230,7 @@ def _real_extract(self, url):
 
         return {
             'id': video_id,
-            'title': self._live_title(title),
+            'title': title,
             'formats': self._extract_png_formats(vidplayer_id),
             'is_live': True,
         }
index 7e0de994a4bbbb6c9f5fab15ce15134887fa813b..3de86b23281cc3b1d95a075df9a339cbe763340b 100644 (file)
@@ -201,7 +201,7 @@ def _real_extract(self, url):
 
         return {
             'id': video_id,
-            'title': self._live_title(title) if is_live else title,
+            'title': title,
             'description': description,
             'thumbnail': thumbnail,
             'view_count': view_count,
index efd9d561ffcf24bc922fd65f0eef0f4aff5ba091..1aada69ac377bd6536b62ae2c0a6b35a441be548 100644 (file)
@@ -73,7 +73,7 @@ def _real_extract(self, url):
 
         return {
             'id': compat_str(room.get('live_id') or broadcaster_id),
-            'title': self._live_title(title),
+            'title': title,
             'description': room.get('description'),
             'timestamp': int_or_none(room.get('current_live_started_at')),
             'uploader': uploader,
index 14a4d8d4c7ab3896e8417ee939850df49d793885..496bb42a291970a761f2be8e45605a323328415d 100644 (file)
@@ -55,7 +55,7 @@ def _parse_video(self, video, video_id):
 
         return {
             'id': video_id,
-            'title': self._live_title(title) if is_live else title,
+            'title': title,
             'formats': formats,
             'thumbnail': dict_get(video, ('video_still', 'video_still_medium', 'thumb')),
             'description': video.get('short_desc') or None,
index b7f8ac7368724b64d48632ed4e8fedeca0e901f5..47bbb7632ec0552976159ea51c73423236f63ce2 100644 (file)
@@ -36,7 +36,7 @@ def _real_extract(self, url):
             'id': video_id,
             'url': stream_url,
             'ext': 'mp4',
-            'title': self._live_title(title),
+            'title': title,
             'description': description,
             'is_live': True,
         }
index efd0afc75eccd75f228bce4d0c96a185d1c137cb..0d4a0ce4c07d2ae141ae2d60f73a07c3313c8d64 100644 (file)
@@ -57,7 +57,7 @@ def _real_extract(self, url):
 
         return {
             'id': video_id,
-            'title': self._live_title(video_id),
+            'title': video_id,
             'description': self._og_search_description(webpage),
             'is_live': True,
             'formats': formats,
index 489f197fe1dad48b1a8b7775d4ae11f1e43dffc0..6ad01a912d527ee2160a445bacf0fe8bedbd9eaf 100644 (file)
@@ -203,10 +203,6 @@ class SVTPlayIE(SVTPlayBaseIE):
         'only_matching': True,
     }]
 
-    def _adjust_title(self, info):
-        if info['is_live']:
-            info['title'] = self._live_title(info['title'])
-
     def _extract_by_video_id(self, video_id, webpage=None):
         data = self._download_json(
             'https://api.svt.se/videoplayer-api/video/%s' % video_id,
@@ -220,7 +216,6 @@ def _extract_by_video_id(self, video_id, webpage=None):
             if not title:
                 title = video_id
             info_dict['title'] = title
-        self._adjust_title(info_dict)
         return info_dict
 
     def _real_extract(self, url):
@@ -251,7 +246,6 @@ def _real_extract(self, url):
                     'title': data['context']['dispatcher']['stores']['MetaStore']['title'],
                     'thumbnail': thumbnail,
                 })
-                self._adjust_title(info_dict)
                 return info_dict
 
             svt_id = try_get(
index a0353fe3ae30ab089d846f8360e89d21602c1446..9e8c89bd6326b9f4fca4b51ac193db108e8a5dd8 100644 (file)
@@ -69,7 +69,7 @@ def _real_extract(self, url):
         return {
             'id': article_id or display_id,
             'display_id': display_id,
-            'title': self._live_title(title) if is_live else title,
+            'title': title,
             'description': description,
             'formats': formats,
             'is_live': is_live,
index e5c6a6de1c2504a5cfed426d336fad6d98cb0f92..22b4fe7c8ce76d99bd599c486fde143c292d627b 100644 (file)
@@ -148,7 +148,7 @@ def _real_extract(self, url):
 
         return {
             'id': video_id,
-            'title': self._live_title(title) if live else title,
+            'title': title,
             'thumbnail': config.get('poster') or None,
             'description': config.get('description') or None,
             'timestamp': parse_iso8601(config.get('upload_date')),
index 127a5d2dcdf415b515f703c8b1cf7a11848a6a87..580cb533b1598b68382ba48adb04c2197550944a 100644 (file)
@@ -62,7 +62,7 @@ def _real_extract(self, url):
             raise ExtractorError('%s is offline' % username, expected=True)
         program_info = live_info['programInfo']
         program_id = program_info['id']
-        title = self._live_title(program_info['title'])
+        title = program_info['title']
 
         formats = []
         for stream_info in (program_info.get('streamInfo') or []):
index c7a5f5a63a0f683776017e24090054b8fdfbe3ae..7e51de89ed6082d35737142e85efb19726b03985 100644 (file)
@@ -62,7 +62,7 @@ def _real_extract(self, url):
 
         return {
             'id': content_id,
-            'title': self._live_title(title) if is_live else title,
+            'title': title,
             'formats': formats,
             'thumbnail': thumbnail,
             'location': location,
index 32125bc79fdad8d43fa2a06629c9c2fc7ef08295..519dc323cd0e10487454d5d609e8365d72d34db0 100644 (file)
@@ -205,7 +205,7 @@ def _extract_cvp_info(self, data_src, video_id, path_data={}, ap_data={}, fatal=
 
         return {
             'id': video_id,
-            'title': self._live_title(title) if is_live else title,
+            'title': title,
             'formats': formats,
             'subtitles': subtitles,
             'thumbnails': thumbnails,
index da351eeb0e7e709ffdc63ad65d6df2e2b7b3d777..b48dfe389f601456b260b25959d72a0963be4234 100644 (file)
@@ -106,7 +106,7 @@ def _real_extract(self, url):
         return {
             'id': video_id,
             'url': video_url,
-            'title': self._live_title(title) if is_live else title,
+            'title': title,
             'description': strip_or_none(asset.get('description')),
             'thumbnails': thumbnails,
             'timestamp': parse_iso8601(asset.get('live_broadcast_time') or asset.get('update_time')),
@@ -271,7 +271,7 @@ def _real_extract(self, url):
         return {
             'id': video_id,
             'url': video_url,
-            'title': self._live_title(title) if is_live else title,
+            'title': title,
             'description': strip_or_none(asset.get('description')),
             'thumbnails': thumbnails,
             'timestamp': parse_iso8601(asset.get('createTime')),
index 4222ff9ee239fd2b55cc7771892ace9f3c59d43f..4fe8dfb6c2eefe6027eb4d9cbe0cdbe8c4cfc7ad 100644 (file)
@@ -130,9 +130,6 @@ def _real_extract(self, url):
                 r'data-image=(["\'])(?P<url>(?:https?:)?//.+?)\1', webpage,
                 'thumbnail', default=None, group='url'))
 
-        if is_live:
-            title = self._live_title(title)
-
         view_count = int_or_none(self._search_regex(
             r'(?s)<div[^>]+\bclass=["\'].*?view-count[^>]+>.*?(\d+).*?</div>',
             webpage, 'view count', default=None))
index 8f8686a65414a2f8c390832b0a8f88483457413d..5970596b21e5010f9a9825972d348490dac19bb2 100644 (file)
@@ -80,7 +80,7 @@ def _real_extract(self, url):
         return {
             'id': resource_id,
             'display_id': display_id,
-            'title': self._live_title(title),
+            'title': title,
             'formats': formats,
             'is_live': True,
         }
index cd97f0a2456fc04933e847951171a054486302b2..54e500edd03ba37d8b29b4266d12c1066a32cb95 100644 (file)
@@ -903,7 +903,7 @@ def _real_extract(self, url):
         return {
             'id': stream_id,
             'display_id': channel_name,
-            'title': self._live_title(title),
+            'title': title,
             'description': description,
             'thumbnail': thumbnail,
             'uploader': uploader,
index b6131ff82878c9311f5933642def3e478918bf5b..10083cd24158a348c1e3ed5b804a530639ba2add 100644 (file)
@@ -242,7 +242,7 @@ def _real_extract(self, url):
 
         info.update({
             'id': video_id,
-            'title': self._live_title(data['title']) if is_live else data['title'],
+            'title': data['title'],
             'description': data['description'],
             'thumbnail': data['images']['main'] + '?t[]=900x506q80',
             'timestamp': data['published'],
index 8c3b6af65e138a8bd1390170475214c0dba31ca2..57391d766904dd151f703bddf96423f378c48e2e 100644 (file)
@@ -224,7 +224,7 @@ def _parse_config(self, config, video_id):
 
         return {
             'id': str_or_none(video_data.get('id')) or video_id,
-            'title': self._live_title(video_title) if is_live else video_title,
+            'title': video_title,
             'uploader': owner.get('name'),
             'uploader_id': video_uploader_url.split('/')[-1] if video_uploader_url else None,
             'uploader_url': video_uploader_url,
index 9a5c9ee6bcc0863e76c208a21ba84c830077d8a1..5cdb1542dd23b681c5ac77e5d63dab48fc33c0fb 100644 (file)
@@ -434,8 +434,6 @@ def _real_extract(self, url):
         # 2 = live
         # 3 = post live (finished live)
         is_live = data.get('live') == 2
-        if is_live:
-            title = self._live_title(title)
 
         timestamp = unified_timestamp(self._html_search_regex(
             r'class=["\']mv_info_date[^>]+>([^<]+)(?:<|from)', info_page,
index 8fccf1b63b1523fefefbf47a98b8c603e67f2cc5..547bdd3237423f6a10e76a270cc0dae0c2b0a395 100644 (file)
@@ -210,7 +210,7 @@ def get_common_fields():
                 self._sort_formats(formats)
                 info = get_common_fields()
                 info.update({
-                    'title': self._live_title(video['title']),
+                    'title': video['title'],
                     'id': video_id,
                     'formats': formats,
                     'is_live': True,
index 9e703c4b6717cc3a3056a4d32ad687d4515ac2c7..4d93666c54dcebe70267fbf091d7ca048a71657a 100644 (file)
@@ -44,11 +44,11 @@ def _real_extract(self, url):
         info = self._download_json(
             'http://vybory.mos.ru/json/voting_stations/%s/%s.json'
             % (compat_str(station_id)[:3], station_id),
-            station_id, 'Downloading station JSON', fatal=False)
+            station_id, 'Downloading station JSON', fatal=False) or {}
 
         return {
             'id': station_id,
-            'title': self._live_title(info['name'] if info else station_id),
+            'title': info.get('name') or station_id,
             'description': info.get('address'),
             'is_live': True,
             'formats': formats,
index d3229d8af3495994b76345c3bdc6efac26d554cf..45bfe5f3a45beb4f91c8997361274ef910583209 100644 (file)
@@ -117,7 +117,7 @@ def _real_extract(self, url):
 
         return {
             'id': tracker_data.get('trackerClipId', video_id),
-            'title': self._live_title(title) if is_live else title,
+            'title': title,
             'alt_title': tracker_data.get('trackerClipSubcategory'),
             'formats': formats,
             'subtitles': subtitles,
index 53556de007688733d4b728ac90cd89e777ee634f..313e596f56e6ff432af40ba8f4c0cc72d9e1b566 100644 (file)
@@ -264,7 +264,7 @@ def _extract_yahoo_video(self, video_id, country):
 
         return {
             'id': video_id,
-            'title': self._live_title(title) if is_live else title,
+            'title': title,
             'formats': formats,
             'thumbnails': thumbnails,
             'description': clean_html(video.get('description')),
index 04dbc87fc613e9d3e4bdf04080d8889ce503d913..128faa30dfe73038fd6ac9e30c38850bc5f54931 100644 (file)
@@ -58,7 +58,7 @@ def _real_extract(self, url):
         return {
             'id': uploader,
             'is_live': True,
-            'title': self._live_title(uploader),
+            'title': uploader,
             'thumbnail': data.get('awsUrl'),
             'tags': data.get('tags'),
             'categories': data.get('tags'),
index 2bc1b5e675bef54535a56f180c859687d7407ae5..8f64b665713e678d9ad38bf06cd6ce2eec68db28 100644 (file)
@@ -2810,7 +2810,7 @@ def feed_entry(name):
 
         info = {
             'id': video_id,
-            'title': self._live_title(video_title) if is_live else video_title,
+            'title': video_title,
             'formats': formats,
             'thumbnails': thumbnails,
             # The best thumbnail that we are sure exists. Prevents unnecessary
index 98d15604dfe41624096e302b175aa1a7f7bea9f1..9435920b243524c5a81e0e54cfe91bc3e827fc70 100644 (file)
@@ -187,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: