mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-23 00:54:31 +01:00
[vimeo:ondemand] Pass Referer along with embed URL (#10624)
This commit is contained in:
parent
546edb2efa
commit
d002e91986
@ -350,6 +350,10 @@ class VimeoIE(VimeoBaseInfoExtractor):
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _smuggle_referrer(url, referrer_url):
|
||||||
|
return smuggle_url(url, {'http_headers': {'Referer': referrer_url}})
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _extract_vimeo_url(url, webpage):
|
def _extract_vimeo_url(url, webpage):
|
||||||
# Look for embedded (iframe) Vimeo player
|
# Look for embedded (iframe) Vimeo player
|
||||||
@ -357,8 +361,7 @@ class VimeoIE(VimeoBaseInfoExtractor):
|
|||||||
r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//player\.vimeo\.com/video/.+?)\1', webpage)
|
r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//player\.vimeo\.com/video/.+?)\1', webpage)
|
||||||
if mobj:
|
if mobj:
|
||||||
player_url = unescapeHTML(mobj.group('url'))
|
player_url = unescapeHTML(mobj.group('url'))
|
||||||
surl = smuggle_url(player_url, {'http_headers': {'Referer': url}})
|
return VimeoIE._smuggle_referrer(player_url, url)
|
||||||
return surl
|
|
||||||
# Look for embedded (swf embed) Vimeo player
|
# Look for embedded (swf embed) Vimeo player
|
||||||
mobj = re.search(
|
mobj = re.search(
|
||||||
r'<embed[^>]+?src="((?:https?:)?//(?:www\.)?vimeo\.com/moogaloop\.swf.+?)"', webpage)
|
r'<embed[^>]+?src="((?:https?:)?//(?:www\.)?vimeo\.com/moogaloop\.swf.+?)"', webpage)
|
||||||
@ -585,6 +588,20 @@ class VimeoOndemandIE(VimeoBaseInfoExtractor):
|
|||||||
'uploader_url': 're:https?://(?:www\.)?vimeo\.com/gumfilms',
|
'uploader_url': 're:https?://(?:www\.)?vimeo\.com/gumfilms',
|
||||||
'uploader_id': 'gumfilms',
|
'uploader_id': 'gumfilms',
|
||||||
},
|
},
|
||||||
|
}, {
|
||||||
|
# requires Referer to be passed along with og:video:url
|
||||||
|
'url': 'https://vimeo.com/ondemand/36938/126682985',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '126682985',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Rävlock, rätt läte på rätt plats',
|
||||||
|
'uploader': 'Lindroth & Norin',
|
||||||
|
'uploader_url': 're:https?://(?:www\.)?vimeo\.com/user14430847',
|
||||||
|
'uploader_id': 'user14430847',
|
||||||
|
},
|
||||||
|
'params': {
|
||||||
|
'skip_download': True,
|
||||||
|
},
|
||||||
}, {
|
}, {
|
||||||
'url': 'https://vimeo.com/ondemand/nazmaalik',
|
'url': 'https://vimeo.com/ondemand/nazmaalik',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
@ -599,7 +616,12 @@ class VimeoOndemandIE(VimeoBaseInfoExtractor):
|
|||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
return self.url_result(self._og_search_video_url(webpage), VimeoIE.ie_key())
|
return self.url_result(
|
||||||
|
# Some videos require Referer to be passed along with og:video:url
|
||||||
|
# similarly to generic vimeo embeds (e.g.
|
||||||
|
# https://vimeo.com/ondemand/36938/126682985).
|
||||||
|
VimeoIE._smuggle_referrer(self._og_search_video_url(webpage), url),
|
||||||
|
VimeoIE.ie_key())
|
||||||
|
|
||||||
|
|
||||||
class VimeoChannelIE(VimeoBaseInfoExtractor):
|
class VimeoChannelIE(VimeoBaseInfoExtractor):
|
||||||
|
Loading…
Reference in New Issue
Block a user