mirror of
https://gitlab.com/dstftw/youtube-dl.git
synced 2020-11-16 09:42:26 +00:00
[itv] update hls formats extraction
This commit is contained in:
parent
53f024e7c5
commit
115afb77ec
|
@ -4,6 +4,7 @@ from __future__ import unicode_literals
|
||||||
import uuid
|
import uuid
|
||||||
import xml.etree.ElementTree as etree
|
import xml.etree.ElementTree as etree
|
||||||
import json
|
import json
|
||||||
|
import re
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..compat import (
|
from ..compat import (
|
||||||
|
@ -142,9 +143,9 @@ class ITVIE(InfoExtractor):
|
||||||
f['url'] = rtmp_url
|
f['url'] = rtmp_url
|
||||||
formats.append(f)
|
formats.append(f)
|
||||||
|
|
||||||
ios_playlist_url = params.get('data-video-playlist')
|
ios_playlist_url = params.get('data-video-playlist') or params.get('data-video-id')
|
||||||
hmac = params.get('data-video-hmac')
|
hmac = params.get('data-video-hmac')
|
||||||
if ios_playlist_url and hmac:
|
if ios_playlist_url and hmac and re.match(r'https?://', ios_playlist_url):
|
||||||
headers = self.geo_verification_headers()
|
headers = self.geo_verification_headers()
|
||||||
headers.update({
|
headers.update({
|
||||||
'Accept': 'application/vnd.itv.vod.playlist.v2+json',
|
'Accept': 'application/vnd.itv.vod.playlist.v2+json',
|
||||||
|
@ -159,12 +160,12 @@ class ITVIE(InfoExtractor):
|
||||||
'token': ''
|
'token': ''
|
||||||
},
|
},
|
||||||
'device': {
|
'device': {
|
||||||
'manufacturer': 'Apple',
|
'manufacturer': 'Safari',
|
||||||
'model': 'iPad',
|
'model': '5',
|
||||||
'os': {
|
'os': {
|
||||||
'name': 'iPhone OS',
|
'name': 'Windows NT',
|
||||||
'version': '9.3',
|
'version': '6.1',
|
||||||
'type': 'ios'
|
'type': 'desktop'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'client': {
|
'client': {
|
||||||
|
@ -173,10 +174,10 @@ class ITVIE(InfoExtractor):
|
||||||
},
|
},
|
||||||
'variantAvailability': {
|
'variantAvailability': {
|
||||||
'featureset': {
|
'featureset': {
|
||||||
'min': ['hls', 'aes'],
|
'min': ['hls', 'aes', 'outband-webvtt'],
|
||||||
'max': ['hls', 'aes']
|
'max': ['hls', 'aes', 'outband-webvtt']
|
||||||
},
|
},
|
||||||
'platformTag': 'mobile'
|
'platformTag': 'dotcom'
|
||||||
}
|
}
|
||||||
}).encode(), headers=headers, fatal=False)
|
}).encode(), headers=headers, fatal=False)
|
||||||
if ios_playlist:
|
if ios_playlist:
|
||||||
|
|
Loading…
Reference in a new issue