Browse Source

[generic] Don't set the 'title' if it's not defined in the entry (closes #5061)

Some of them may be an 'url' result, which in general don't have the 'title' field.
master
Jaime Marquínez Ferrándiz 9 years ago
parent
commit
13d8fbef30
1 changed files with 3 additions and 1 deletions
  1. 4
      youtube_dl/extractor/generic.py

4
youtube_dl/extractor/generic.py

@ -1208,7 +1208,9 @@ class GenericIE(InfoExtractor):
return entries[0]
else:
for num, e in enumerate(entries, start=1):
e['title'] = '%s (%d)' % (e['title'], num)
# 'url' results don't have a title
if e.get('title') is not None:
e['title'] = '%s (%d)' % (e['title'], num)
return {
'_type': 'playlist',
'entries': entries,

Loading…
Cancel
Save