mirror of
https://github.com/soimort/you-get.git
synced 2025-03-14 11:54:01 +03:00
Merge branch 'patch-1' of https://github.com/cclauss/you-get into cclauss-patch-1
This commit is contained in:
commit
0811aed29c
13
.travis.yml
13
.travis.yml
@ -6,15 +6,20 @@ python:
|
|||||||
- "3.4"
|
- "3.4"
|
||||||
- "3.5"
|
- "3.5"
|
||||||
- "3.6"
|
- "3.6"
|
||||||
- "3.7-dev"
|
|
||||||
- "nightly"
|
|
||||||
- "pypy3"
|
- "pypy3"
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- python: "3.7"
|
||||||
|
dist: xenial
|
||||||
|
- python: "3.8-dev"
|
||||||
|
dist: xenial
|
||||||
|
- python: "nightly"
|
||||||
|
dist: xenial
|
||||||
before_install:
|
before_install:
|
||||||
- if [[ $TRAVIS_PYTHON_VERSION != '3.2'* && $TRAVIS_PYTHON_VERSION != '3.3'* ]]; then pip install flake8; fi
|
- if [[ $TRAVIS_PYTHON_VERSION != '3.2'* && $TRAVIS_PYTHON_VERSION != '3.3'* ]]; then pip install flake8; fi
|
||||||
before_script:
|
before_script:
|
||||||
- if [[ $TRAVIS_PYTHON_VERSION != '3.2'* && $TRAVIS_PYTHON_VERSION != '3.3'* ]]; then flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics; fi
|
- if [[ $TRAVIS_PYTHON_VERSION != '3.2'* && $TRAVIS_PYTHON_VERSION != '3.3'* ]]; then flake8 . --count --select=E9,F63,F72,F82 --show-source --statistics; fi
|
||||||
script: make test
|
script: make test
|
||||||
sudo: false
|
|
||||||
notifications:
|
notifications:
|
||||||
webhooks:
|
webhooks:
|
||||||
urls:
|
urls:
|
||||||
|
@ -38,7 +38,7 @@ def baidu_get_song_title(data):
|
|||||||
|
|
||||||
def baidu_get_song_lyric(data):
|
def baidu_get_song_lyric(data):
|
||||||
lrc = data['lrcLink']
|
lrc = data['lrcLink']
|
||||||
return None if lrc is '' else "http://music.baidu.com%s" % lrc
|
return "http://music.baidu.com%s" % lrc if lrc else None
|
||||||
|
|
||||||
|
|
||||||
def baidu_download_song(sid, output_dir='.', merge=True, info_only=False):
|
def baidu_download_song(sid, output_dir='.', merge=True, info_only=False):
|
||||||
|
@ -62,12 +62,12 @@ def douyutv_download(url, output_dir='.', merge=True, info_only=False, **kwargs)
|
|||||||
json_content = json.loads(content)
|
json_content = json.loads(content)
|
||||||
data = json_content['data']
|
data = json_content['data']
|
||||||
server_status = json_content.get('error', 0)
|
server_status = json_content.get('error', 0)
|
||||||
if server_status is not 0:
|
if server_status != 0:
|
||||||
raise ValueError("Server returned error:%s" % server_status)
|
raise ValueError("Server returned error:%s" % server_status)
|
||||||
|
|
||||||
title = data.get('room_name')
|
title = data.get('room_name')
|
||||||
show_status = data.get('show_status')
|
show_status = data.get('show_status')
|
||||||
if show_status is not "1":
|
if show_status != "1":
|
||||||
raise ValueError("The live stream is not online! (Errno:%s)" % server_status)
|
raise ValueError("The live stream is not online! (Errno:%s)" % server_status)
|
||||||
|
|
||||||
real_url = data.get('rtmp_url') + '/' + data.get('rtmp_live')
|
real_url = data.get('rtmp_url') + '/' + data.get('rtmp_live')
|
||||||
|
@ -15,7 +15,7 @@ def panda_download(url, output_dir = '.', merge = True, info_only = False, **kwa
|
|||||||
json_request_url ="http://www.panda.tv/api_room_v2?roomid={}&__plat=pc_web&_={}".format(roomid, int(time.time()))
|
json_request_url ="http://www.panda.tv/api_room_v2?roomid={}&__plat=pc_web&_={}".format(roomid, int(time.time()))
|
||||||
content = get_html(json_request_url)
|
content = get_html(json_request_url)
|
||||||
api_json = json.loads(content)
|
api_json = json.loads(content)
|
||||||
|
|
||||||
errno = api_json["errno"]
|
errno = api_json["errno"]
|
||||||
errmsg = api_json["errmsg"]
|
errmsg = api_json["errmsg"]
|
||||||
if errno:
|
if errno:
|
||||||
@ -25,7 +25,7 @@ def panda_download(url, output_dir = '.', merge = True, info_only = False, **kwa
|
|||||||
room_key = data["videoinfo"]["room_key"]
|
room_key = data["videoinfo"]["room_key"]
|
||||||
plflag = data["videoinfo"]["plflag"].split("_")
|
plflag = data["videoinfo"]["plflag"].split("_")
|
||||||
status = data["videoinfo"]["status"]
|
status = data["videoinfo"]["status"]
|
||||||
if status is not "2":
|
if status != "2":
|
||||||
raise ValueError("The live stream is not online! (status:%s)" % status)
|
raise ValueError("The live stream is not online! (status:%s)" % status)
|
||||||
|
|
||||||
data2 = json.loads(data["videoinfo"]["plflag_list"])
|
data2 = json.loads(data["videoinfo"]["plflag_list"])
|
||||||
@ -33,7 +33,7 @@ def panda_download(url, output_dir = '.', merge = True, info_only = False, **kwa
|
|||||||
sign = data2["auth"]["sign"]
|
sign = data2["auth"]["sign"]
|
||||||
ts = data2["auth"]["time"]
|
ts = data2["auth"]["time"]
|
||||||
real_url = "http://pl{}.live.panda.tv/live_panda/{}.flv?sign={}&ts={}&rid={}".format(plflag[1], room_key, sign, ts, rid)
|
real_url = "http://pl{}.live.panda.tv/live_panda/{}.flv?sign={}&ts={}&rid={}".format(plflag[1], room_key, sign, ts, rid)
|
||||||
|
|
||||||
print_info(site_info, title, 'flv', float('inf'))
|
print_info(site_info, title, 'flv', float('inf'))
|
||||||
if not info_only:
|
if not info_only:
|
||||||
download_urls([real_url], title, 'flv', None, output_dir, merge = merge)
|
download_urls([real_url], title, 'flv', None, output_dir, merge = merge)
|
||||||
|
@ -14,7 +14,7 @@ def zhibo_vedio_download(url, output_dir = '.', merge = True, info_only = False,
|
|||||||
|
|
||||||
video_html = r1(r'<script type="text/javascript">([\s\S]*)</script></head>', html)
|
video_html = r1(r'<script type="text/javascript">([\s\S]*)</script></head>', html)
|
||||||
|
|
||||||
# video_guessulike = r1(r"window.xgData =([s\S'\s\.]*)\'\;[\s\S]*window.vouchData", video_html)
|
# video_guessulike = r1(r"window.xgData =([s\S'\s\.]*)\'\;[\s\S]*window.vouchData", video_html)
|
||||||
video_url = r1(r"window.vurl = \'([s\S'\s\.]*)\'\;[\s\S]*window.imgurl", video_html)
|
video_url = r1(r"window.vurl = \'([s\S'\s\.]*)\'\;[\s\S]*window.imgurl", video_html)
|
||||||
part_urls.append(video_url)
|
part_urls.append(video_url)
|
||||||
ext = video_url.split('.')[-1]
|
ext = video_url.split('.')[-1]
|
||||||
@ -34,7 +34,7 @@ def zhibo_download(url, output_dir = '.', merge = True, info_only = False, **kwa
|
|||||||
html = get_html(url)
|
html = get_html(url)
|
||||||
title = r1(r'<title>([\s\S]*)</title>', html)
|
title = r1(r'<title>([\s\S]*)</title>', html)
|
||||||
is_live = r1(r"window.videoIsLive=\'([s\S'\s\.]*)\'\;[\s\S]*window.resDomain", html)
|
is_live = r1(r"window.videoIsLive=\'([s\S'\s\.]*)\'\;[\s\S]*window.resDomain", html)
|
||||||
if is_live is not "1":
|
if is_live != "1":
|
||||||
raise ValueError("The live stream is not online! (Errno:%s)" % is_live)
|
raise ValueError("The live stream is not online! (Errno:%s)" % is_live)
|
||||||
|
|
||||||
match = re.search(r"""
|
match = re.search(r"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user