mirror of
https://github.com/xhlove/GetDanMu.git
synced 2025-12-17 16:45:57 +08:00
增加爱奇艺链接方式解析
This commit is contained in:
24
pfunc/cfunc.py
Normal file
24
pfunc/cfunc.py
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env python3.7
|
||||
# coding=utf-8
|
||||
'''
|
||||
# 作者: weimo
|
||||
# 创建日期: 2020-01-05 12:45:18
|
||||
# 上次编辑时间: 2020-01-05 14:44:42
|
||||
# 一个人的命运啊,当然要靠自我奋斗,但是...
|
||||
'''
|
||||
from urllib.parse import urlparse
|
||||
|
||||
|
||||
def check_url_site(url):
|
||||
return urlparse(url).netloc.split(".")[-2]
|
||||
|
||||
def check_url_locale(url):
|
||||
flag = {
|
||||
"cn":"zh_cn",
|
||||
"tw":"zh_tw",
|
||||
"intl":"intl"
|
||||
}
|
||||
if urlparse(url).netloc.split(".")[0] == "tw":
|
||||
return flag["tw"]
|
||||
else:
|
||||
return flag["cn"]
|
||||
Reference in New Issue
Block a user