mirror of
https://github.com/l1ving/youtube-dl
synced 2025-02-05 05:05:36 +08:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
d3cd30abaf
@ -633,7 +633,7 @@ def _real_main(argv=None):
|
|||||||
if desc is False:
|
if desc is False:
|
||||||
continue
|
continue
|
||||||
if hasattr(ie, 'SEARCH_KEY'):
|
if hasattr(ie, 'SEARCH_KEY'):
|
||||||
_SEARCHES = (u'cute kittens', u'slithering pythons', u'falling cat', u'angry poodle', u'purple fish', u'running tortoise')
|
_SEARCHES = (u'cute kittens', u'slithering pythons', u'falling cat', u'angry poodle', u'purple fish', u'running tortoise', u'sleeping bunny')
|
||||||
_COUNTS = (u'', u'5', u'10', u'all')
|
_COUNTS = (u'', u'5', u'10', u'all')
|
||||||
desc += u' (Example: "%s%s:%s" )' % (ie.SEARCH_KEY, random.choice(_COUNTS), random.choice(_SEARCHES))
|
desc += u' (Example: "%s%s:%s" )' % (ie.SEARCH_KEY, random.choice(_COUNTS), random.choice(_SEARCHES))
|
||||||
compat_print(desc)
|
compat_print(desc)
|
||||||
|
@ -12,7 +12,7 @@ from ..utils import (
|
|||||||
|
|
||||||
class BRIE(InfoExtractor):
|
class BRIE(InfoExtractor):
|
||||||
IE_DESC = 'Bayerischer Rundfunk Mediathek'
|
IE_DESC = 'Bayerischer Rundfunk Mediathek'
|
||||||
_VALID_URL = r'https?://(?:www\.)?br\.de/(?:[a-z0-9\-]+/)+(?P<id>[a-z0-9\-]+)\.html'
|
_VALID_URL = r'https?://(?:www\.)?br\.de/(?:[a-z0-9\-_]+/)+(?P<id>[a-z0-9\-_]+)\.html'
|
||||||
_BASE_URL = 'http://www.br.de'
|
_BASE_URL = 'http://www.br.de'
|
||||||
|
|
||||||
_TESTS = [
|
_TESTS = [
|
||||||
|
@ -1,24 +1,42 @@
|
|||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
|
||||||
|
|
||||||
class CBSIE(InfoExtractor):
|
class CBSIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?cbs\.com/shows/[^/]+/video/(?P<id>[^/]+)/.*'
|
_VALID_URL = r'https?://(?:www\.)?cbs\.com/shows/[^/]+/(?:video|artist)/(?P<id>[^/]+)/.*'
|
||||||
|
|
||||||
_TEST = {
|
_TESTS = [{
|
||||||
u'url': u'http://www.cbs.com/shows/garth-brooks/video/_u7W953k6la293J7EPTd9oHkSPs6Xn6_/connect-chat-feat-garth-brooks/',
|
'url': 'http://www.cbs.com/shows/garth-brooks/video/_u7W953k6la293J7EPTd9oHkSPs6Xn6_/connect-chat-feat-garth-brooks/',
|
||||||
u'file': u'4JUVEwq3wUT7.flv',
|
'info_dict': {
|
||||||
u'info_dict': {
|
'id': '4JUVEwq3wUT7',
|
||||||
u'title': u'Connect Chat feat. Garth Brooks',
|
'ext': 'flv',
|
||||||
u'description': u'Connect with country music singer Garth Brooks, as he chats with fans on Wednesday November 27, 2013. Be sure to tune in to Garth Brooks: Live from Las Vegas, Friday November 29, at 9/8c on CBS!',
|
'title': 'Connect Chat feat. Garth Brooks',
|
||||||
u'duration': 1495,
|
'description': 'Connect with country music singer Garth Brooks, as he chats with fans on Wednesday November 27, 2013. Be sure to tune in to Garth Brooks: Live from Las Vegas, Friday November 29, at 9/8c on CBS!',
|
||||||
|
'duration': 1495,
|
||||||
},
|
},
|
||||||
u'params': {
|
'params': {
|
||||||
# rtmp download
|
# rtmp download
|
||||||
u'skip_download': True,
|
'skip_download': True,
|
||||||
},
|
},
|
||||||
}
|
'_skip': 'Blocked outside the US',
|
||||||
|
}, {
|
||||||
|
'url': 'http://www.cbs.com/shows/liveonletterman/artist/221752/st-vincent/',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'P9gjWjelt6iP',
|
||||||
|
'ext': 'flv',
|
||||||
|
'title': 'Live on Letterman - St. Vincent',
|
||||||
|
'description': 'Live On Letterman: St. Vincent in concert from New York\'s Ed Sullivan Theater on Tuesday, July 16, 2014.',
|
||||||
|
'duration': 3221,
|
||||||
|
},
|
||||||
|
'params': {
|
||||||
|
# rtmp download
|
||||||
|
'skip_download': True,
|
||||||
|
},
|
||||||
|
'_skip': 'Blocked outside the US',
|
||||||
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
mobj = re.match(self._VALID_URL, url)
|
||||||
@ -26,5 +44,5 @@ class CBSIE(InfoExtractor):
|
|||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
real_id = self._search_regex(
|
real_id = self._search_regex(
|
||||||
r"video\.settings\.pid\s*=\s*'([^']+)';",
|
r"video\.settings\.pid\s*=\s*'([^']+)';",
|
||||||
webpage, u'real video ID')
|
webpage, 'real video ID')
|
||||||
return self.url_result(u'theplatform:%s' % real_id)
|
return self.url_result(u'theplatform:%s' % real_id)
|
||||||
|
@ -8,7 +8,7 @@ from .common import InfoExtractor
|
|||||||
|
|
||||||
class KickStarterIE(InfoExtractor):
|
class KickStarterIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://www\.kickstarter\.com/projects/(?P<id>[^/]*)/.*'
|
_VALID_URL = r'https?://www\.kickstarter\.com/projects/(?P<id>[^/]*)/.*'
|
||||||
_TEST = {
|
_TESTS = [{
|
||||||
'url': 'https://www.kickstarter.com/projects/1404461844/intersection-the-story-of-josh-grant?ref=home_location',
|
'url': 'https://www.kickstarter.com/projects/1404461844/intersection-the-story-of-josh-grant?ref=home_location',
|
||||||
'md5': 'c81addca81327ffa66c642b5d8b08cab',
|
'md5': 'c81addca81327ffa66c642b5d8b08cab',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
@ -18,22 +18,45 @@ class KickStarterIE(InfoExtractor):
|
|||||||
'description': 'A unique motocross documentary that examines the '
|
'description': 'A unique motocross documentary that examines the '
|
||||||
'life and mind of one of sports most elite athletes: Josh Grant.',
|
'life and mind of one of sports most elite athletes: Josh Grant.',
|
||||||
},
|
},
|
||||||
}
|
}, {
|
||||||
|
'note': 'Embedded video (not using the native kickstarter video service)',
|
||||||
|
'url': 'https://www.kickstarter.com/projects/597507018/pebble-e-paper-watch-for-iphone-and-android/posts/659178',
|
||||||
|
'playlist': [
|
||||||
|
{
|
||||||
|
'info_dict': {
|
||||||
|
'id': '78704821',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'uploader_id': 'pebble',
|
||||||
|
'uploader': 'Pebble Technology',
|
||||||
|
'title': 'Pebble iOS Notifications',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
m = re.match(self._VALID_URL, url)
|
m = re.match(self._VALID_URL, url)
|
||||||
video_id = m.group('id')
|
video_id = m.group('id')
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
video_url = self._search_regex(r'data-video-url="(.*?)"',
|
title = self._html_search_regex(
|
||||||
webpage, 'video URL')
|
r'<title>\s*(.*?)(?:\s*— Kickstarter)?\s*</title>',
|
||||||
video_title = self._html_search_regex(r'<title>(.*?)</title>',
|
webpage, 'title')
|
||||||
webpage, 'title').rpartition('— Kickstarter')[0].strip()
|
video_url = self._search_regex(
|
||||||
|
r'data-video-url="(.*?)"',
|
||||||
|
webpage, 'video URL', default=None)
|
||||||
|
if video_url is None: # No native kickstarter, look for embedded videos
|
||||||
|
return {
|
||||||
|
'_type': 'url_transparent',
|
||||||
|
'ie_key': 'Generic',
|
||||||
|
'url': url,
|
||||||
|
'title': title,
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'url': video_url,
|
'url': video_url,
|
||||||
'title': video_title,
|
'title': title,
|
||||||
'description': self._og_search_description(webpage),
|
'description': self._og_search_description(webpage),
|
||||||
'thumbnail': self._og_search_thumbnail(webpage),
|
'thumbnail': self._og_search_thumbnail(webpage),
|
||||||
}
|
}
|
||||||
|
@ -85,11 +85,25 @@ class NBCNewsIE(InfoExtractor):
|
|||||||
flags=re.MULTILINE)
|
flags=re.MULTILINE)
|
||||||
bootstrap = json.loads(bootstrap_json)
|
bootstrap = json.loads(bootstrap_json)
|
||||||
info = bootstrap['results'][0]['video']
|
info = bootstrap['results'][0]['video']
|
||||||
playlist_url = info['fallbackPlaylistUrl'] + '?form=MPXNBCNewsAPI'
|
|
||||||
mpxid = info['mpxId']
|
mpxid = info['mpxId']
|
||||||
all_videos = self._download_json(playlist_url, title)['videos']
|
|
||||||
# The response contains additional videos
|
base_urls = [
|
||||||
info = next(v for v in all_videos if v['mpxId'] == mpxid)
|
info['fallbackPlaylistUrl'],
|
||||||
|
info['associatedPlaylistUrl'],
|
||||||
|
]
|
||||||
|
|
||||||
|
for base_url in base_urls:
|
||||||
|
playlist_url = base_url + '?form=MPXNBCNewsAPI'
|
||||||
|
all_videos = self._download_json(playlist_url, title)['videos']
|
||||||
|
|
||||||
|
try:
|
||||||
|
info = next(v for v in all_videos if v['mpxId'] == mpxid)
|
||||||
|
break
|
||||||
|
except StopIteration:
|
||||||
|
continue
|
||||||
|
|
||||||
|
if info is None:
|
||||||
|
raise ExtractorError('Could not find video in playlists')
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'_type': 'url',
|
'_type': 'url',
|
||||||
|
@ -10,7 +10,7 @@ from ..utils import (
|
|||||||
|
|
||||||
|
|
||||||
class VodlockerIE(InfoExtractor):
|
class VodlockerIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?vodlocker.com/(?P<id>[0-9a-zA-Z]+)(?:\..*?)?'
|
_VALID_URL = r'https?://(?:www\.)?vodlocker\.com/(?P<id>[0-9a-zA-Z]+)(?:\..*?)?'
|
||||||
|
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'http://vodlocker.com/e8wvyzz4sl42',
|
'url': 'http://vodlocker.com/e8wvyzz4sl42',
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
|
|
||||||
__version__ = '2014.07.20.2'
|
__version__ = '2014.07.22'
|
||||||
|
Loading…
Reference in New Issue
Block a user