mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-27 14:15:37 +01:00
This commit is contained in:
parent
5d9f6cbc5a
commit
fda6d237a5
|
@ -2537,14 +2537,15 @@ class GenericIE(InfoExtractor):
|
||||||
dailymail_urls, video_id, video_title, ie=DailyMailIE.ie_key())
|
dailymail_urls, video_id, video_title, ie=DailyMailIE.ie_key())
|
||||||
|
|
||||||
# Look for embedded Wistia player
|
# Look for embedded Wistia player
|
||||||
wistia_url = WistiaIE._extract_url(webpage)
|
wistia_urls = WistiaIE._extract_urls(webpage)
|
||||||
if wistia_url:
|
if wistia_urls:
|
||||||
return {
|
playlist = self.playlist_from_matches(wistia_urls, video_id, video_title, ie=WistiaIE.ie_key())
|
||||||
'_type': 'url_transparent',
|
for entry in playlist['entries']:
|
||||||
'url': self._proto_relative_url(wistia_url),
|
entry.update({
|
||||||
'ie_key': WistiaIE.ie_key(),
|
'_type': 'url_transparent',
|
||||||
'uploader': video_uploader,
|
'uploader': video_uploader,
|
||||||
}
|
})
|
||||||
|
return playlist
|
||||||
|
|
||||||
# Look for SVT player
|
# Look for SVT player
|
||||||
svt_url = SVTIE._extract_url(webpage)
|
svt_url = SVTIE._extract_url(webpage)
|
||||||
|
|
|
@ -45,22 +45,23 @@ class WistiaIE(InfoExtractor):
|
||||||
# https://wistia.com/support/embed-and-share/video-on-your-website
|
# https://wistia.com/support/embed-and-share/video-on-your-website
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _extract_url(webpage):
|
def _extract_url(webpage):
|
||||||
match = re.search(
|
urls = WistiaIE._extract_urls(webpage)
|
||||||
r'<(?:meta[^>]+?content|(?:iframe|script)[^>]+?src)=["\'](?P<url>(?:https?:)?//(?:fast\.)?wistia\.(?:net|com)/embed/(?:iframe|medias)/[a-z0-9]{10})', webpage)
|
return urls[0] if urls else None
|
||||||
if match:
|
|
||||||
return unescapeHTML(match.group('url'))
|
|
||||||
|
|
||||||
match = re.search(
|
@staticmethod
|
||||||
r'''(?sx)
|
def _extract_urls(webpage):
|
||||||
<script[^>]+src=(["'])(?:https?:)?//fast\.wistia\.com/assets/external/E-v1\.js\1[^>]*>.*?
|
urls = []
|
||||||
<div[^>]+class=(["']).*?\bwistia_async_(?P<id>[a-z0-9]{10})\b.*?\2
|
for match in re.finditer(
|
||||||
''', webpage)
|
r'<(?:meta[^>]+?content|(?:iframe|script)[^>]+?src)=["\'](?P<url>(?:https?:)?//(?:fast\.)?wistia\.(?:net|com)/embed/(?:iframe|medias)/[a-z0-9]{10})', webpage):
|
||||||
if match:
|
urls.append(unescapeHTML(match.group('url')))
|
||||||
return 'wistia:%s' % match.group('id')
|
for match in re.finditer(
|
||||||
|
r'''(?sx)
|
||||||
match = re.search(r'(?:data-wistia-?id=["\']|Wistia\.embed\(["\']|id=["\']wistia_)(?P<id>[a-z0-9]{10})', webpage)
|
<div[^>]+class=(["']).*?\bwistia_async_(?P<id>[a-z0-9]{10})\b.*?\2
|
||||||
if match:
|
''', webpage):
|
||||||
return 'wistia:%s' % match.group('id')
|
urls.append('wistia:%s' % match.group('id'))
|
||||||
|
for match in re.finditer(r'(?:data-wistia-?id=["\']|Wistia\.embed\(["\']|id=["\']wistia_)(?P<id>[a-z0-9]{10})', webpage):
|
||||||
|
urls.append('wistia:%s' % match.group('id'))
|
||||||
|
return urls
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user