1
0
mirror of https://github.com/l1ving/youtube-dl synced 2024-12-21 17:07:49 +08:00

[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.
This commit is contained in:
Jaime Marquínez Ferrándiz 2015-02-25 17:56:51 +01:00
parent 37f885650c
commit 13d8fbef30

View File

@ -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,