Skip to content

Commit

Permalink
[bot] AutoMerging: merge all upstream's changes:
Browse files Browse the repository at this point in the history
* https://github.com/ytdl-org/youtube-dl:
  [pinterest] reduce the number of HLS format requests
  [peertube] improve thumbnail extraction(closes ytdl-org#28419)
  [tver] improve title extraction(closes ytdl-org#28418)
  [fujitv] fix HLS formats extension(closes ytdl-org#28416)
  • Loading branch information
github-actions[bot] committed Mar 12, 2021
2 parents 4bcf4ab + 1182f95 commit 80370cb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion youtube_dl/extractor/fujitv.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class FujiTVFODPlus7IE(InfoExtractor):
def _real_extract(self, url):
video_id = self._match_id(url)
formats = self._extract_m3u8_formats(
self._BASE_URL + 'abr/pc_html5/%s.m3u8' % video_id, video_id)
self._BASE_URL + 'abr/pc_html5/%s.m3u8' % video_id, video_id, 'mp4')
for f in formats:
wh = self._BITRATE_MAP.get(f.get('tbr'))
if wh:
Expand Down
7 changes: 5 additions & 2 deletions youtube_dl/extractor/peertube.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,11 +599,13 @@ def channel_data(field, type_):
else:
age_limit = None

webpage_url = 'https://%s/videos/watch/%s' % (host, video_id)

return {
'id': video_id,
'title': title,
'description': description,
'thumbnail': urljoin(url, video.get('thumbnailPath')),
'thumbnail': urljoin(webpage_url, video.get('thumbnailPath')),
'timestamp': unified_timestamp(video.get('publishedAt')),
'uploader': account_data('displayName', compat_str),
'uploader_id': str_or_none(account_data('id', int)),
Expand All @@ -621,5 +623,6 @@ def channel_data(field, type_):
'tags': try_get(video, lambda x: x['tags'], list),
'categories': categories,
'formats': formats,
'subtitles': subtitles
'subtitles': subtitles,
'webpage_url': webpage_url,
}
4 changes: 3 additions & 1 deletion youtube_dl/extractor/pinterest.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,17 @@ def _extract_video(self, data, extract_formats=True):

title = (data.get('title') or data.get('grid_title') or video_id).strip()

urls = []
formats = []
duration = None
if extract_formats:
for format_id, format_dict in data['videos']['video_list'].items():
if not isinstance(format_dict, dict):
continue
format_url = url_or_none(format_dict.get('url'))
if not format_url:
if not format_url or format_url in urls:
continue
urls.append(format_url)
duration = float_or_none(format_dict.get('duration'), scale=1000)
ext = determine_ext(format_url)
if 'hls' in format_id.lower() or ext == 'm3u8':
Expand Down
11 changes: 10 additions & 1 deletion youtube_dl/extractor/tver.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
int_or_none,
remove_start,
smuggle_url,
strip_or_none,
try_get,
)

Expand All @@ -25,6 +26,10 @@ class TVerIE(InfoExtractor):
}, {
'url': 'https://tver.jp/episode/79622438',
'only_matching': True,
}, {
# subtitle = ' '
'url': 'https://tver.jp/corner/f0068870',
'only_matching': True,
}]
_TOKEN = None
BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/%s/default_default/index.html?videoId=%s'
Expand All @@ -47,8 +52,12 @@ def _real_extract(self, url):
}

if service == 'cx':
title = main['title']
subtitle = strip_or_none(main.get('subtitle'))
if subtitle:
title += ' - ' + subtitle
info.update({
'title': main.get('subtitle') or main['title'],
'title': title,
'url': 'https://i.fod.fujitv.co.jp/plus7/web/%s/%s.html' % (p_id[:4], p_id),
'ie_key': 'FujiTVFODPlus7',
})
Expand Down

0 comments on commit 80370cb

Please sign in to comment.