bbc.py: correct syntax

This commit is contained in:
fnord 2015-07-17 02:47:02 -05:00
parent 36da48798a
commit a3bfddfa5e

View file

@ -506,7 +506,7 @@ class BBCNewsIE(BBCCoUkIE):
if jent.get('caption', '') != '':
description += ' - ' + jent.get('caption')
thumbnail = None
if jent.has_key('image'):
if jent.get('image') is not None:
thumbnail = jent['image'].get('href')
formats = []
@ -514,7 +514,7 @@ class BBCNewsIE(BBCCoUkIE):
if programme_id:
formats, subtitles = self._download_media_selector(programme_id)
elif jent.has_key('sourceFiles'):
elif jent.get('sourceFiles') is not None:
# mediaselector not used at
# http://www.bbc.com/turkce/haberler/2015/06/150615_telabyad_kentin_cogu
for key, val in jent['sourceFiles'].items():
@ -536,8 +536,8 @@ class BBCNewsIE(BBCCoUkIE):
self._sort_formats(formats)
id = jent.get('id') if programme_id == None else programme_id
if id == None:
id = jent.get('id') if programme_id is None else programme_id
if id is None:
id = 'NA'
ret.append({