修复判断逻辑
This commit is contained in:
parent
efbcc9c045
commit
a4f003d215
@ -1,6 +1,6 @@
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
hth_keywords = ["华体会", "hth", "HTH", "代理WEB"]
|
hth_keywords = ["华体会", "hth", "HTH", "代理WEB", "代理web"]
|
||||||
ky_keywords = ["开云"]
|
ky_keywords = ["开云"]
|
||||||
jy_keywords = ["九游"]
|
jy_keywords = ["九游"]
|
||||||
|
|
||||||
@ -40,14 +40,14 @@ def get_url_mapping(urls_with_context, template_type):
|
|||||||
# 构建映射字典,直接返回结果
|
# 构建映射字典,直接返回结果
|
||||||
if template_type == 'hth':
|
if template_type == 'hth':
|
||||||
url_mapping = {
|
url_mapping = {
|
||||||
"{{hthApp}}": categories.get("全站", [""])[0] if categories.get("全站", [""])[0] else categories.get("全站APP", [""])[0],
|
"{{hthApp}}": categories.get("全站", [""])[0] if categories.get("全站", [""]) else categories.get("全站APP", [""])[0],
|
||||||
"{{hthtyApp}}": categories.get("体育", [""])[0] if categories.get("体育", [""])[0] else categories.get("体育APP", [""])[0],
|
"{{hthtyApp}}": categories.get("体育", [""])[0] if categories.get("体育", [""]) else categories.get("体育APP", [""])[0],
|
||||||
"{{hthPc}}": categories.get("WEB", [""])[0] if categories.get("WEB", [""])[0] else categories.get("web", [""])[0],
|
"{{hthPc}}": categories.get("WEB", [""])[0] if categories.get("WEB", [""]) else categories.get("web", [""])[0],
|
||||||
"{{hthH5}}": categories.get("H5", [""])[0] if categories.get("H5", [""])[0] else categories.get("h5", [""])[0]
|
"{{hthH5}}": categories.get("H5", [""])[0] if categories.get("H5", [""]) else categories.get("h5", [""])[0]
|
||||||
}
|
}
|
||||||
elif template_type == 'ky': # ky模板
|
elif template_type == 'ky': # ky模板
|
||||||
url_mapping = {
|
url_mapping = {
|
||||||
"{{kyPc1}}": categories.get("WEB", [""])[0],
|
"{{kyPc}}": categories.get("WEB", [""])[0],
|
||||||
"{{kyPc2}}": categories.get("WEB", ["", ""])[1],
|
"{{kyPc2}}": categories.get("WEB", ["", ""])[1],
|
||||||
"{{kyH51}}": categories.get("H5", [""])[0],
|
"{{kyH51}}": categories.get("H5", [""])[0],
|
||||||
"{{kyH52}}": categories.get("H5", ["", ""])[1],
|
"{{kyH52}}": categories.get("H5", ["", ""])[1],
|
||||||
@ -113,15 +113,22 @@ def change_url(text, hth_template_path='/www/wwwroot/change_url/hth.js.template'
|
|||||||
return False, expected_filename if expected_filename else 'unknown.js'
|
return False, expected_filename if expected_filename else 'unknown.js'
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
text = '''华体会
|
text = '''#域名更换通知
|
||||||
SEO专用域名
|
通知:以下是最新域名:
|
||||||
|
|
||||||
WEB https://www.cww2mcl.com:8002
|
web
|
||||||
H5 https://www.gauo9k.com:6443
|
https://www.e5vj65s.com:9961 【新】
|
||||||
全站 https://www.9qhjyb.vip:9505
|
h5
|
||||||
体育 https://www.cjmn0b.vip:9020 【新】
|
https://www.g81mly.com:8553
|
||||||
|
全站APP
|
||||||
SEO 防拦截域名
|
https://www.9n3nhg.vip:9017
|
||||||
WEB https://www.wyr8s.com:9663
|
体育APP
|
||||||
H5 https://www.ow9860n.com:9663'''
|
https://www.c9jngo.vip:6004
|
||||||
|
代理web
|
||||||
|
https://www.kvvgv.com:9043
|
||||||
|
代理H5
|
||||||
|
https://www.lt08m.com:9960
|
||||||
|
|
||||||
|
|
||||||
|
备注:域名后面的数字为正常,请勿删除'''
|
||||||
change_url(text,hth_template_path='template/hth.js.template',ky_template_path='template/ky.js.template',jy_template_path='template/jy.js.template')
|
change_url(text,hth_template_path='template/hth.js.template',ky_template_path='template/ky.js.template',jy_template_path='template/jy.js.template')
|
@ -6,8 +6,8 @@ var jy_link = {
|
|||||||
jyApp: '{{jyApp}}/?i_code='+jyCode,
|
jyApp: '{{jyApp}}/?i_code='+jyCode,
|
||||||
jyQp:'{{jyQp}}/?i_code='+jyCode,
|
jyQp:'{{jyQp}}/?i_code='+jyCode,
|
||||||
jyDz:'{{jyDz}}/?i_code='+jyCode,
|
jyDz:'{{jyDz}}/?i_code='+jyCode,
|
||||||
jyFljPc:'{{jyFljPc}}/?i_code='+jyCode,
|
jyFljPc:'{{jyFljPc}}/register/?i_code='+jyCode,
|
||||||
jyFljH5:'{{jyFljH5}}/?i_code='+jyCode,
|
jyFljH5:'{{jyFljH5}}/entry/register?i_code='+jyCode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user