Merge remote-tracking branch 'rzhxeo/blip'

Conflicts:
	youtube_dl/extractor/bliptv.py
pull/8/head
Philipp Hagemeister 11 years ago
commit aff24732b9

@ -22,8 +22,8 @@ from ..utils import (
class BlipTVIE(InfoExtractor): class BlipTVIE(InfoExtractor):
"""Information extractor for blip.tv""" """Information extractor for blip.tv"""
_VALID_URL = r'^(?:https?://)?(?:www\.)?blip\.tv/((.+/)|(play/)|(api\.swf#))(.+)$' _VALID_URL = r'^(?:https?://)?(?:\w+\.)?blip\.tv/((.+/)|(play/)|(api\.swf#))(.+)$'
IE_NAME = 'blip.tv'
_TEST = { _TEST = {
'url': 'http://blip.tv/cbr/cbr-exclusive-gotham-city-imposters-bats-vs-jokerz-short-3-5796352', 'url': 'http://blip.tv/cbr/cbr-exclusive-gotham-city-imposters-bats-vs-jokerz-short-3-5796352',
'file': '5779306.mov', 'file': '5779306.mov',
@ -46,17 +46,12 @@ class BlipTVIE(InfoExtractor):
raise ExtractorError('Invalid URL: %s' % url) raise ExtractorError('Invalid URL: %s' % url)
# See https://github.com/rg3/youtube-dl/issues/857 # See https://github.com/rg3/youtube-dl/issues/857
api_mobj = re.match(r'http://a\.blip\.tv/api\.swf#(?P<video_id>[\d\w]+)', url) embed_mobj = re.search(r'^(?:https?://)?(?:\w+\.)?blip\.tv/(?:play/|api\.swf#)([a-zA-Z0-9]+)', url)
if api_mobj is not None: if embed_mobj:
url = 'http://blip.tv/play/g_%s' % api_mobj.group('video_id') info_url = 'http://blip.tv/play/%s.x?p=1' % embed_mobj.group(1)
urlp = compat_urllib_parse_urlparse(url) info_page = self._download_webpage(info_url, embed_mobj.group(1))
if urlp.path.startswith('/play/'): video_id = self._search_regex(r'data-episode-id="(\d+)', info_page, 'video_id')
response = self._request_webpage(url, None, False) return self.url_result('http://blip.tv/a/a-' + video_id, 'BlipTV')
redirecturl = response.geturl()
rurlp = compat_urllib_parse_urlparse(redirecturl)
file_id = compat_parse_qs(rurlp.fragment)['file'][0].rpartition('/')[2]
url = 'http://blip.tv/a/a-' + file_id
return self._real_extract(url)
if '?' in url: if '?' in url:
cchar = '&' cchar = '&'

@ -273,16 +273,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…
Cancel
Save