Skip to content

Commit

Permalink
[youtube] Skip broken multifeed videos (closes #24711)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstftw authored and bbepis committed May 14, 2020
1 parent 358a4c3 commit a312363
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions youtube_dl/extractor/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -1845,15 +1845,26 @@ def replace_url(m):
# fields may contain comma as well (see
# https://github.com/ytdl-org/youtube-dl/issues/8536)
feed_data = compat_parse_qs(compat_urllib_parse_unquote_plus(feed))

def feed_entry(name):
return try_get(feed_data, lambda x: x[name][0], compat_str)

feed_id = feed_entry('id')
if not feed_id:
continue
feed_title = feed_entry('title')
title = video_title
if feed_title:
title += ' (%s)' % feed_title
entries.append({
'_type': 'url_transparent',
'ie_key': 'Youtube',
'url': smuggle_url(
'%s://www.youtube.com/watch?v=%s' % (proto, feed_data['id'][0]),
{'force_singlefeed': True}),
'title': '%s (%s)' % (video_title, feed_data['title'][0]),
'title': title,
})
feed_ids.append(feed_data['id'][0])
feed_ids.append(feed_id)
self.to_screen(
'Downloading multifeed video (%s) - add --no-playlist to just download video %s'
% (', '.join(feed_ids), video_id))
Expand Down

0 comments on commit a312363

Please sign in to comment.