完善说明,爱奇艺支持series命令,增加弹幕区间设定

This commit is contained in:
xhlove
2020-02-07 19:05:58 +08:00
parent 27de5ce4a3
commit 1c31057b9d
11 changed files with 115 additions and 36 deletions

View File

@@ -3,7 +3,7 @@
'''
# 作者: weimo
# 创建日期: 2020-01-04 19:14:41
# 上次编辑时间 : 2020-01-16 19:58:51
# 上次编辑时间 : 2020-02-07 17:32:10
# 一个人的命运啊,当然要靠自我奋斗,但是...
'''
@@ -66,8 +66,11 @@ def get_danmu_by_tvid(name, duration, tvid):
def main(args):
vinfos = []
isall = False
if args.series:
isall = True
if args.tvid:
vi = get_vinfo_by_tvid(args.tvid)
vi = get_vinfo_by_tvid(args.tvid, isall=isall)
if vi:
vinfos.append(vi)
if args.aid:
@@ -77,7 +80,7 @@ def main(args):
if args.tvid == "" and args.aid == "" and args.url == "":
args.url = input("请输入iqiyi链接\n")
if args.url:
vi = get_vinfos_by_url(args.url)
vi = get_vinfos_by_url(args.url, isall=isall)
if vi:
vinfos += vi
subtitles = {}

View File

@@ -3,7 +3,7 @@
'''
# 作者: weimo
# 创建日期: 2020-01-28 15:55:22
# 上次编辑时间 : 2020-01-28 19:57:57
# 上次编辑时间 : 2020-02-07 18:32:05
# 一个人的命运啊,当然要靠自我奋斗,但是...
'''
import re
@@ -155,7 +155,6 @@ def get_vinfos_by_url(url: str, isall: bool):
if vinfo is None:
return
vinfos.append(vinfo)
print("ccc", cid_v1)
if cid_v1 or cid_v2:
if cid_v2 is None:
cid = cid_v1.group(1)

View File

@@ -3,7 +3,7 @@
'''
# 作者: weimo
# 创建日期: 2020-01-16 17:45:35
# 上次编辑时间 : 2020-01-16 20:09:22
# 上次编辑时间 : 2020-02-07 18:43:55
# 一个人的命运啊,当然要靠自我奋斗,但是...
'''
import json
@@ -99,7 +99,7 @@ def get_vinfos(aid: str):
try:
r = requests.get(api_url, params=params, headers=chrome, timeout=3).content.decode("gbk")
except Exception as e:
print("get sohu (vid -> {}) videolist failed.".format(vid))
print("get sohu (aid -> {}) videolist failed.".format(aid))
return None
data = json.loads(r)
if data.get("videos"):