mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-01-07 17:16:08 +00:00
[GenericIE] Outsource embedded blip.tv player video id extraction to BlipTVIE and fix minor errors in RegEx
This commit is contained in:
parent
c0f9969b9e
commit
19dab5e6cc
|
@ -271,16 +271,12 @@ class GenericIE(InfoExtractor):
|
||||||
}
|
}
|
||||||
|
|
||||||
# Look for embedded blip.tv player
|
# Look for embedded blip.tv player
|
||||||
mobj = re.search(r'<meta\s[^>]*https?://api.blip.tv/\w+/redirect/\w+/(\d+)', webpage)
|
mobj = re.search(r'<meta\s[^>]*https?://api\.blip\.tv/\w+/redirect/\w+/(\d+)', webpage)
|
||||||
if mobj:
|
if mobj:
|
||||||
return self.url_result('http://blip.tv/seo/-'+mobj.group(1), 'BlipTV')
|
return self.url_result('http://blip.tv/a/a-'+mobj.group(1), 'BlipTV')
|
||||||
mobj = re.search(r'<(?:iframe|embed|object)\s[^>]*https?://(?:\w+\.)?blip.tv/(?:play/|api\.swf#)([a-zA-Z0-9]+)', webpage)
|
mobj = re.search(r'<(?:iframe|embed|object)\s[^>]*(https?://(?:\w+\.)?blip\.tv/(?:play/|api\.swf#)[a-zA-Z0-9]+)', webpage)
|
||||||
if mobj:
|
if mobj:
|
||||||
player_url = 'http://blip.tv/play/%s.x?p=1' % mobj.group(1)
|
return self.url_result(mobj.group(1), 'BlipTV')
|
||||||
player_page = self._download_webpage(player_url, mobj.group(1))
|
|
||||||
blip_video_id = self._search_regex(r'data-episode-id="(\d+)', player_page, u'blip_video_id', fatal=False)
|
|
||||||
if blip_video_id:
|
|
||||||
return self.url_result('http://blip.tv/seo/-'+blip_video_id, 'BlipTV')
|
|
||||||
|
|
||||||
# Look for Bandcamp pages with custom domain
|
# Look for Bandcamp pages with custom domain
|
||||||
mobj = re.search(r'<meta property="og:url"[^>]*?content="(.*?bandcamp\.com.*?)"', webpage)
|
mobj = re.search(r'<meta property="og:url"[^>]*?content="(.*?bandcamp\.com.*?)"', webpage)
|
||||||
|
|
Loading…
Reference in a new issue