增加爱奇艺链接方式解析

This commit is contained in:
xhlove
2020-01-05 14:49:33 +08:00
parent 858fb65ede
commit 78083c2295
11 changed files with 239 additions and 72 deletions

24
pfunc/cfunc.py Normal file
View 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"]