aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/itv.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2018-07-21 19:08:28 +0700
committerSergey M․ <dstftw@gmail.com>2018-07-21 19:08:28 +0700
commit3052a30d4259b182904e5d2430077039461745bb (patch)
tree90ff37fa326c33aff3ad82cd40a2f3ce856ee65b /youtube_dl/extractor/itv.py
parent4ecf300d13a6503ae80b76e01047b41d86ab4d92 (diff)
Improve URL extraction
Diffstat (limited to 'youtube_dl/extractor/itv.py')
-rw-r--r--youtube_dl/extractor/itv.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/youtube_dl/extractor/itv.py b/youtube_dl/extractor/itv.py
index d05a7b68d..de65b6bb4 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,
@@ -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'))