增加搜狐视频弹幕下载并改进输入提示

This commit is contained in:
xhlove
2020-01-16 20:12:07 +08:00
parent 3cfccc1c3c
commit 986ec2b9fe
10 changed files with 302 additions and 30 deletions

View File

@@ -3,13 +3,15 @@
'''
# 作者: weimo
# 创建日期: 2020-01-05 12:45:18
# 上次编辑时间 : 2020-01-11 17:37:22
# 上次编辑时间 : 2020-01-16 14:50:34
# 一个人的命运啊,当然要靠自我奋斗,但是...
'''
import hashlib
from urllib.parse import urlparse
from basic.vars import ALLOW_SITES
def remove_same_danmu(comments: list):
# 在原有基础上pop会引起索引变化 所以还是采用下面这个方式
contents = []
@@ -23,7 +25,11 @@ def remove_same_danmu(comments: list):
return contents
def check_url_site(url):
return urlparse(url).netloc.split(".")[-2]
site = urlparse(url).netloc.split(".")[-2]
if site in ALLOW_SITES:
return site
else:
return None
def check_url_locale(url):
flag = {