Merge branch 'patch-1' of https://github.com/cclauss/you-get into cclauss-patch-1

This commit is contained in:
Mort Yao 2019-04-23 23:57:58 +02:00
commit 0811aed29c
No known key found for this signature in database
GPG Key ID: 07DA00CB78203251
5 changed files with 17 additions and 12 deletions

View File

@ -6,15 +6,20 @@ python:
- "3.4"
- "3.5"
- "3.6"
- "3.7-dev"
- "nightly"
- "pypy3"
matrix:
include:
- python: "3.7"
dist: xenial
- python: "3.8-dev"
dist: xenial
- python: "nightly"
dist: xenial
before_install:
- if [[ $TRAVIS_PYTHON_VERSION != '3.2'* && $TRAVIS_PYTHON_VERSION != '3.3'* ]]; then pip install flake8; fi
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
sudo: false
notifications:
webhooks:
urls:

View File

@ -38,7 +38,7 @@ def baidu_get_song_title(data):
def baidu_get_song_lyric(data):
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):

View File

@ -62,12 +62,12 @@ def douyutv_download(url, output_dir='.', merge=True, info_only=False, **kwargs)
json_content = json.loads(content)
data = json_content['data']
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)
title = data.get('room_name')
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)
real_url = data.get('rtmp_url') + '/' + data.get('rtmp_live')

View File

@ -25,7 +25,7 @@ def panda_download(url, output_dir = '.', merge = True, info_only = False, **kwa
room_key = data["videoinfo"]["room_key"]
plflag = data["videoinfo"]["plflag"].split("_")
status = data["videoinfo"]["status"]
if status is not "2":
if status != "2":
raise ValueError("The live stream is not online! (status:%s)" % status)
data2 = json.loads(data["videoinfo"]["plflag_list"])

View File

@ -34,7 +34,7 @@ def zhibo_download(url, output_dir = '.', merge = True, info_only = False, **kwa
html = get_html(url)
title = r1(r'<title>([\s\S]*)</title>', 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)
match = re.search(r"""