Merge remote-tracking branch 'upstream/master' into myversion
This commit is contained in:
commit
c1423d2098
6
.github/ISSUE_TEMPLATE.md
vendored
6
.github/ISSUE_TEMPLATE.md
vendored
@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### Make sure you are using the *latest* version: run `youtube-dl --version` and ensure your version is *2018.06.19*. If it's not, read [this FAQ entry](https://github.com/rg3/youtube-dl/blob/master/README.md#how-do-i-update-youtube-dl) and update. Issues with outdated version will be rejected.
|
### Make sure you are using the *latest* version: run `youtube-dl --version` and ensure your version is *2018.06.25*. If it's not, read [this FAQ entry](https://github.com/rg3/youtube-dl/blob/master/README.md#how-do-i-update-youtube-dl) and update. Issues with outdated version will be rejected.
|
||||||
- [ ] I've **verified** and **I assure** that I'm running youtube-dl **2018.06.19**
|
- [ ] I've **verified** and **I assure** that I'm running youtube-dl **2018.06.25**
|
||||||
|
|
||||||
### Before submitting an *issue* make sure you have:
|
### Before submitting an *issue* make sure you have:
|
||||||
- [ ] At least skimmed through the [README](https://github.com/rg3/youtube-dl/blob/master/README.md), **most notably** the [FAQ](https://github.com/rg3/youtube-dl#faq) and [BUGS](https://github.com/rg3/youtube-dl#bugs) sections
|
- [ ] At least skimmed through the [README](https://github.com/rg3/youtube-dl/blob/master/README.md), **most notably** the [FAQ](https://github.com/rg3/youtube-dl#faq) and [BUGS](https://github.com/rg3/youtube-dl#bugs) sections
|
||||||
@ -36,7 +36,7 @@ Add the `-v` flag to **your command line** you run youtube-dl with (`youtube-dl
|
|||||||
[debug] User config: []
|
[debug] User config: []
|
||||||
[debug] Command-line args: [u'-v', u'http://www.youtube.com/watch?v=BaW_jenozKcj']
|
[debug] Command-line args: [u'-v', u'http://www.youtube.com/watch?v=BaW_jenozKcj']
|
||||||
[debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251
|
[debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251
|
||||||
[debug] youtube-dl version 2018.06.19
|
[debug] youtube-dl version 2018.06.25
|
||||||
[debug] Python version 2.7.11 - Windows-2003Server-5.2.3790-SP2
|
[debug] Python version 2.7.11 - Windows-2003Server-5.2.3790-SP2
|
||||||
[debug] exe versions: ffmpeg N-75573-g1d0487f, ffprobe N-75573-g1d0487f, rtmpdump 2.4
|
[debug] exe versions: ffmpeg N-75573-g1d0487f, ffprobe N-75573-g1d0487f, rtmpdump 2.4
|
||||||
[debug] Proxy map: {}
|
[debug] Proxy map: {}
|
||||||
|
11
ChangeLog
11
ChangeLog
@ -1,3 +1,14 @@
|
|||||||
|
version 2018.06.25
|
||||||
|
|
||||||
|
Extractors
|
||||||
|
* [joj] Relax URL regular expression (#16771)
|
||||||
|
* [brightcove] Workaround sonyliv DRM protected videos (#16807)
|
||||||
|
* [motherless] Fix extraction (#16786)
|
||||||
|
* [itv] Make SOAP request non fatal and extract metadata from webpage (#16780)
|
||||||
|
- [foxnews:insider] Remove extractor (#15810)
|
||||||
|
+ [foxnews] Add support for iframe embeds (#15810, #16711)
|
||||||
|
|
||||||
|
|
||||||
version 2018.06.19
|
version 2018.06.19
|
||||||
|
|
||||||
Core
|
Core
|
||||||
|
@ -290,7 +290,6 @@
|
|||||||
- **Foxgay**
|
- **Foxgay**
|
||||||
- **foxnews**: Fox News and Fox Business Video
|
- **foxnews**: Fox News and Fox Business Video
|
||||||
- **foxnews:article**
|
- **foxnews:article**
|
||||||
- **foxnews:insider**
|
|
||||||
- **FoxSports**
|
- **FoxSports**
|
||||||
- **france2.fr:generation-what**
|
- **france2.fr:generation-what**
|
||||||
- **FranceCulture**
|
- **FranceCulture**
|
||||||
|
@ -305,8 +305,8 @@ class YoutubeDL(object):
|
|||||||
http_chunk_size.
|
http_chunk_size.
|
||||||
|
|
||||||
The following options are used by the post processors:
|
The following options are used by the post processors:
|
||||||
prefer_ffmpeg: If True, use ffmpeg instead of avconv if both are available,
|
prefer_ffmpeg: If False, use avconv instead of ffmpeg if both are available,
|
||||||
otherwise prefer avconv.
|
otherwise prefer ffmpeg.
|
||||||
postprocessor_args: A list of additional command-line arguments for the
|
postprocessor_args: A list of additional command-line arguments for the
|
||||||
postprocessor.
|
postprocessor.
|
||||||
|
|
||||||
|
@ -572,7 +572,8 @@ class BrightcoveNewIE(AdobePassIE):
|
|||||||
container = source.get('container')
|
container = source.get('container')
|
||||||
ext = mimetype2ext(source.get('type'))
|
ext = mimetype2ext(source.get('type'))
|
||||||
src = source.get('src')
|
src = source.get('src')
|
||||||
if ext == 'ism' or container == 'WVM':
|
# https://support.brightcove.com/playback-api-video-fields-reference#key_systems_object
|
||||||
|
if ext == 'ism' or container == 'WVM' or source.get('key_systems'):
|
||||||
continue
|
continue
|
||||||
elif ext == 'm3u8' or container == 'M2TS':
|
elif ext == 'm3u8' or container == 'M2TS':
|
||||||
if not src:
|
if not src:
|
||||||
@ -629,6 +630,14 @@ class BrightcoveNewIE(AdobePassIE):
|
|||||||
'format_id': build_format_id('rtmp'),
|
'format_id': build_format_id('rtmp'),
|
||||||
})
|
})
|
||||||
formats.append(f)
|
formats.append(f)
|
||||||
|
if not formats:
|
||||||
|
# for sonyliv.com DRM protected videos
|
||||||
|
s3_source_url = json_data.get('custom_fields', {}).get('s3sourceurl')
|
||||||
|
if s3_source_url:
|
||||||
|
formats.append({
|
||||||
|
'url': s3_source_url,
|
||||||
|
'format_id': 'source',
|
||||||
|
})
|
||||||
|
|
||||||
errors = json_data.get('errors')
|
errors = json_data.get('errors')
|
||||||
if not formats and errors:
|
if not formats and errors:
|
||||||
|
@ -2437,6 +2437,8 @@ class InfoExtractor(object):
|
|||||||
media_info['subtitles'].setdefault(lang, []).append({
|
media_info['subtitles'].setdefault(lang, []).append({
|
||||||
'url': absolute_url(src),
|
'url': absolute_url(src),
|
||||||
})
|
})
|
||||||
|
for f in media_info['formats']:
|
||||||
|
f.setdefault('http_headers', {})['Referer'] = base_url
|
||||||
if media_info['formats'] or media_info['subtitles']:
|
if media_info['formats'] or media_info['subtitles']:
|
||||||
entries.append(media_info)
|
entries.append(media_info)
|
||||||
return entries
|
return entries
|
||||||
|
@ -5,13 +5,15 @@ from .common import InfoExtractor
|
|||||||
from ..compat import compat_str
|
from ..compat import compat_str
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
float_or_none,
|
float_or_none,
|
||||||
unified_strdate,
|
int_or_none,
|
||||||
|
unified_timestamp,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class DctpTvIE(InfoExtractor):
|
class DctpTvIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?dctp\.tv/(?:#/)?filme/(?P<id>[^/?#&]+)'
|
_VALID_URL = r'https?://(?:www\.)?dctp\.tv/(?:#/)?filme/(?P<id>[^/?#&]+)'
|
||||||
_TEST = {
|
_TESTS = [{
|
||||||
|
# 4x3
|
||||||
'url': 'http://www.dctp.tv/filme/videoinstallation-fuer-eine-kaufhausfassade/',
|
'url': 'http://www.dctp.tv/filme/videoinstallation-fuer-eine-kaufhausfassade/',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '95eaa4f33dad413aa17b4ee613cccc6c',
|
'id': '95eaa4f33dad413aa17b4ee613cccc6c',
|
||||||
@ -19,31 +21,49 @@ class DctpTvIE(InfoExtractor):
|
|||||||
'ext': 'flv',
|
'ext': 'flv',
|
||||||
'title': 'Videoinstallation für eine Kaufhausfassade',
|
'title': 'Videoinstallation für eine Kaufhausfassade',
|
||||||
'description': 'Kurzfilm',
|
'description': 'Kurzfilm',
|
||||||
'upload_date': '20110407',
|
|
||||||
'thumbnail': r're:^https?://.*\.jpg$',
|
'thumbnail': r're:^https?://.*\.jpg$',
|
||||||
'duration': 71.24,
|
'duration': 71.24,
|
||||||
|
'timestamp': 1302172322,
|
||||||
|
'upload_date': '20110407',
|
||||||
},
|
},
|
||||||
'params': {
|
'params': {
|
||||||
# rtmp download
|
# rtmp download
|
||||||
'skip_download': True,
|
'skip_download': True,
|
||||||
},
|
},
|
||||||
}
|
}, {
|
||||||
|
# 16x9
|
||||||
|
'url': 'http://www.dctp.tv/filme/sind-youtuber-die-besseren-lehrer/',
|
||||||
|
'only_matching': True,
|
||||||
|
}]
|
||||||
|
|
||||||
|
_BASE_URL = 'http://dctp-ivms2-restapi.s3.amazonaws.com'
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
display_id = self._match_id(url)
|
display_id = self._match_id(url)
|
||||||
|
|
||||||
webpage = self._download_webpage(url, display_id)
|
version = self._download_json(
|
||||||
|
'%s/version.json' % self._BASE_URL, display_id,
|
||||||
|
'Downloading version JSON')
|
||||||
|
|
||||||
video_id = self._html_search_meta(
|
restapi_base = '%s/%s/restapi' % (
|
||||||
'DC.identifier', webpage, 'video id',
|
self._BASE_URL, version['version_name'])
|
||||||
default=None) or self._search_regex(
|
|
||||||
r'id=["\']uuid[^>]+>([^<]+)<', webpage, 'video id')
|
|
||||||
|
|
||||||
title = self._og_search_title(webpage)
|
info = self._download_json(
|
||||||
|
'%s/slugs/%s.json' % (restapi_base, display_id), display_id,
|
||||||
|
'Downloading video info JSON')
|
||||||
|
|
||||||
|
media = self._download_json(
|
||||||
|
'%s/media/%s.json' % (restapi_base, compat_str(info['object_id'])),
|
||||||
|
display_id, 'Downloading media JSON')
|
||||||
|
|
||||||
|
uuid = media['uuid']
|
||||||
|
title = media['title']
|
||||||
|
ratio = '16x9' if media.get('is_wide') else '4x3'
|
||||||
|
play_path = 'mp4:%s_dctp_0500_%s.m4v' % (uuid, ratio)
|
||||||
|
|
||||||
servers = self._download_json(
|
servers = self._download_json(
|
||||||
'http://www.dctp.tv/streaming_servers/', display_id,
|
'http://www.dctp.tv/streaming_servers/', display_id,
|
||||||
note='Downloading server list', fatal=False)
|
note='Downloading server list JSON', fatal=False)
|
||||||
|
|
||||||
if servers:
|
if servers:
|
||||||
endpoint = next(
|
endpoint = next(
|
||||||
@ -60,27 +80,35 @@ class DctpTvIE(InfoExtractor):
|
|||||||
formats = [{
|
formats = [{
|
||||||
'url': endpoint,
|
'url': endpoint,
|
||||||
'app': app,
|
'app': app,
|
||||||
'play_path': 'mp4:%s_dctp_0500_4x3.m4v' % video_id,
|
'play_path': play_path,
|
||||||
'page_url': url,
|
'page_url': url,
|
||||||
'player_url': 'http://svm-prod-dctptv-static.s3.amazonaws.com/dctptv-relaunch2012-109.swf',
|
'player_url': 'http://svm-prod-dctptv-static.s3.amazonaws.com/dctptv-relaunch2012-110.swf',
|
||||||
'ext': 'flv',
|
'ext': 'flv',
|
||||||
}]
|
}]
|
||||||
|
|
||||||
description = self._html_search_meta('DC.description', webpage)
|
thumbnails = []
|
||||||
upload_date = unified_strdate(
|
images = media.get('images')
|
||||||
self._html_search_meta('DC.date.created', webpage))
|
if isinstance(images, list):
|
||||||
thumbnail = self._og_search_thumbnail(webpage)
|
for image in images:
|
||||||
duration = float_or_none(self._search_regex(
|
if not isinstance(image, dict):
|
||||||
r'id=["\']duration_in_ms[^+]>(\d+)', webpage, 'duration',
|
continue
|
||||||
default=None), scale=1000)
|
image_url = image.get('url')
|
||||||
|
if not image_url or not isinstance(image_url, compat_str):
|
||||||
|
continue
|
||||||
|
thumbnails.append({
|
||||||
|
'url': image_url,
|
||||||
|
'width': int_or_none(image.get('width')),
|
||||||
|
'height': int_or_none(image.get('height')),
|
||||||
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': uuid,
|
||||||
'title': title,
|
|
||||||
'formats': formats,
|
|
||||||
'display_id': display_id,
|
'display_id': display_id,
|
||||||
'description': description,
|
'title': title,
|
||||||
'upload_date': upload_date,
|
'alt_title': media.get('subtitle'),
|
||||||
'thumbnail': thumbnail,
|
'description': media.get('description') or media.get('teaser'),
|
||||||
'duration': duration,
|
'timestamp': unified_timestamp(media.get('created')),
|
||||||
|
'duration': float_or_none(media.get('duration_in_ms'), scale=1000),
|
||||||
|
'thumbnails': thumbnails,
|
||||||
|
'formats': formats,
|
||||||
}
|
}
|
||||||
|
@ -1041,6 +1041,7 @@ from .stretchinternet import StretchInternetIE
|
|||||||
from .sunporno import SunPornoIE
|
from .sunporno import SunPornoIE
|
||||||
from .svt import (
|
from .svt import (
|
||||||
SVTIE,
|
SVTIE,
|
||||||
|
SVTPageIE,
|
||||||
SVTPlayIE,
|
SVTPlayIE,
|
||||||
SVTSeriesIE,
|
SVTSeriesIE,
|
||||||
)
|
)
|
||||||
|
@ -1395,17 +1395,6 @@ class GenericIE(InfoExtractor):
|
|||||||
'skip_download': True,
|
'skip_download': True,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
# SVT embed
|
|
||||||
{
|
|
||||||
'url': 'http://www.svt.se/sport/ishockey/jagr-tacklar-giroux-under-intervjun',
|
|
||||||
'info_dict': {
|
|
||||||
'id': '2900353',
|
|
||||||
'ext': 'flv',
|
|
||||||
'title': 'Här trycker Jagr till Giroux (under SVT-intervjun)',
|
|
||||||
'duration': 27,
|
|
||||||
'age_limit': 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
# Crooks and Liars embed
|
# Crooks and Liars embed
|
||||||
{
|
{
|
||||||
'url': 'http://crooksandliars.com/2015/04/fox-friends-says-protecting-atheists',
|
'url': 'http://crooksandliars.com/2015/04/fox-friends-says-protecting-atheists',
|
||||||
|
@ -18,7 +18,7 @@ class JojIE(InfoExtractor):
|
|||||||
joj:|
|
joj:|
|
||||||
https?://media\.joj\.sk/embed/
|
https?://media\.joj\.sk/embed/
|
||||||
)
|
)
|
||||||
(?P<id>[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12})
|
(?P<id>[^/?#^]+)
|
||||||
'''
|
'''
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'https://media.joj.sk/embed/a388ec4c-6019-4a4a-9312-b1bee194e932',
|
'url': 'https://media.joj.sk/embed/a388ec4c-6019-4a4a-9312-b1bee194e932',
|
||||||
@ -29,16 +29,24 @@ class JojIE(InfoExtractor):
|
|||||||
'thumbnail': r're:^https?://.*\.jpg$',
|
'thumbnail': r're:^https?://.*\.jpg$',
|
||||||
'duration': 3118,
|
'duration': 3118,
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
'url': 'https://media.joj.sk/embed/9i1cxv',
|
||||||
|
'only_matching': True,
|
||||||
}, {
|
}, {
|
||||||
'url': 'joj:a388ec4c-6019-4a4a-9312-b1bee194e932',
|
'url': 'joj:a388ec4c-6019-4a4a-9312-b1bee194e932',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
|
}, {
|
||||||
|
'url': 'joj:9i1cxv',
|
||||||
|
'only_matching': True,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _extract_urls(webpage):
|
def _extract_urls(webpage):
|
||||||
return re.findall(
|
return [
|
||||||
r'<iframe\b[^>]+\bsrc=["\'](?P<url>(?:https?:)?//media\.joj\.sk/embed/[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12})',
|
mobj.group('url')
|
||||||
webpage)
|
for mobj in re.finditer(
|
||||||
|
r'<iframe\b[^>]+\bsrc=(["\'])(?P<url>(?:https?:)?//media\.joj\.sk/embed/(?:(?!\1).)+)\1',
|
||||||
|
webpage)]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
|
@ -42,6 +42,22 @@ class MediasetIE(InfoExtractor):
|
|||||||
'categories': ['reality'],
|
'categories': ['reality'],
|
||||||
},
|
},
|
||||||
'expected_warnings': ['is not a supported codec'],
|
'expected_warnings': ['is not a supported codec'],
|
||||||
|
}, {
|
||||||
|
'url': 'http://www.video.mediaset.it/video/matrix/full_chiambretti/puntata-del-25-maggio_846685.html',
|
||||||
|
'md5': '1276f966ac423d16ba255ce867de073e',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '846685',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Puntata del 25 maggio',
|
||||||
|
'description': 'md5:ee2e456e3eb1dba5e814596655bb5296',
|
||||||
|
'thumbnail': r're:^https?://.*\.jpg$',
|
||||||
|
'duration': 6565,
|
||||||
|
'creator': 'mediaset',
|
||||||
|
'upload_date': '20180525',
|
||||||
|
'series': 'Matrix',
|
||||||
|
'categories': ['infotainment'],
|
||||||
|
},
|
||||||
|
'expected_warnings': ['HTTP Error 403: Forbidden'],
|
||||||
}, {
|
}, {
|
||||||
# clip
|
# clip
|
||||||
'url': 'http://www.video.mediaset.it/video/gogglebox/clip/un-grande-classico-della-commedia-sexy_661680.html',
|
'url': 'http://www.video.mediaset.it/video/gogglebox/clip/un-grande-classico-della-commedia-sexy_661680.html',
|
||||||
@ -70,16 +86,33 @@ class MediasetIE(InfoExtractor):
|
|||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
|
video = self._download_json(
|
||||||
|
'https://www.video.mediaset.it/html/metainfo.sjson',
|
||||||
|
video_id, 'Downloading media info', query={
|
||||||
|
'id': video_id
|
||||||
|
})['video']
|
||||||
|
|
||||||
|
title = video['title']
|
||||||
|
media_id = video.get('guid') or video_id
|
||||||
|
|
||||||
video_list = self._download_json(
|
video_list = self._download_json(
|
||||||
'http://cdnsel01.mediaset.net/GetCdn.aspx',
|
'http://cdnsel01.mediaset.net/GetCdn2018.aspx',
|
||||||
video_id, 'Downloading video CDN JSON', query={
|
video_id, 'Downloading video CDN JSON', query={
|
||||||
'streamid': video_id,
|
'streamid': media_id,
|
||||||
'format': 'json',
|
'format': 'json',
|
||||||
})['videoList']
|
})['videoList']
|
||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
for format_url in video_list:
|
for format_url in video_list:
|
||||||
if '.ism' in format_url:
|
ext = determine_ext(format_url)
|
||||||
|
if ext == 'm3u8':
|
||||||
|
formats.extend(self._extract_m3u8_formats(
|
||||||
|
format_url, video_id, 'mp4', entry_protocol='m3u8_native',
|
||||||
|
m3u8_id='hls', fatal=False))
|
||||||
|
elif ext == 'mpd':
|
||||||
|
formats.extend(self._extract_mpd_formats(
|
||||||
|
format_url, video_id, mpd_id='dash', fatal=False))
|
||||||
|
elif ext == 'ism' or '.ism' in format_url:
|
||||||
formats.extend(self._extract_ism_formats(
|
formats.extend(self._extract_ism_formats(
|
||||||
format_url, video_id, ism_id='mss', fatal=False))
|
format_url, video_id, ism_id='mss', fatal=False))
|
||||||
else:
|
else:
|
||||||
@ -89,30 +122,23 @@ class MediasetIE(InfoExtractor):
|
|||||||
})
|
})
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
mediainfo = self._download_json(
|
|
||||||
'http://plr.video.mediaset.it/html/metainfo.sjson',
|
|
||||||
video_id, 'Downloading video info JSON', query={
|
|
||||||
'id': video_id,
|
|
||||||
})['video']
|
|
||||||
|
|
||||||
title = mediainfo['title']
|
|
||||||
|
|
||||||
creator = try_get(
|
creator = try_get(
|
||||||
mediainfo, lambda x: x['brand-info']['publisher'], compat_str)
|
video, lambda x: x['brand-info']['publisher'], compat_str)
|
||||||
category = try_get(
|
category = try_get(
|
||||||
mediainfo, lambda x: x['brand-info']['category'], compat_str)
|
video, lambda x: x['brand-info']['category'], compat_str)
|
||||||
categories = [category] if category else None
|
categories = [category] if category else None
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': title,
|
'title': title,
|
||||||
'description': mediainfo.get('short-description'),
|
'description': video.get('short-description'),
|
||||||
'thumbnail': mediainfo.get('thumbnail'),
|
'thumbnail': video.get('thumbnail'),
|
||||||
'duration': parse_duration(mediainfo.get('duration')),
|
'duration': parse_duration(video.get('duration')),
|
||||||
'creator': creator,
|
'creator': creator,
|
||||||
'upload_date': unified_strdate(mediainfo.get('production-date')),
|
'upload_date': unified_strdate(video.get('production-date')),
|
||||||
'webpage_url': mediainfo.get('url'),
|
'webpage_url': video.get('url'),
|
||||||
'series': mediainfo.get('brand-value'),
|
'series': video.get('brand-value'),
|
||||||
|
'season': video.get('season'),
|
||||||
'categories': categories,
|
'categories': categories,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,8 @@ class PornComIE(InfoExtractor):
|
|||||||
|
|
||||||
config = self._parse_json(
|
config = self._parse_json(
|
||||||
self._search_regex(
|
self._search_regex(
|
||||||
r'=\s*({.+?})\s*,\s*[\da-zA-Z_]+\s*=',
|
(r'=\s*({.+?})\s*;\s*v1ar\b',
|
||||||
|
r'=\s*({.+?})\s*,\s*[\da-zA-Z_]+\s*='),
|
||||||
webpage, 'config', default='{}'),
|
webpage, 'config', default='{}'),
|
||||||
display_id, transform_source=js_to_json, fatal=False)
|
display_id, transform_source=js_to_json, fatal=False)
|
||||||
|
|
||||||
@ -69,7 +70,7 @@ class PornComIE(InfoExtractor):
|
|||||||
'height': int(height),
|
'height': int(height),
|
||||||
'filesize_approx': parse_filesize(filesize),
|
'filesize_approx': parse_filesize(filesize),
|
||||||
} for format_url, height, filesize in re.findall(
|
} for format_url, height, filesize in re.findall(
|
||||||
r'<a[^>]+href="(/download/[^"]+)">MPEG4 (\d+)p<span[^>]*>(\d+\s+[a-zA-Z]+)<',
|
r'<a[^>]+href="(/download/[^"]+)">[^<]*?(\d+)p<span[^>]*>(\d+\s*[a-zA-Z]+)<',
|
||||||
webpage)]
|
webpage)]
|
||||||
thumbnail = None
|
thumbnail = None
|
||||||
duration = None
|
duration = None
|
||||||
|
@ -12,6 +12,8 @@ from ..utils import (
|
|||||||
determine_ext,
|
determine_ext,
|
||||||
dict_get,
|
dict_get,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
|
orderedSet,
|
||||||
|
strip_or_none,
|
||||||
try_get,
|
try_get,
|
||||||
urljoin,
|
urljoin,
|
||||||
compat_str,
|
compat_str,
|
||||||
@ -137,7 +139,12 @@ class SVTPlayBaseIE(SVTBaseIE):
|
|||||||
|
|
||||||
class SVTPlayIE(SVTPlayBaseIE):
|
class SVTPlayIE(SVTPlayBaseIE):
|
||||||
IE_DESC = 'SVT Play and Öppet arkiv'
|
IE_DESC = 'SVT Play and Öppet arkiv'
|
||||||
_VALID_URL = r'https?://(?:www\.)?(?:svtplay|oppetarkiv)\.se/(?:video|klipp|kanaler)/(?P<id>[^/?#&]+)'
|
_VALID_URL = r'''(?x)
|
||||||
|
(?:
|
||||||
|
svt:(?P<svt_id>[^/?#&]+)|
|
||||||
|
https?://(?:www\.)?(?:svtplay|oppetarkiv)\.se/(?:video|klipp|kanaler)/(?P<id>[^/?#&]+)
|
||||||
|
)
|
||||||
|
'''
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'http://www.svtplay.se/video/5996901/flygplan-till-haile-selassie/flygplan-till-haile-selassie-2',
|
'url': 'http://www.svtplay.se/video/5996901/flygplan-till-haile-selassie/flygplan-till-haile-selassie-2',
|
||||||
'md5': '2b6704fe4a28801e1a098bbf3c5ac611',
|
'md5': '2b6704fe4a28801e1a098bbf3c5ac611',
|
||||||
@ -164,10 +171,40 @@ class SVTPlayIE(SVTPlayBaseIE):
|
|||||||
}, {
|
}, {
|
||||||
'url': 'https://www.svtplay.se/kanaler/svt1',
|
'url': 'https://www.svtplay.se/kanaler/svt1',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
|
}, {
|
||||||
|
'url': 'svt:1376446-003A',
|
||||||
|
'only_matching': True,
|
||||||
|
}, {
|
||||||
|
'url': 'svt:14278044',
|
||||||
|
'only_matching': True,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
def _adjust_title(self, info):
|
||||||
|
if info['is_live']:
|
||||||
|
info['title'] = self._live_title(info['title'])
|
||||||
|
|
||||||
|
def _extract_by_video_id(self, video_id, webpage=None):
|
||||||
|
data = self._download_json(
|
||||||
|
'https://api.svt.se/videoplayer-api/video/%s' % video_id,
|
||||||
|
video_id, headers=self.geo_verification_headers())
|
||||||
|
info_dict = self._extract_video(data, video_id)
|
||||||
|
if not info_dict.get('title'):
|
||||||
|
title = dict_get(info_dict, ('episode', 'series'))
|
||||||
|
if not title and webpage:
|
||||||
|
title = re.sub(
|
||||||
|
r'\s*\|\s*.+?$', '', self._og_search_title(webpage))
|
||||||
|
if not title:
|
||||||
|
title = video_id
|
||||||
|
info_dict['title'] = title
|
||||||
|
self._adjust_title(info_dict)
|
||||||
|
return info_dict
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
mobj = re.match(self._VALID_URL, url)
|
||||||
|
video_id, svt_id = mobj.group('id', 'svt_id')
|
||||||
|
|
||||||
|
if svt_id:
|
||||||
|
return self._extract_by_video_id(svt_id)
|
||||||
|
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
@ -179,10 +216,6 @@ class SVTPlayIE(SVTPlayBaseIE):
|
|||||||
|
|
||||||
thumbnail = self._og_search_thumbnail(webpage)
|
thumbnail = self._og_search_thumbnail(webpage)
|
||||||
|
|
||||||
def adjust_title(info):
|
|
||||||
if info['is_live']:
|
|
||||||
info['title'] = self._live_title(info['title'])
|
|
||||||
|
|
||||||
if data:
|
if data:
|
||||||
video_info = try_get(
|
video_info = try_get(
|
||||||
data, lambda x: x['context']['dispatcher']['stores']['VideoTitlePageStore']['data']['video'],
|
data, lambda x: x['context']['dispatcher']['stores']['VideoTitlePageStore']['data']['video'],
|
||||||
@ -193,24 +226,14 @@ class SVTPlayIE(SVTPlayBaseIE):
|
|||||||
'title': data['context']['dispatcher']['stores']['MetaStore']['title'],
|
'title': data['context']['dispatcher']['stores']['MetaStore']['title'],
|
||||||
'thumbnail': thumbnail,
|
'thumbnail': thumbnail,
|
||||||
})
|
})
|
||||||
adjust_title(info_dict)
|
self._adjust_title(info_dict)
|
||||||
return info_dict
|
return info_dict
|
||||||
|
|
||||||
video_id = self._search_regex(
|
svt_id = self._search_regex(
|
||||||
r'<video[^>]+data-video-id=["\']([\da-zA-Z-]+)',
|
r'<video[^>]+data-video-id=["\']([\da-zA-Z-]+)',
|
||||||
webpage, 'video id', default=None)
|
webpage, 'video id')
|
||||||
|
|
||||||
if video_id:
|
return self._extract_by_video_id(svt_id, webpage)
|
||||||
data = self._download_json(
|
|
||||||
'https://api.svt.se/videoplayer-api/video/%s' % video_id,
|
|
||||||
video_id, headers=self.geo_verification_headers())
|
|
||||||
info_dict = self._extract_video(data, video_id)
|
|
||||||
if not info_dict.get('title'):
|
|
||||||
info_dict['title'] = re.sub(
|
|
||||||
r'\s*\|\s*.+?$', '',
|
|
||||||
info_dict.get('episode') or self._og_search_title(webpage))
|
|
||||||
adjust_title(info_dict)
|
|
||||||
return info_dict
|
|
||||||
|
|
||||||
|
|
||||||
class SVTSeriesIE(SVTPlayBaseIE):
|
class SVTSeriesIE(SVTPlayBaseIE):
|
||||||
@ -292,3 +315,57 @@ class SVTSeriesIE(SVTPlayBaseIE):
|
|||||||
|
|
||||||
return self.playlist_result(
|
return self.playlist_result(
|
||||||
entries, series_id, title, metadata.get('description'))
|
entries, series_id, title, metadata.get('description'))
|
||||||
|
|
||||||
|
|
||||||
|
class SVTPageIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?svt\.se/(?:[^/]+/)*(?P<id>[^/?&#]+)'
|
||||||
|
_TESTS = [{
|
||||||
|
'url': 'https://www.svt.se/sport/oseedat/guide-sommartraningen-du-kan-gora-var-och-nar-du-vill',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'guide-sommartraningen-du-kan-gora-var-och-nar-du-vill',
|
||||||
|
'title': 'GUIDE: Sommarträning du kan göra var och när du vill',
|
||||||
|
},
|
||||||
|
'playlist_count': 7,
|
||||||
|
}, {
|
||||||
|
'url': 'https://www.svt.se/nyheter/inrikes/ebba-busch-thor-kd-har-delvis-ratt-om-no-go-zoner',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'ebba-busch-thor-kd-har-delvis-ratt-om-no-go-zoner',
|
||||||
|
'title': 'Ebba Busch Thor har bara delvis rätt om ”no-go-zoner”',
|
||||||
|
},
|
||||||
|
'playlist_count': 1,
|
||||||
|
}, {
|
||||||
|
# only programTitle
|
||||||
|
'url': 'http://www.svt.se/sport/ishockey/jagr-tacklar-giroux-under-intervjun',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '2900353',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Stjärnorna skojar till det - under SVT-intervjun',
|
||||||
|
'duration': 27,
|
||||||
|
'age_limit': 0,
|
||||||
|
},
|
||||||
|
}, {
|
||||||
|
'url': 'https://www.svt.se/nyheter/lokalt/vast/svt-testar-tar-nagon-upp-skrapet-1',
|
||||||
|
'only_matching': True,
|
||||||
|
}, {
|
||||||
|
'url': 'https://www.svt.se/vader/manadskronikor/maj2018',
|
||||||
|
'only_matching': True,
|
||||||
|
}]
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def suitable(cls, url):
|
||||||
|
return False if SVTIE.suitable(url) else super(SVTPageIE, cls).suitable(url)
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
playlist_id = self._match_id(url)
|
||||||
|
|
||||||
|
webpage = self._download_webpage(url, playlist_id)
|
||||||
|
|
||||||
|
entries = [
|
||||||
|
self.url_result(
|
||||||
|
'svt:%s' % video_id, ie=SVTPlayIE.ie_key(), video_id=video_id)
|
||||||
|
for video_id in orderedSet(re.findall(
|
||||||
|
r'data-video-id=["\'](\d+)', webpage))]
|
||||||
|
|
||||||
|
title = strip_or_none(self._og_search_title(webpage, default=None))
|
||||||
|
|
||||||
|
return self.playlist_result(entries, playlist_id, title)
|
||||||
|
@ -841,11 +841,11 @@ def parseOpts(overrideArguments=None):
|
|||||||
postproc.add_option(
|
postproc.add_option(
|
||||||
'--prefer-avconv',
|
'--prefer-avconv',
|
||||||
action='store_false', dest='prefer_ffmpeg',
|
action='store_false', dest='prefer_ffmpeg',
|
||||||
help='Prefer avconv over ffmpeg for running the postprocessors (default)')
|
help='Prefer avconv over ffmpeg for running the postprocessors')
|
||||||
postproc.add_option(
|
postproc.add_option(
|
||||||
'--prefer-ffmpeg',
|
'--prefer-ffmpeg',
|
||||||
action='store_true', dest='prefer_ffmpeg',
|
action='store_true', dest='prefer_ffmpeg',
|
||||||
help='Prefer ffmpeg over avconv for running the postprocessors')
|
help='Prefer ffmpeg over avconv for running the postprocessors (default)')
|
||||||
postproc.add_option(
|
postproc.add_option(
|
||||||
'--ffmpeg-location', '--avconv-location', metavar='PATH',
|
'--ffmpeg-location', '--avconv-location', metavar='PATH',
|
||||||
dest='ffmpeg_location',
|
dest='ffmpeg_location',
|
||||||
|
@ -77,7 +77,7 @@ class FFmpegPostProcessor(PostProcessor):
|
|||||||
|
|
||||||
def _determine_executables(self):
|
def _determine_executables(self):
|
||||||
programs = ['avprobe', 'avconv', 'ffmpeg', 'ffprobe']
|
programs = ['avprobe', 'avconv', 'ffmpeg', 'ffprobe']
|
||||||
prefer_ffmpeg = False
|
prefer_ffmpeg = True
|
||||||
|
|
||||||
self.basename = None
|
self.basename = None
|
||||||
self.probe_basename = None
|
self.probe_basename = None
|
||||||
@ -85,7 +85,7 @@ class FFmpegPostProcessor(PostProcessor):
|
|||||||
self._paths = None
|
self._paths = None
|
||||||
self._versions = None
|
self._versions = None
|
||||||
if self._downloader:
|
if self._downloader:
|
||||||
prefer_ffmpeg = self._downloader.params.get('prefer_ffmpeg', False)
|
prefer_ffmpeg = self._downloader.params.get('prefer_ffmpeg', True)
|
||||||
location = self._downloader.params.get('ffmpeg_location')
|
location = self._downloader.params.get('ffmpeg_location')
|
||||||
if location is not None:
|
if location is not None:
|
||||||
if not os.path.exists(location):
|
if not os.path.exists(location):
|
||||||
@ -117,19 +117,19 @@ class FFmpegPostProcessor(PostProcessor):
|
|||||||
(p, get_exe_version(p, args=['-version'])) for p in programs)
|
(p, get_exe_version(p, args=['-version'])) for p in programs)
|
||||||
self._paths = dict((p, p) for p in programs)
|
self._paths = dict((p, p) for p in programs)
|
||||||
|
|
||||||
if prefer_ffmpeg:
|
if prefer_ffmpeg is False:
|
||||||
prefs = ('ffmpeg', 'avconv')
|
|
||||||
else:
|
|
||||||
prefs = ('avconv', 'ffmpeg')
|
prefs = ('avconv', 'ffmpeg')
|
||||||
|
else:
|
||||||
|
prefs = ('ffmpeg', 'avconv')
|
||||||
for p in prefs:
|
for p in prefs:
|
||||||
if self._versions[p]:
|
if self._versions[p]:
|
||||||
self.basename = p
|
self.basename = p
|
||||||
break
|
break
|
||||||
|
|
||||||
if prefer_ffmpeg:
|
if prefer_ffmpeg is False:
|
||||||
prefs = ('ffprobe', 'avprobe')
|
|
||||||
else:
|
|
||||||
prefs = ('avprobe', 'ffprobe')
|
prefs = ('avprobe', 'ffprobe')
|
||||||
|
else:
|
||||||
|
prefs = ('ffprobe', 'avprobe')
|
||||||
for p in prefs:
|
for p in prefs:
|
||||||
if self._versions[p]:
|
if self._versions[p]:
|
||||||
self.probe_basename = p
|
self.probe_basename = p
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
__version__ = '2018.06.19'
|
__version__ = '2018.06.25'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user