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']
}]
is_live = video_params.get('livestream') == '1'
- if is_live:
- title = self._live_title(title)
return {
'id': video_id,
return {
'id': video_id,
- 'title': self._live_title(title) if is_live else title,
+ 'title': title,
'formats': formats,
'is_live': is_live,
}
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,
info.update({
'id': video_id,
- 'title': self._live_title(title) if info.get('is_live') else title,
+ 'title': title,
'description': description,
'thumbnail': thumbnail,
})
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')),
return {
'id': username,
- 'title': self._live_title(channel['data']['title']),
+ 'title': channel['data']['title'],
'uploader': username,
'uploader_id': username,
'formats': formats,
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,
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,
return {
'id': channel_id,
- 'title': self._live_title(channel_id),
+ 'title': channel_id,
'is_live': True,
'age_limit': 18,
'formats': formats,
return {
'id': user_id,
- 'title': self._live_title(user_id),
+ 'title': user_id,
'is_live': True,
'formats': formats,
'age_limit': 18
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)
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,
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)
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,
self._sort_formats(formats)
return {
'id': display_name,
- 'title': self._live_title(title),
+ 'title': title,
'uploader': display_name,
'uploader_id': username,
'formats': formats,
'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')
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', []):
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,
return {
'id': video_id,
- 'title': self._live_title(title) if is_live else title,
+ 'title': title,
'thumbnail': image,
'duration': duration,
'timestamp': timestamp,
stream_url, video_id, 'mp4',
'm3u8_native', m3u8_id='hls')
- if is_live:
- title = self._live_title(title)
-
return {
'id': video_id,
'formats': formats,
'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
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']
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,
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,
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,
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'),
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,
}
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,
})
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,
self._sort_formats(formats)
return {
'id': video_id,
- 'title': self._live_title('Матч ТВ - Прямой эфир'),
+ 'title': 'Матч ТВ - Прямой эфир',
'is_live': True,
'formats': formats,
}
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*(\[.*?}\]),',
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,
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',
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'))
'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,
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')),
return {
'id': video_id,
'url': stream['url'],
- 'title': self._live_title(title),
+ 'title': title,
'acodec': codec,
'ext': codec,
'is_live': True,
assert title
if provider == 'LIVE_TV_APP':
- info['title'] = self._live_title(title)
+ info['title'] = title
quality = qualities(('4', '0', '1', '2', '3', '5'))
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')
return {
'id': channel_id,
- 'title': self._live_title(title.strip()),
+ 'title': title.strip(),
'is_live': True,
'channel': channel_id,
'channel_id': metadata.get('id'),
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
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')
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')),
title = data['title']
is_live = data.get('isLive')
- if is_live:
- title = self._live_title(title)
height_re = r'-(\d+)p\.'
formats = []
return {
'id': video_id,
- 'title': self._live_title(title) if is_live else title,
+ 'title': title,
'formats': formats,
'thumbnail': info.get('image'),
'subtitles': subtitles,
return {
'id': video_id,
- 'title': self._live_title(title),
+ 'title': title,
'formats': self._extract_png_formats(vidplayer_id),
'is_live': True,
}
return {
'id': video_id,
- 'title': self._live_title(title) if is_live else title,
+ 'title': title,
'description': description,
'thumbnail': thumbnail,
'view_count': view_count,
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,
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,
'id': video_id,
'url': stream_url,
'ext': 'mp4',
- 'title': self._live_title(title),
+ 'title': title,
'description': description,
'is_live': True,
}
return {
'id': video_id,
- 'title': self._live_title(video_id),
+ 'title': video_id,
'description': self._og_search_description(webpage),
'is_live': True,
'formats': formats,
'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,
if not title:
title = video_id
info_dict['title'] = title
- self._adjust_title(info_dict)
return info_dict
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(
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,
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')),
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 []):
return {
'id': content_id,
- 'title': self._live_title(title) if is_live else title,
+ 'title': title,
'formats': formats,
'thumbnail': thumbnail,
'location': location,
return {
'id': video_id,
- 'title': self._live_title(title) if is_live else title,
+ 'title': title,
'formats': formats,
'subtitles': subtitles,
'thumbnails': thumbnails,
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')),
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')),
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))
return {
'id': resource_id,
'display_id': display_id,
- 'title': self._live_title(title),
+ 'title': title,
'formats': formats,
'is_live': True,
}
return {
'id': stream_id,
'display_id': channel_name,
- 'title': self._live_title(title),
+ 'title': title,
'description': description,
'thumbnail': thumbnail,
'uploader': uploader,
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'],
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,
# 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,
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,
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,
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,
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')),
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'),
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
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: