1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-10-31 22:55:26 +00:00

[ustream] Add UstreamIE._extract_url()

Ref: #11547
This commit is contained in:
Yen Chi Hsuan 2017-01-20 21:59:24 +08:00
parent 1fe84be0f3
commit d77ac73790
No known key found for this signature in database
GPG key ID: 7F902A182457CA23
2 changed files with 11 additions and 4 deletions

View file

@ -79,6 +79,7 @@ from .dbtv import DBTVIE
from .piksel import PikselIE from .piksel import PikselIE
from .videa import VideaIE from .videa import VideaIE
from .twentymin import TwentyMinutenIE from .twentymin import TwentyMinutenIE
from .ustream import UstreamIE
class GenericIE(InfoExtractor): class GenericIE(InfoExtractor):
@ -2112,10 +2113,9 @@ class GenericIE(InfoExtractor):
return self.url_result(mobj.group('url'), 'TED') return self.url_result(mobj.group('url'), 'TED')
# Look for embedded Ustream videos # Look for embedded Ustream videos
mobj = re.search( ustream_url = UstreamIE._extract_url(webpage)
r'<iframe[^>]+?src=(["\'])(?P<url>http://www\.ustream\.tv/embed/.+?)\1', webpage) if ustream_url:
if mobj is not None: return self.url_result(ustream_url, UstreamIE.ie_key())
return self.url_result(mobj.group('url'), 'Ustream')
# Look for embedded arte.tv player # Look for embedded arte.tv player
mobj = re.search( mobj = re.search(

View file

@ -69,6 +69,13 @@ class UstreamIE(InfoExtractor):
}, },
}] }]
@staticmethod
def _extract_url(webpage):
mobj = re.search(
r'<iframe[^>]+?src=(["\'])(?P<url>http://www\.ustream\.tv/embed/.+?)\1', webpage)
if mobj is not None:
return mobj.group('url')
def _get_stream_info(self, url, video_id, app_id_ver, extra_note=None): def _get_stream_info(self, url, video_id, app_id_ver, extra_note=None):
def num_to_hex(n): def num_to_hex(n):
return hex(n)[2:] return hex(n)[2:]