mirror of
https://github.com/soimort/you-get.git
synced 2025-03-14 20:04:00 +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')
|
||||||
|
@ -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"])
|
||||||
|
@ -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