X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fitv.py;h=ad2f4eca51308d530823646a4de855bed87f95ff;hb=dbeafce5d58b0d40b7af35e5276f77855ced81a4;hp=d05a7b68dc2179741dffc46313b14774f03254a1;hpb=a4ec45179e554e9b24e32c3c06908804b42a5a9c;p=youtube-dl diff --git a/youtube_dl/extractor/itv.py b/youtube_dl/extractor/itv.py index d05a7b68d..ad2f4eca5 100644 --- a/youtube_dl/extractor/itv.py +++ b/youtube_dl/extractor/itv.py @@ -20,6 +20,7 @@ from ..utils import ( merge_dicts, parse_duration, smuggle_url, + url_or_none, xpath_with_ns, xpath_element, xpath_text, @@ -76,10 +77,10 @@ class ITVIE(InfoExtractor): return etree.SubElement(element, _add_ns(name)) production_id = ( - params.get('data-video-autoplay-id') or - '%s#001' % ( - params.get('data-video-episode-id') or - video_id.replace('a', '/'))) + params.get('data-video-autoplay-id') + or '%s#001' % ( + params.get('data-video-episode-id') + or video_id.replace('a', '/'))) req_env = etree.Element(_add_ns('soapenv:Envelope')) _add_sub_element(req_env, 'soapenv:Header') @@ -250,8 +251,8 @@ class ITVIE(InfoExtractor): for sub in subs: if not isinstance(sub, dict): continue - href = sub.get('Href') - if isinstance(href, compat_str): + href = url_or_none(sub.get('Href')) + if href: extract_subtitle(href) if not info.get('duration'): info['duration'] = parse_duration(video_data.get('Duration'))