Skip to content

Commit

Permalink
Fix zhibo.tv regular expression.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yang Bo committed Dec 16, 2018
1 parent c90a44c commit 5d7df2e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/you_get/extractors/zhibo.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ def zhibo_download(url, output_dir = '.', merge = True, info_only = False, **kwa
if is_live is not "1":
raise ValueError("The live stream is not online! (Errno:%s)" % is_live)

ourStreamName = r1(r"window.ourStreamName=\'([s\S'\s\.]*)\'\;[\s\S]*window.rtmpDefaultSource", html)
rtmpPollUrl = r1(r"window.rtmpPollUrl=\'([s\S'\s\.]*)\'\;[\s\S]*window.hlsDefaultSource", html)

#real_url = 'rtmp://220.194.213.56/live.zhibo.tv/8live/' + ourStreamName
real_url = rtmpPollUrl + ourStreamName
match = re.search(r"""
ourStreamName .*?
'(.*?)' .*?
rtmpHighSource .*?
'(.*?)' .*?
'(.*?)'
""", html, re.S | re.X)
real_url = match.group(3) + match.group(1) + match.group(2)

print_info(site_info, title, 'flv', float('inf'))
if not info_only:
Expand Down

0 comments on commit 5d7df2e

Please sign in to comment.