summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPhilipp Hagemeister <[email protected]>2013-10-28 08:35:40 -0700
committerPhilipp Hagemeister <[email protected]>2013-10-28 08:35:40 -0700
commit79b3f6122840cf386cde6c9ec13453121944c7b0 (patch)
treed55434b74fc25666c4417955d2b3f2be3f7a7372
parent78a3a9f89ef4a9918c0e6dc854b99df9c2a94e4e (diff)
parent216d71d001989725b402a7ebee4715541314fd61 (diff)
downloadyoutube-dl-79b3f6122840cf386cde6c9ec13453121944c7b0.tar.gz
youtube-dl-79b3f6122840cf386cde6c9ec13453121944c7b0.zip
Merge pull request #1675 from rzhxeo/fix
Check if description and thumbnail are None to prevent crash
-rw-r--r--youtube_dl/YoutubeDL.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py
index 19dabef2d..313295839 100644
--- a/youtube_dl/YoutubeDL.py
+++ b/youtube_dl/YoutubeDL.py
@@ -575,9 +575,9 @@ class YoutubeDL(object):
if self.params.get('forceurl', False):
# For RTMP URLs, also include the playpath
compat_print(info_dict['url'] + info_dict.get('play_path', u''))
- if self.params.get('forcethumbnail', False) and 'thumbnail' in info_dict:
+ if self.params.get('forcethumbnail', False) and info_dict.get('thumbnail') is not None:
compat_print(info_dict['thumbnail'])
- if self.params.get('forcedescription', False) and 'description' in info_dict:
+ if self.params.get('forcedescription', False) and info_dict.get('description') is not None:
compat_print(info_dict['description'])
if self.params.get('forcefilename', False) and filename is not None:
compat_print(filename)