about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2017-07-23 00:59:07 +0700
committerSergey M․ <dstftw@gmail.com>2017-07-23 00:59:07 +0700
commit71dde5eecf07ae3a8871e5d4a05a944097e17fb9 (patch)
treebeaf79787cf4124cb281d747f691dfb46472547e
parent935d6c20c00536cf39cf2844295266e64492bb10 (diff)
downloadyoutube-dl-71dde5eecf07ae3a8871e5d4a05a944097e17fb9.tar.gz
youtube-dl-71dde5eecf07ae3a8871e5d4a05a944097e17fb9.tar.xz
youtube-dl-71dde5eecf07ae3a8871e5d4a05a944097e17fb9.zip
[itv] Fix production id extraction (closes #13671)
-rw-r--r--youtube_dl/extractor/itv.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/youtube_dl/extractor/itv.py b/youtube_dl/extractor/itv.py
index f3156804d..26c48e4b8 100644
--- a/youtube_dl/extractor/itv.py
+++ b/youtube_dl/extractor/itv.py
@@ -59,12 +59,18 @@ class ITVIE(InfoExtractor):
         def _add_sub_element(element, name):
             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', '/')))
+
         req_env = etree.Element(_add_ns('soapenv:Envelope'))
         _add_sub_element(req_env, 'soapenv:Header')
         body = _add_sub_element(req_env, 'soapenv:Body')
         get_playlist = _add_sub_element(body, ('tem:GetPlaylist'))
         request = _add_sub_element(get_playlist, 'tem:request')
-        _add_sub_element(request, 'itv:ProductionId').text = params['data-video-id']
+        _add_sub_element(request, 'itv:ProductionId').text = production_id
         _add_sub_element(request, 'itv:RequestGuid').text = compat_str(uuid.uuid4()).upper()
         vodcrid = _add_sub_element(request, 'itv:Vodcrid')
         _add_sub_element(vodcrid, 'com:Id')