diff options
author | Jaime Marquínez Ferrándiz <[email protected]> | 2015-02-25 17:56:51 +0100 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <[email protected]> | 2015-02-25 17:56:51 +0100 |
commit | 13d8fbef30f1d7608b02e78818fa2ec211d69e21 (patch) | |
tree | 07e2b8b548be01ff5253924a21abda4fd4ff850a | |
parent | 37f885650c323e040a200bda9376bc7dbdf2ca25 (diff) | |
download | youtube-dl-13d8fbef30f1d7608b02e78818fa2ec211d69e21.tar.gz youtube-dl-13d8fbef30f1d7608b02e78818fa2ec211d69e21.zip |
[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.
-rw-r--r-- | youtube_dl/extractor/generic.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py index 875e1bf05..3aff57e30 100644 --- a/youtube_dl/extractor/generic.py +++ b/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, |