Merge remote-tracking branch 'rg3/master'
This commit is contained in:
commit
e98a3ec7a9
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 *2016.07.03.1*. 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 *2016.07.05*. 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 **2016.07.03.1**
|
- [ ] I've **verified** and **I assure** that I'm running youtube-dl **2016.07.05**
|
||||||
|
|
||||||
### Before submitting an *issue* make sure you have:
|
### Before submitting an *issue* make sure you have:
|
||||||
- [ ] At least skimmed through [README](https://github.com/rg3/youtube-dl/blob/master/README.md) and **most notably** [FAQ](https://github.com/rg3/youtube-dl#faq) and [BUGS](https://github.com/rg3/youtube-dl#bugs) sections
|
- [ ] At least skimmed through [README](https://github.com/rg3/youtube-dl/blob/master/README.md) and **most notably** [FAQ](https://github.com/rg3/youtube-dl#faq) and [BUGS](https://github.com/rg3/youtube-dl#bugs) sections
|
||||||
@ -35,7 +35,7 @@ $ youtube-dl -v <your command line>
|
|||||||
[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 2016.07.03.1
|
[debug] youtube-dl version 2016.07.05
|
||||||
[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: {}
|
||||||
|
@ -103,9 +103,9 @@ which means you can modify it, redistribute it or use it however you like.
|
|||||||
(experimental)
|
(experimental)
|
||||||
-6, --force-ipv6 Make all connections via IPv6
|
-6, --force-ipv6 Make all connections via IPv6
|
||||||
(experimental)
|
(experimental)
|
||||||
--cn-verification-proxy URL Use this proxy to verify the IP address for
|
--geo-verification-proxy URL Use this proxy to verify the IP address for
|
||||||
some Chinese sites. The default proxy
|
some geo-restricted sites. The default
|
||||||
specified by --proxy (or none, if the
|
proxy specified by --proxy (or none, if the
|
||||||
options is not present) is used for the
|
options is not present) is used for the
|
||||||
actual downloading. (experimental)
|
actual downloading. (experimental)
|
||||||
|
|
||||||
|
@ -405,6 +405,12 @@ class TestUtil(unittest.TestCase):
|
|||||||
self.assertEqual(res_url, url)
|
self.assertEqual(res_url, url)
|
||||||
self.assertEqual(res_data, None)
|
self.assertEqual(res_data, None)
|
||||||
|
|
||||||
|
smug_url = smuggle_url(url, {'a': 'b'})
|
||||||
|
smug_smug_url = smuggle_url(smug_url, {'c': 'd'})
|
||||||
|
res_url, res_data = unsmuggle_url(smug_smug_url)
|
||||||
|
self.assertEqual(res_url, url)
|
||||||
|
self.assertEqual(res_data, {'a': 'b', 'c': 'd'})
|
||||||
|
|
||||||
def test_shell_quote(self):
|
def test_shell_quote(self):
|
||||||
args = ['ffmpeg', '-i', encodeFilename('ñ€ß\'.mp4')]
|
args = ['ffmpeg', '-i', encodeFilename('ñ€ß\'.mp4')]
|
||||||
self.assertEqual(shell_quote(args), """ffmpeg -i 'ñ€ß'"'"'.mp4'""")
|
self.assertEqual(shell_quote(args), """ffmpeg -i 'ñ€ß'"'"'.mp4'""")
|
||||||
|
@ -1066,6 +1066,7 @@ from .youtube import (
|
|||||||
YoutubeSearchDateIE,
|
YoutubeSearchDateIE,
|
||||||
YoutubeSearchIE,
|
YoutubeSearchIE,
|
||||||
YoutubeSearchURLIE,
|
YoutubeSearchURLIE,
|
||||||
|
YoutubeSharedVideoIE,
|
||||||
YoutubeShowIE,
|
YoutubeShowIE,
|
||||||
YoutubeSubscriptionsIE,
|
YoutubeSubscriptionsIE,
|
||||||
YoutubeTruncatedIDIE,
|
YoutubeTruncatedIDIE,
|
||||||
|
@ -1295,6 +1295,21 @@ class GenericIE(InfoExtractor):
|
|||||||
'uploader': 'cylus cyrus',
|
'uploader': 'cylus cyrus',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
# video stored on custom kaltura server
|
||||||
|
'url': 'http://www.expansion.com/multimedia/videos.html?media=EQcM30NHIPv',
|
||||||
|
'md5': '537617d06e64dfed891fa1593c4b30cc',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '0_1iotm5bh',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Elecciones británicas: 5 lecciones para Rajoy',
|
||||||
|
'description': 'md5:435a89d68b9760b92ce67ed227055f16',
|
||||||
|
'uploader_id': 'videos.expansion@el-mundo.net',
|
||||||
|
'upload_date': '20150429',
|
||||||
|
'timestamp': 1430303472,
|
||||||
|
},
|
||||||
|
'add_ie': ['Kaltura'],
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
def report_following_redirect(self, new_url):
|
def report_following_redirect(self, new_url):
|
||||||
|
@ -6,7 +6,6 @@ import base64
|
|||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..compat import (
|
from ..compat import (
|
||||||
compat_urllib_parse_urlencode,
|
|
||||||
compat_urlparse,
|
compat_urlparse,
|
||||||
compat_parse_qs,
|
compat_parse_qs,
|
||||||
)
|
)
|
||||||
@ -15,6 +14,7 @@ from ..utils import (
|
|||||||
ExtractorError,
|
ExtractorError,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
unsmuggle_url,
|
unsmuggle_url,
|
||||||
|
smuggle_url,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -34,7 +34,8 @@ class KalturaIE(InfoExtractor):
|
|||||||
)(?:/(?P<path>[^?]+))?(?:\?(?P<query>.*))?
|
)(?:/(?P<path>[^?]+))?(?:\?(?P<query>.*))?
|
||||||
)
|
)
|
||||||
'''
|
'''
|
||||||
_API_BASE = 'http://cdnapi.kaltura.com/api_v3/index.php?'
|
_SERVICE_URL = 'http://cdnapi.kaltura.com'
|
||||||
|
_SERVICE_BASE = '/api_v3/index.php'
|
||||||
_TESTS = [
|
_TESTS = [
|
||||||
{
|
{
|
||||||
'url': 'kaltura:269692:1_1jc2y3e4',
|
'url': 'kaltura:269692:1_1jc2y3e4',
|
||||||
@ -88,18 +89,26 @@ class KalturaIE(InfoExtractor):
|
|||||||
(?P<q3>["\'])(?P<id>.+?)(?P=q3)
|
(?P<q3>["\'])(?P<id>.+?)(?P=q3)
|
||||||
''', webpage))
|
''', webpage))
|
||||||
if mobj:
|
if mobj:
|
||||||
return 'kaltura:%(partner_id)s:%(id)s' % mobj.groupdict()
|
embed_info = mobj.groupdict()
|
||||||
|
url = 'kaltura:%(partner_id)s:%(id)s' % embed_info
|
||||||
|
escaped_pid = re.escape(embed_info['partner_id'])
|
||||||
|
service_url = re.search(
|
||||||
|
r'<script[^>]+src=["\']((?:https?:)?//.+?)/p/%s/sp/%s00/embedIframeJs' % (escaped_pid, escaped_pid),
|
||||||
|
webpage)
|
||||||
|
if service_url:
|
||||||
|
url = smuggle_url(url, {'service_url': service_url.group(1)})
|
||||||
|
return url
|
||||||
|
|
||||||
def _kaltura_api_call(self, video_id, actions, *args, **kwargs):
|
def _kaltura_api_call(self, video_id, actions, service_url=None, *args, **kwargs):
|
||||||
params = actions[0]
|
params = actions[0]
|
||||||
if len(actions) > 1:
|
if len(actions) > 1:
|
||||||
for i, a in enumerate(actions[1:], start=1):
|
for i, a in enumerate(actions[1:], start=1):
|
||||||
for k, v in a.items():
|
for k, v in a.items():
|
||||||
params['%d:%s' % (i, k)] = v
|
params['%d:%s' % (i, k)] = v
|
||||||
|
|
||||||
query = compat_urllib_parse_urlencode(params)
|
data = self._download_json(
|
||||||
url = self._API_BASE + query
|
(service_url or self._SERVICE_URL) + self._SERVICE_BASE,
|
||||||
data = self._download_json(url, video_id, *args, **kwargs)
|
video_id, query=params, *args, **kwargs)
|
||||||
|
|
||||||
status = data if len(actions) == 1 else data[0]
|
status = data if len(actions) == 1 else data[0]
|
||||||
if status.get('objectType') == 'KalturaAPIException':
|
if status.get('objectType') == 'KalturaAPIException':
|
||||||
@ -108,7 +117,7 @@ class KalturaIE(InfoExtractor):
|
|||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def _get_kaltura_signature(self, video_id, partner_id):
|
def _get_kaltura_signature(self, video_id, partner_id, service_url=None):
|
||||||
actions = [{
|
actions = [{
|
||||||
'apiVersion': '3.1',
|
'apiVersion': '3.1',
|
||||||
'expiry': 86400,
|
'expiry': 86400,
|
||||||
@ -118,10 +127,10 @@ class KalturaIE(InfoExtractor):
|
|||||||
'widgetId': '_%s' % partner_id,
|
'widgetId': '_%s' % partner_id,
|
||||||
}]
|
}]
|
||||||
return self._kaltura_api_call(
|
return self._kaltura_api_call(
|
||||||
video_id, actions, note='Downloading Kaltura signature')['ks']
|
video_id, actions, service_url, note='Downloading Kaltura signature')['ks']
|
||||||
|
|
||||||
def _get_video_info(self, video_id, partner_id):
|
def _get_video_info(self, video_id, partner_id, service_url=None):
|
||||||
signature = self._get_kaltura_signature(video_id, partner_id)
|
signature = self._get_kaltura_signature(video_id, partner_id, service_url)
|
||||||
actions = [
|
actions = [
|
||||||
{
|
{
|
||||||
'action': 'null',
|
'action': 'null',
|
||||||
@ -144,7 +153,7 @@ class KalturaIE(InfoExtractor):
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
return self._kaltura_api_call(
|
return self._kaltura_api_call(
|
||||||
video_id, actions, note='Downloading video info JSON')
|
video_id, actions, service_url, note='Downloading video info JSON')
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
url, smuggled_data = unsmuggle_url(url, {})
|
url, smuggled_data = unsmuggle_url(url, {})
|
||||||
@ -153,7 +162,7 @@ class KalturaIE(InfoExtractor):
|
|||||||
partner_id, entry_id = mobj.group('partner_id', 'id')
|
partner_id, entry_id = mobj.group('partner_id', 'id')
|
||||||
ks = None
|
ks = None
|
||||||
if partner_id and entry_id:
|
if partner_id and entry_id:
|
||||||
info, flavor_assets = self._get_video_info(entry_id, partner_id)
|
info, flavor_assets = self._get_video_info(entry_id, partner_id, smuggled_data.get('service_url'))
|
||||||
else:
|
else:
|
||||||
path, query = mobj.group('path', 'query')
|
path, query = mobj.group('path', 'query')
|
||||||
if not path and not query:
|
if not path and not query:
|
||||||
@ -201,12 +210,17 @@ class KalturaIE(InfoExtractor):
|
|||||||
unsigned_url += '?referrer=%s' % referrer
|
unsigned_url += '?referrer=%s' % referrer
|
||||||
return unsigned_url
|
return unsigned_url
|
||||||
|
|
||||||
|
data_url = info['dataUrl']
|
||||||
|
if '/flvclipper/' in data_url:
|
||||||
|
data_url = re.sub(r'/flvclipper/.*', '/serveFlavor', data_url)
|
||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
for f in flavor_assets:
|
for f in flavor_assets:
|
||||||
# Continue if asset is not ready
|
# Continue if asset is not ready
|
||||||
if f['status'] != 2:
|
if f['status'] != 2:
|
||||||
continue
|
continue
|
||||||
video_url = sign_url('%s/flavorId/%s' % (info['dataUrl'], f['id']))
|
video_url = sign_url(
|
||||||
|
'%s/flavorId/%s' % (data_url, f['id']))
|
||||||
formats.append({
|
formats.append({
|
||||||
'format_id': '%(fileExt)s-%(bitrate)s' % f,
|
'format_id': '%(fileExt)s-%(bitrate)s' % f,
|
||||||
'ext': f.get('fileExt'),
|
'ext': f.get('fileExt'),
|
||||||
@ -219,9 +233,12 @@ class KalturaIE(InfoExtractor):
|
|||||||
'width': int_or_none(f.get('width')),
|
'width': int_or_none(f.get('width')),
|
||||||
'url': video_url,
|
'url': video_url,
|
||||||
})
|
})
|
||||||
m3u8_url = sign_url(info['dataUrl'].replace('format/url', 'format/applehttp'))
|
if '/playManifest/' in data_url:
|
||||||
formats.extend(self._extract_m3u8_formats(
|
m3u8_url = sign_url(data_url.replace(
|
||||||
m3u8_url, entry_id, 'mp4', 'm3u8_native', m3u8_id='hls', fatal=False))
|
'format/url', 'format/applehttp'))
|
||||||
|
formats.extend(self._extract_m3u8_formats(
|
||||||
|
m3u8_url, entry_id, 'mp4', 'm3u8_native',
|
||||||
|
m3u8_id='hls', fatal=False))
|
||||||
|
|
||||||
self._check_formats(formats, entry_id)
|
self._check_formats(formats, entry_id)
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
@ -3,8 +3,8 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
determine_ext,
|
|
||||||
js_to_json,
|
js_to_json,
|
||||||
|
smuggle_url,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -18,13 +18,16 @@ class LA7IE(InfoExtractor):
|
|||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
# 'src' is a plain URL
|
# 'src' is a plain URL
|
||||||
'url': 'http://www.la7.it/crozza/video/inccool8-02-10-2015-163722',
|
'url': 'http://www.la7.it/crozza/video/inccool8-02-10-2015-163722',
|
||||||
'md5': '6054674766e7988d3e02f2148ff92180',
|
'md5': '8b613ffc0c4bf9b9e377169fc19c214c',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'inccool8-02-10-2015-163722',
|
'id': 'inccool8-02-10-2015-163722',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Inc.Cool8',
|
'title': 'Inc.Cool8',
|
||||||
'description': 'Benvenuti nell\'incredibile mondo della INC. COOL. 8. dove “INC.” sta per “Incorporated” “COOL” sta per “fashion” ed Eight sta per il gesto atletico',
|
'description': 'Benvenuti nell\'incredibile mondo della INC. COOL. 8. dove “INC.” sta per “Incorporated” “COOL” sta per “fashion” ed Eight sta per il gesto atletico',
|
||||||
'thumbnail': 're:^https?://.*',
|
'thumbnail': 're:^https?://.*',
|
||||||
|
'uploader_id': 'kdla7pillole@iltrovatore.it',
|
||||||
|
'timestamp': 1443814869,
|
||||||
|
'upload_date': '20151002',
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
# 'src' is a dictionary
|
# 'src' is a dictionary
|
||||||
@ -49,26 +52,14 @@ class LA7IE(InfoExtractor):
|
|||||||
self._search_regex(r'videoLa7\(({[^;]+})\);', webpage, 'player data'),
|
self._search_regex(r'videoLa7\(({[^;]+})\);', webpage, 'player data'),
|
||||||
video_id, transform_source=js_to_json)
|
video_id, transform_source=js_to_json)
|
||||||
|
|
||||||
source = player_data['src']
|
|
||||||
source_urls = source.values() if isinstance(source, dict) else [source]
|
|
||||||
|
|
||||||
formats = []
|
|
||||||
for source_url in source_urls:
|
|
||||||
ext = determine_ext(source_url)
|
|
||||||
if ext == 'm3u8':
|
|
||||||
formats.extend(self._extract_m3u8_formats(
|
|
||||||
source_url, video_id, ext='mp4',
|
|
||||||
entry_protocol='m3u8_native', m3u8_id='hls'))
|
|
||||||
else:
|
|
||||||
formats.append({
|
|
||||||
'url': source_url,
|
|
||||||
})
|
|
||||||
self._sort_formats(formats)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
'_type': 'url_transparent',
|
||||||
|
'url': smuggle_url('kaltura:103:%s' % player_data['vid'], {
|
||||||
|
'service_url': 'http://kdam.iltrovatore.it',
|
||||||
|
}),
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': player_data['title'],
|
'title': player_data['title'],
|
||||||
'description': self._og_search_description(webpage, default=None),
|
'description': self._og_search_description(webpage, default=None),
|
||||||
'thumbnail': player_data.get('poster'),
|
'thumbnail': player_data.get('poster'),
|
||||||
'formats': formats,
|
'ie_key': 'Kaltura',
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ class RTVNHIE(InfoExtractor):
|
|||||||
_VALID_URL = r'https?://(?:www\.)?rtvnh\.nl/video/(?P<id>[0-9]+)'
|
_VALID_URL = r'https?://(?:www\.)?rtvnh\.nl/video/(?P<id>[0-9]+)'
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'http://www.rtvnh.nl/video/131946',
|
'url': 'http://www.rtvnh.nl/video/131946',
|
||||||
'md5': '6e1d0ab079e2a00b6161442d3ceacfc1',
|
'md5': 'cdbec9f44550763c8afc96050fa747dc',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '131946',
|
'id': '131946',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
@ -29,15 +29,29 @@ class RTVNHIE(InfoExtractor):
|
|||||||
raise ExtractorError(
|
raise ExtractorError(
|
||||||
'%s returned error code %d' % (self.IE_NAME, status), expected=True)
|
'%s returned error code %d' % (self.IE_NAME, status), expected=True)
|
||||||
|
|
||||||
formats = self._extract_smil_formats(
|
formats = []
|
||||||
'http://www.rtvnh.nl/video/smil?m=' + video_id, video_id, fatal=False)
|
rtmp_formats = self._extract_smil_formats(
|
||||||
|
'http://www.rtvnh.nl/video/smil?m=' + video_id, video_id)
|
||||||
|
formats.extend(rtmp_formats)
|
||||||
|
|
||||||
for item in meta['source']['fb']:
|
for rtmp_format in rtmp_formats:
|
||||||
if item.get('type') == 'hls':
|
rtmp_url = '%s/%s' % (rtmp_format['url'], rtmp_format['play_path'])
|
||||||
formats.extend(self._extract_m3u8_formats(
|
rtsp_format = rtmp_format.copy()
|
||||||
item['file'], video_id, ext='mp4', entry_protocol='m3u8_native'))
|
del rtsp_format['play_path']
|
||||||
elif item.get('type') == '':
|
del rtsp_format['ext']
|
||||||
formats.append({'url': item['file']})
|
rtsp_format.update({
|
||||||
|
'format_id': rtmp_format['format_id'].replace('rtmp', 'rtsp'),
|
||||||
|
'url': rtmp_url.replace('rtmp://', 'rtsp://'),
|
||||||
|
'protocol': 'rtsp',
|
||||||
|
})
|
||||||
|
formats.append(rtsp_format)
|
||||||
|
http_base_url = rtmp_url.replace('rtmp://', 'http://')
|
||||||
|
formats.extend(self._extract_m3u8_formats(
|
||||||
|
http_base_url + '/playlist.m3u8', video_id, 'mp4',
|
||||||
|
'm3u8_native', m3u8_id='hls', fatal=False))
|
||||||
|
formats.extend(self._extract_f4m_formats(
|
||||||
|
http_base_url + '/manifest.f4m',
|
||||||
|
video_id, f4m_id='hds', fatal=False))
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -1,18 +1,12 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import itertools
|
|
||||||
import json
|
import json
|
||||||
import re
|
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..compat import compat_urlparse
|
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
int_or_none,
|
int_or_none,
|
||||||
js_to_json,
|
|
||||||
mimetype2ext,
|
mimetype2ext,
|
||||||
sanitized_Request,
|
|
||||||
unified_strdate,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -27,7 +21,8 @@ class SandiaIE(InfoExtractor):
|
|||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Xyce Software Training - Section 1',
|
'title': 'Xyce Software Training - Section 1',
|
||||||
'description': 're:(?s)SAND Number: SAND 2013-7800.{200,}',
|
'description': 're:(?s)SAND Number: SAND 2013-7800.{200,}',
|
||||||
'upload_date': '20120904',
|
'upload_date': '20120409',
|
||||||
|
'timestamp': 1333983600,
|
||||||
'duration': 7794,
|
'duration': 7794,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -35,81 +30,36 @@ class SandiaIE(InfoExtractor):
|
|||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
req = sanitized_Request(url)
|
presentation_data = self._download_json(
|
||||||
req.add_header('Cookie', 'MediasitePlayerCaps=ClientPlugins=4')
|
'http://digitalops.sandia.gov/Mediasite/PlayerService/PlayerService.svc/json/GetPlayerOptions',
|
||||||
webpage = self._download_webpage(req, video_id)
|
video_id, data=json.dumps({
|
||||||
|
'getPlayerOptionsRequest': {
|
||||||
|
'ResourceId': video_id,
|
||||||
|
'QueryString': '',
|
||||||
|
}
|
||||||
|
}), headers={
|
||||||
|
'Content-Type': 'application/json; charset=utf-8',
|
||||||
|
})['d']['Presentation']
|
||||||
|
|
||||||
js_path = self._search_regex(
|
title = presentation_data['Title']
|
||||||
r'<script type="text/javascript" src="(/Mediasite/FileServer/Presentation/[^"]+)"',
|
|
||||||
webpage, 'JS code URL')
|
|
||||||
js_url = compat_urlparse.urljoin(url, js_path)
|
|
||||||
|
|
||||||
js_code = self._download_webpage(
|
|
||||||
js_url, video_id, note='Downloading player')
|
|
||||||
|
|
||||||
def extract_str(key, **args):
|
|
||||||
return self._search_regex(
|
|
||||||
r'Mediasite\.PlaybackManifest\.%s\s*=\s*(.+);\s*?\n' % re.escape(key),
|
|
||||||
js_code, key, **args)
|
|
||||||
|
|
||||||
def extract_data(key, **args):
|
|
||||||
data_json = extract_str(key, **args)
|
|
||||||
if data_json is None:
|
|
||||||
return data_json
|
|
||||||
return self._parse_json(
|
|
||||||
data_json, video_id, transform_source=js_to_json)
|
|
||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
for i in itertools.count():
|
for stream in presentation_data.get('Streams', []):
|
||||||
fd = extract_data('VideoUrls[%d]' % i, default=None)
|
for fd in stream.get('VideoUrls', []):
|
||||||
if fd is None:
|
formats.append({
|
||||||
break
|
'format_id': fd['MediaType'],
|
||||||
formats.append({
|
'format_note': fd['MimeType'].partition('/')[2],
|
||||||
'format_id': '%s' % i,
|
'ext': mimetype2ext(fd['MimeType']),
|
||||||
'format_note': fd['MimeType'].partition('/')[2],
|
'url': fd['Location'],
|
||||||
'ext': mimetype2ext(fd['MimeType']),
|
'protocol': 'f4m' if fd['MimeType'] == 'video/x-mp4-fragmented' else None,
|
||||||
'url': fd['Location'],
|
})
|
||||||
'protocol': 'f4m' if fd['MimeType'] == 'video/x-mp4-fragmented' else None,
|
|
||||||
})
|
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
slide_baseurl = compat_urlparse.urljoin(
|
|
||||||
url, extract_data('SlideBaseUrl'))
|
|
||||||
slide_template = slide_baseurl + re.sub(
|
|
||||||
r'\{0:D?([0-9+])\}', r'%0\1d', extract_data('SlideImageFileNameTemplate'))
|
|
||||||
slides = []
|
|
||||||
last_slide_time = 0
|
|
||||||
for i in itertools.count(1):
|
|
||||||
sd = extract_str('Slides[%d]' % i, default=None)
|
|
||||||
if sd is None:
|
|
||||||
break
|
|
||||||
timestamp = int_or_none(self._search_regex(
|
|
||||||
r'^Mediasite\.PlaybackManifest\.CreateSlide\("[^"]*"\s*,\s*([0-9]+),',
|
|
||||||
sd, 'slide %s timestamp' % i, fatal=False))
|
|
||||||
slides.append({
|
|
||||||
'url': slide_template % i,
|
|
||||||
'duration': timestamp - last_slide_time,
|
|
||||||
})
|
|
||||||
last_slide_time = timestamp
|
|
||||||
formats.append({
|
|
||||||
'format_id': 'slides',
|
|
||||||
'protocol': 'slideshow',
|
|
||||||
'url': json.dumps(slides),
|
|
||||||
'preference': -10000, # Downloader not yet written
|
|
||||||
})
|
|
||||||
self._sort_formats(formats)
|
|
||||||
|
|
||||||
title = extract_data('Title')
|
|
||||||
description = extract_data('Description', fatal=False)
|
|
||||||
duration = int_or_none(extract_data(
|
|
||||||
'Duration', fatal=False), scale=1000)
|
|
||||||
upload_date = unified_strdate(extract_data('AirDate', fatal=False))
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': title,
|
'title': title,
|
||||||
'description': description,
|
'description': presentation_data.get('Description'),
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'upload_date': upload_date,
|
'timestamp': int_or_none(presentation_data.get('UnixTime'), 1000),
|
||||||
'duration': duration,
|
'duration': int_or_none(presentation_data.get('Duration'), 1000),
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ from ..compat import (
|
|||||||
)
|
)
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
|
get_element_by_id,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -40,7 +41,7 @@ class SlideshareIE(InfoExtractor):
|
|||||||
bucket = info['jsplayer']['video_bucket']
|
bucket = info['jsplayer']['video_bucket']
|
||||||
ext = info['jsplayer']['video_extension']
|
ext = info['jsplayer']['video_extension']
|
||||||
video_url = compat_urlparse.urljoin(bucket, doc + '-SD.' + ext)
|
video_url = compat_urlparse.urljoin(bucket, doc + '-SD.' + ext)
|
||||||
description = self._html_search_regex(
|
description = get_element_by_id('slideshow-description-paragraph', webpage) or self._html_search_regex(
|
||||||
r'(?s)<p[^>]+itemprop="description"[^>]*>(.+?)</p>', webpage,
|
r'(?s)<p[^>]+itemprop="description"[^>]*>(.+?)</p>', webpage,
|
||||||
'description', fatal=False)
|
'description', fatal=False)
|
||||||
|
|
||||||
@ -51,5 +52,5 @@ class SlideshareIE(InfoExtractor):
|
|||||||
'ext': ext,
|
'ext': ext,
|
||||||
'url': video_url,
|
'url': video_url,
|
||||||
'thumbnail': info['slideshow']['pin_image_url'],
|
'thumbnail': info['slideshow']['pin_image_url'],
|
||||||
'description': description,
|
'description': description.strip() if description else None,
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,13 @@ from __future__ import unicode_literals
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..compat import compat_urlparse
|
|
||||||
from .spiegeltv import SpiegeltvIE
|
from .spiegeltv import SpiegeltvIE
|
||||||
|
from ..compat import compat_urlparse
|
||||||
|
from ..utils import (
|
||||||
|
extract_attributes,
|
||||||
|
unified_strdate,
|
||||||
|
get_element_by_attribute,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class SpiegelIE(InfoExtractor):
|
class SpiegelIE(InfoExtractor):
|
||||||
@ -19,6 +24,7 @@ class SpiegelIE(InfoExtractor):
|
|||||||
'title': 'Vulkanausbruch in Ecuador: Der "Feuerschlund" ist wieder aktiv',
|
'title': 'Vulkanausbruch in Ecuador: Der "Feuerschlund" ist wieder aktiv',
|
||||||
'description': 'md5:8029d8310232196eb235d27575a8b9f4',
|
'description': 'md5:8029d8310232196eb235d27575a8b9f4',
|
||||||
'duration': 49,
|
'duration': 49,
|
||||||
|
'upload_date': '20130311',
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
'url': 'http://www.spiegel.de/video/schach-wm-videoanalyse-des-fuenften-spiels-video-1309159.html',
|
'url': 'http://www.spiegel.de/video/schach-wm-videoanalyse-des-fuenften-spiels-video-1309159.html',
|
||||||
@ -29,6 +35,7 @@ class SpiegelIE(InfoExtractor):
|
|||||||
'title': 'Schach-WM in der Videoanalyse: Carlsen nutzt die Fehlgriffe des Titelverteidigers',
|
'title': 'Schach-WM in der Videoanalyse: Carlsen nutzt die Fehlgriffe des Titelverteidigers',
|
||||||
'description': 'md5:c2322b65e58f385a820c10fa03b2d088',
|
'description': 'md5:c2322b65e58f385a820c10fa03b2d088',
|
||||||
'duration': 983,
|
'duration': 983,
|
||||||
|
'upload_date': '20131115',
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
'url': 'http://www.spiegel.de/video/astronaut-alexander-gerst-von-der-iss-station-beantwortet-fragen-video-1519126-embed.html',
|
'url': 'http://www.spiegel.de/video/astronaut-alexander-gerst-von-der-iss-station-beantwortet-fragen-video-1519126-embed.html',
|
||||||
@ -38,6 +45,7 @@ class SpiegelIE(InfoExtractor):
|
|||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'description': 'SPIEGEL ONLINE-Nutzer durften den deutschen Astronauten Alexander Gerst über sein Leben auf der ISS-Station befragen. Hier kommen seine Antworten auf die besten sechs Fragen.',
|
'description': 'SPIEGEL ONLINE-Nutzer durften den deutschen Astronauten Alexander Gerst über sein Leben auf der ISS-Station befragen. Hier kommen seine Antworten auf die besten sechs Fragen.',
|
||||||
'title': 'Fragen an Astronaut Alexander Gerst: "Bekommen Sie die Tageszeiten mit?"',
|
'title': 'Fragen an Astronaut Alexander Gerst: "Bekommen Sie die Tageszeiten mit?"',
|
||||||
|
'upload_date': '20140904',
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
'url': 'http://www.spiegel.de/video/astronaut-alexander-gerst-von-der-iss-station-beantwortet-fragen-video-1519126-iframe.html',
|
'url': 'http://www.spiegel.de/video/astronaut-alexander-gerst-von-der-iss-station-beantwortet-fragen-video-1519126-iframe.html',
|
||||||
@ -52,10 +60,10 @@ class SpiegelIE(InfoExtractor):
|
|||||||
if SpiegeltvIE.suitable(handle.geturl()):
|
if SpiegeltvIE.suitable(handle.geturl()):
|
||||||
return self.url_result(handle.geturl(), 'Spiegeltv')
|
return self.url_result(handle.geturl(), 'Spiegeltv')
|
||||||
|
|
||||||
title = re.sub(r'\s+', ' ', self._html_search_regex(
|
video_data = extract_attributes(self._search_regex(r'(<div[^>]+id="spVideoElements"[^>]+>)', webpage, 'video element', default=''))
|
||||||
r'(?s)<(?:h1|div) class="module-title"[^>]*>(.*?)</(?:h1|div)>',
|
|
||||||
webpage, 'title'))
|
title = video_data.get('data-video-title') or get_element_by_attribute('class', 'module-title', webpage)
|
||||||
description = self._html_search_meta('description', webpage, 'description')
|
description = video_data.get('data-video-teaser') or self._html_search_meta('description', webpage, 'description')
|
||||||
|
|
||||||
base_url = self._search_regex(
|
base_url = self._search_regex(
|
||||||
[r'server\s*:\s*(["\'])(?P<url>.+?)\1', r'var\s+server\s*=\s*"(?P<url>[^"]+)\"'],
|
[r'server\s*:\s*(["\'])(?P<url>.+?)\1', r'var\s+server\s*=\s*"(?P<url>[^"]+)\"'],
|
||||||
@ -87,8 +95,9 @@ class SpiegelIE(InfoExtractor):
|
|||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': title,
|
'title': title,
|
||||||
'description': description,
|
'description': description.strip() if description else None,
|
||||||
'duration': duration,
|
'duration': duration,
|
||||||
|
'upload_date': unified_strdate(video_data.get('data-video-date')),
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ class StitcherIE(InfoExtractor):
|
|||||||
|
|
||||||
episode = self._parse_json(
|
episode = self._parse_json(
|
||||||
js_to_json(self._search_regex(
|
js_to_json(self._search_regex(
|
||||||
r'(?s)var\s+stitcher\s*=\s*({.+?});\n', webpage, 'episode config')),
|
r'(?s)var\s+stitcher(?:Config)?\s*=\s*({.+?});\n', webpage, 'episode config')),
|
||||||
display_id)['config']['episode']
|
display_id)['config']['episode']
|
||||||
|
|
||||||
title = unescapeHTML(episode['title'])
|
title = unescapeHTML(episode['title'])
|
||||||
|
@ -67,6 +67,20 @@ class XuiteIE(InfoExtractor):
|
|||||||
'categories': ['電玩動漫'],
|
'categories': ['電玩動漫'],
|
||||||
},
|
},
|
||||||
'skip': 'Video removed',
|
'skip': 'Video removed',
|
||||||
|
}, {
|
||||||
|
# Video with encoded media id
|
||||||
|
# from http://forgetfulbc.blogspot.com/2016/06/date.html
|
||||||
|
'url': 'http://vlog.xuite.net/embed/cE1xbENoLTI3NDQ3MzM2LmZsdg==?ar=0&as=0',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'cE1xbENoLTI3NDQ3MzM2LmZsdg==',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': '男女平權只是口號?專家解釋約會時男生是否該幫女生付錢 (中字)',
|
||||||
|
'description': 'md5:f0abdcb69df300f522a5442ef3146f2a',
|
||||||
|
'timestamp': 1466160960,
|
||||||
|
'upload_date': '20160617',
|
||||||
|
'uploader': 'B.C. & Lowy',
|
||||||
|
'uploader_id': '232279340',
|
||||||
|
},
|
||||||
}, {
|
}, {
|
||||||
'url': 'http://vlog.xuite.net/play/S1dDUjdyLTMyOTc3NjcuZmx2/%E5%AD%AB%E7%87%95%E5%A7%BF-%E7%9C%BC%E6%B7%9A%E6%88%90%E8%A9%A9',
|
'url': 'http://vlog.xuite.net/play/S1dDUjdyLTMyOTc3NjcuZmx2/%E5%AD%AB%E7%87%95%E5%A7%BF-%E7%9C%BC%E6%B7%9A%E6%88%90%E8%A9%A9',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
@ -80,10 +94,9 @@ class XuiteIE(InfoExtractor):
|
|||||||
def base64_encode_utf8(data):
|
def base64_encode_utf8(data):
|
||||||
return base64.b64encode(data.encode('utf-8')).decode('utf-8')
|
return base64.b64encode(data.encode('utf-8')).decode('utf-8')
|
||||||
|
|
||||||
def _extract_flv_config(self, media_id):
|
def _extract_flv_config(self, encoded_media_id):
|
||||||
base64_media_id = self.base64_encode_utf8(media_id)
|
|
||||||
flv_config = self._download_xml(
|
flv_config = self._download_xml(
|
||||||
'http://vlog.xuite.net/flash/player?media=%s' % base64_media_id,
|
'http://vlog.xuite.net/flash/player?media=%s' % encoded_media_id,
|
||||||
'flv config')
|
'flv config')
|
||||||
prop_dict = {}
|
prop_dict = {}
|
||||||
for prop in flv_config.findall('./property'):
|
for prop in flv_config.findall('./property'):
|
||||||
@ -108,9 +121,14 @@ class XuiteIE(InfoExtractor):
|
|||||||
'%s returned error: %s' % (self.IE_NAME, error_msg),
|
'%s returned error: %s' % (self.IE_NAME, error_msg),
|
||||||
expected=True)
|
expected=True)
|
||||||
|
|
||||||
video_id = self._html_search_regex(
|
encoded_media_id = self._search_regex(
|
||||||
r'data-mediaid="(\d+)"', webpage, 'media id')
|
r'attributes\.name\s*=\s*"([^"]+)"', webpage,
|
||||||
flv_config = self._extract_flv_config(video_id)
|
'encoded media id', default=None)
|
||||||
|
if encoded_media_id is None:
|
||||||
|
video_id = self._html_search_regex(
|
||||||
|
r'data-mediaid="(\d+)"', webpage, 'media id')
|
||||||
|
encoded_media_id = self.base64_encode_utf8(video_id)
|
||||||
|
flv_config = self._extract_flv_config(encoded_media_id)
|
||||||
|
|
||||||
FORMATS = {
|
FORMATS = {
|
||||||
'audio': 'mp3',
|
'audio': 'mp3',
|
||||||
|
@ -1730,6 +1730,39 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class YoutubeSharedVideoIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'(?:https?:)?//(?:www\.)?youtube\.com/shared\?ci=(?P<id>[0-9A-Za-z_-]{11})'
|
||||||
|
IE_NAME = 'youtube:shared'
|
||||||
|
|
||||||
|
_TEST = {
|
||||||
|
'url': 'https://www.youtube.com/shared?ci=1nEzmT-M4fU',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'uPDB5I9wfp8',
|
||||||
|
'ext': 'webm',
|
||||||
|
'title': 'Pocoyo: 90 minutos de episódios completos Português para crianças - PARTE 3',
|
||||||
|
'description': 'md5:d9e4d9346a2dfff4c7dc4c8cec0f546d',
|
||||||
|
'upload_date': '20160219',
|
||||||
|
'uploader': 'Pocoyo - Português (BR)',
|
||||||
|
'uploader_id': 'PocoyoBrazil',
|
||||||
|
},
|
||||||
|
'add_ie': ['Youtube'],
|
||||||
|
'params': {
|
||||||
|
# There are already too many Youtube downloads
|
||||||
|
'skip_download': True,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
|
real_video_id = self._html_search_meta(
|
||||||
|
'videoId', webpage, 'YouTube video id', fatal=True)
|
||||||
|
|
||||||
|
return self.url_result(real_video_id, YoutubeIE.ie_key())
|
||||||
|
|
||||||
|
|
||||||
class YoutubePlaylistIE(YoutubePlaylistBaseInfoExtractor):
|
class YoutubePlaylistIE(YoutubePlaylistBaseInfoExtractor):
|
||||||
IE_DESC = 'YouTube.com playlists'
|
IE_DESC = 'YouTube.com playlists'
|
||||||
_VALID_URL = r"""(?x)(?:
|
_VALID_URL = r"""(?x)(?:
|
||||||
|
@ -1448,6 +1448,8 @@ def shell_quote(args):
|
|||||||
def smuggle_url(url, data):
|
def smuggle_url(url, data):
|
||||||
""" Pass additional data in a URL for internal use. """
|
""" Pass additional data in a URL for internal use. """
|
||||||
|
|
||||||
|
url, idata = unsmuggle_url(url, {})
|
||||||
|
data.update(idata)
|
||||||
sdata = compat_urllib_parse_urlencode(
|
sdata = compat_urllib_parse_urlencode(
|
||||||
{'__youtubedl_smuggle': json.dumps(data)})
|
{'__youtubedl_smuggle': json.dumps(data)})
|
||||||
return url + '#' + sdata
|
return url + '#' + sdata
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
__version__ = '2016.07.03.1'
|
__version__ = '2016.07.05'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user