mirror of
https://github.com/l1ving/youtube-dl
synced 2025-01-28 01:02:57 +08:00
Merge branch 'master' into BlenderCloud-issue-13282
This commit is contained in:
commit
772991aaa8
@ -84,9 +84,10 @@ class BuzzFeedIE(InfoExtractor):
|
|||||||
continue
|
continue
|
||||||
entries.append(self.url_result(video['url']))
|
entries.append(self.url_result(video['url']))
|
||||||
|
|
||||||
facebook_url = FacebookIE._extract_url(webpage)
|
facebook_urls = FacebookIE._extract_urls(webpage)
|
||||||
if facebook_url:
|
entries.extend([
|
||||||
entries.append(self.url_result(facebook_url))
|
self.url_result(facebook_url)
|
||||||
|
for facebook_url in facebook_urls])
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'_type': 'playlist',
|
'_type': 'playlist',
|
||||||
|
@ -203,19 +203,19 @@ class FacebookIE(InfoExtractor):
|
|||||||
}]
|
}]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _extract_url(webpage):
|
def _extract_urls(webpage):
|
||||||
mobj = re.search(
|
urls = []
|
||||||
r'<iframe[^>]+?src=(["\'])(?P<url>https://www\.facebook\.com/video/embed.+?)\1', webpage)
|
for mobj in re.finditer(
|
||||||
if mobj is not None:
|
r'<iframe[^>]+?src=(["\'])(?P<url>https?://www\.facebook\.com/(?:video/embed|plugins/video\.php).+?)\1',
|
||||||
return mobj.group('url')
|
webpage):
|
||||||
|
urls.append(mobj.group('url'))
|
||||||
# Facebook API embed
|
# Facebook API embed
|
||||||
# see https://developers.facebook.com/docs/plugins/embedded-video-player
|
# see https://developers.facebook.com/docs/plugins/embedded-video-player
|
||||||
mobj = re.search(r'''(?x)<div[^>]+
|
for mobj in re.finditer(r'''(?x)<div[^>]+
|
||||||
class=(?P<q1>[\'"])[^\'"]*\bfb-(?:video|post)\b[^\'"]*(?P=q1)[^>]+
|
class=(?P<q1>[\'"])[^\'"]*\bfb-(?:video|post)\b[^\'"]*(?P=q1)[^>]+
|
||||||
data-href=(?P<q2>[\'"])(?P<url>(?:https?:)?//(?:www\.)?facebook.com/.+?)(?P=q2)''', webpage)
|
data-href=(?P<q2>[\'"])(?P<url>(?:https?:)?//(?:www\.)?facebook.com/.+?)(?P=q2)''', webpage):
|
||||||
if mobj is not None:
|
urls.append(mobj.group('url'))
|
||||||
return mobj.group('url')
|
return urls
|
||||||
|
|
||||||
def _login(self):
|
def _login(self):
|
||||||
(useremail, password) = self._get_login_info()
|
(useremail, password) = self._get_login_info()
|
||||||
|
@ -1522,6 +1522,21 @@ class GenericIE(InfoExtractor):
|
|||||||
'title': 'Facebook video #599637780109885',
|
'title': 'Facebook video #599637780109885',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
# Facebook <iframe> embed, plugin video
|
||||||
|
{
|
||||||
|
'url': 'http://5pillarsuk.com/2017/06/07/tariq-ramadan-disagrees-with-pr-exercise-by-imams-refusing-funeral-prayers-for-london-attackers/',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '1754168231264132',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'About the Imams and Religious leaders refusing to perform funeral prayers for...',
|
||||||
|
'uploader': 'Tariq Ramadan (official)',
|
||||||
|
'timestamp': 1496758379,
|
||||||
|
'upload_date': '20170606',
|
||||||
|
},
|
||||||
|
'params': {
|
||||||
|
'skip_download': True,
|
||||||
|
},
|
||||||
|
},
|
||||||
# Facebook API embed
|
# Facebook API embed
|
||||||
{
|
{
|
||||||
'url': 'http://www.lothype.com/blue-stars-2016-preview-standstill-full-show/',
|
'url': 'http://www.lothype.com/blue-stars-2016-preview-standstill-full-show/',
|
||||||
@ -2222,9 +2237,9 @@ class GenericIE(InfoExtractor):
|
|||||||
return self.url_result(mobj.group('url'))
|
return self.url_result(mobj.group('url'))
|
||||||
|
|
||||||
# Look for embedded Facebook player
|
# Look for embedded Facebook player
|
||||||
facebook_url = FacebookIE._extract_url(webpage)
|
facebook_urls = FacebookIE._extract_urls(webpage)
|
||||||
if facebook_url is not None:
|
if facebook_urls:
|
||||||
return self.url_result(facebook_url, 'Facebook')
|
return self.playlist_from_matches(facebook_urls, video_id, video_title)
|
||||||
|
|
||||||
# Look for embedded VK player
|
# Look for embedded VK player
|
||||||
mobj = re.search(r'<iframe[^>]+?src=(["\'])(?P<url>https?://vk\.com/video_ext\.php.+?)\1', webpage)
|
mobj = re.search(r'<iframe[^>]+?src=(["\'])(?P<url>https?://vk\.com/video_ext\.php.+?)\1', webpage)
|
||||||
|
@ -136,7 +136,7 @@ class SoundcloudIE(InfoExtractor):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _resolv_url(cls, url):
|
def _resolv_url(cls, url):
|
||||||
return 'http://api.soundcloud.com/resolve.json?url=' + url + '&client_id=' + cls._CLIENT_ID
|
return 'https://api.soundcloud.com/resolve.json?url=' + url + '&client_id=' + cls._CLIENT_ID
|
||||||
|
|
||||||
def _extract_info_dict(self, info, full_title=None, quiet=False, secret_token=None):
|
def _extract_info_dict(self, info, full_title=None, quiet=False, secret_token=None):
|
||||||
track_id = compat_str(info['id'])
|
track_id = compat_str(info['id'])
|
||||||
@ -174,7 +174,7 @@ class SoundcloudIE(InfoExtractor):
|
|||||||
|
|
||||||
# We have to retrieve the url
|
# We have to retrieve the url
|
||||||
format_dict = self._download_json(
|
format_dict = self._download_json(
|
||||||
'http://api.soundcloud.com/i1/tracks/%s/streams' % track_id,
|
'https://api.soundcloud.com/i1/tracks/%s/streams' % track_id,
|
||||||
track_id, 'Downloading track url', query={
|
track_id, 'Downloading track url', query={
|
||||||
'client_id': self._CLIENT_ID,
|
'client_id': self._CLIENT_ID,
|
||||||
'secret_token': secret_token,
|
'secret_token': secret_token,
|
||||||
@ -236,7 +236,7 @@ class SoundcloudIE(InfoExtractor):
|
|||||||
track_id = mobj.group('track_id')
|
track_id = mobj.group('track_id')
|
||||||
|
|
||||||
if track_id is not None:
|
if track_id is not None:
|
||||||
info_json_url = 'http://api.soundcloud.com/tracks/' + track_id + '.json?client_id=' + self._CLIENT_ID
|
info_json_url = 'https://api.soundcloud.com/tracks/' + track_id + '.json?client_id=' + self._CLIENT_ID
|
||||||
full_title = track_id
|
full_title = track_id
|
||||||
token = mobj.group('secret_token')
|
token = mobj.group('secret_token')
|
||||||
if token:
|
if token:
|
||||||
@ -261,7 +261,7 @@ class SoundcloudIE(InfoExtractor):
|
|||||||
|
|
||||||
self.report_resolve(full_title)
|
self.report_resolve(full_title)
|
||||||
|
|
||||||
url = 'http://soundcloud.com/%s' % resolve_title
|
url = 'https://soundcloud.com/%s' % resolve_title
|
||||||
info_json_url = self._resolv_url(url)
|
info_json_url = self._resolv_url(url)
|
||||||
info = self._download_json(info_json_url, full_title, 'Downloading info JSON')
|
info = self._download_json(info_json_url, full_title, 'Downloading info JSON')
|
||||||
|
|
||||||
@ -290,7 +290,7 @@ class SoundcloudSetIE(SoundcloudPlaylistBaseIE):
|
|||||||
'id': '2284613',
|
'id': '2284613',
|
||||||
'title': 'The Royal Concept EP',
|
'title': 'The Royal Concept EP',
|
||||||
},
|
},
|
||||||
'playlist_mincount': 6,
|
'playlist_mincount': 5,
|
||||||
}, {
|
}, {
|
||||||
'url': 'https://soundcloud.com/the-concept-band/sets/the-royal-concept-ep/token',
|
'url': 'https://soundcloud.com/the-concept-band/sets/the-royal-concept-ep/token',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
@ -304,7 +304,7 @@ class SoundcloudSetIE(SoundcloudPlaylistBaseIE):
|
|||||||
# extract simple title (uploader + slug of song title)
|
# extract simple title (uploader + slug of song title)
|
||||||
slug_title = mobj.group('slug_title')
|
slug_title = mobj.group('slug_title')
|
||||||
full_title = '%s/sets/%s' % (uploader, slug_title)
|
full_title = '%s/sets/%s' % (uploader, slug_title)
|
||||||
url = 'http://soundcloud.com/%s/sets/%s' % (uploader, slug_title)
|
url = 'https://soundcloud.com/%s/sets/%s' % (uploader, slug_title)
|
||||||
|
|
||||||
token = mobj.group('token')
|
token = mobj.group('token')
|
||||||
if token:
|
if token:
|
||||||
@ -380,7 +380,7 @@ class SoundcloudUserIE(SoundcloudPlaylistBaseIE):
|
|||||||
'url': 'https://soundcloud.com/grynpyret/spotlight',
|
'url': 'https://soundcloud.com/grynpyret/spotlight',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '7098329',
|
'id': '7098329',
|
||||||
'title': 'GRYNPYRET (Spotlight)',
|
'title': 'Grynpyret (Spotlight)',
|
||||||
},
|
},
|
||||||
'playlist_mincount': 1,
|
'playlist_mincount': 1,
|
||||||
}]
|
}]
|
||||||
@ -410,7 +410,7 @@ class SoundcloudUserIE(SoundcloudPlaylistBaseIE):
|
|||||||
mobj = re.match(self._VALID_URL, url)
|
mobj = re.match(self._VALID_URL, url)
|
||||||
uploader = mobj.group('user')
|
uploader = mobj.group('user')
|
||||||
|
|
||||||
url = 'http://soundcloud.com/%s/' % uploader
|
url = 'https://soundcloud.com/%s/' % uploader
|
||||||
resolv_url = self._resolv_url(url)
|
resolv_url = self._resolv_url(url)
|
||||||
user = self._download_json(
|
user = self._download_json(
|
||||||
resolv_url, uploader, 'Downloading user info')
|
resolv_url, uploader, 'Downloading user info')
|
||||||
@ -473,7 +473,7 @@ class SoundcloudPlaylistIE(SoundcloudPlaylistBaseIE):
|
|||||||
_VALID_URL = r'https?://api\.soundcloud\.com/playlists/(?P<id>[0-9]+)(?:/?\?secret_token=(?P<token>[^&]+?))?$'
|
_VALID_URL = r'https?://api\.soundcloud\.com/playlists/(?P<id>[0-9]+)(?:/?\?secret_token=(?P<token>[^&]+?))?$'
|
||||||
IE_NAME = 'soundcloud:playlist'
|
IE_NAME = 'soundcloud:playlist'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'http://api.soundcloud.com/playlists/4110309',
|
'url': 'https://api.soundcloud.com/playlists/4110309',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '4110309',
|
'id': '4110309',
|
||||||
'title': 'TILT Brass - Bowery Poetry Club, August \'03 [Non-Site SCR 02]',
|
'title': 'TILT Brass - Bowery Poetry Club, August \'03 [Non-Site SCR 02]',
|
||||||
|
Loading…
Reference in New Issue
Block a user