提交 0130c60a 编写于 作者: H hjdhnx

增加了部分新功能

上级 72e11600
...@@ -5,12 +5,13 @@ ...@@ -5,12 +5,13 @@
# Date : 2022/8/25 # Date : 2022/8/25
import os import os
from flask import Flask, jsonify, abort,request,redirect,make_response,render_template from flask import Flask, jsonify, abort,request,redirect,make_response,render_template,send_from_directory
from js.rules import getRules from js.rules import getRules
from utils import error,parser from utils import error,parser
import sys import sys
import codecs import codecs
from models.cms import CMS from models.cms import CMS
import json
sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach()) sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
app = Flask(__name__,static_folder='static',static_url_path='/static') app = Flask(__name__,static_folder='static',static_url_path='/static')
...@@ -41,7 +42,7 @@ def forbidden(): # put application's code here ...@@ -41,7 +42,7 @@ def forbidden(): # put application's code here
@app.route('/index') @app.route('/index')
def index(): # put application's code here def index(): # put application's code here
return render_template('index.html') return render_template('index.html',getHost=getHost)
@app.route('/vod') @app.route('/vod')
def vod(): def vod():
...@@ -102,9 +103,10 @@ def clear(): ...@@ -102,9 +103,10 @@ def clear():
os.remove(cache_path) os.remove(cache_path)
return jsonify(error.success('成功删除文件:'+cache_path)) return jsonify(error.success('成功删除文件:'+cache_path))
def getRules(): def getRules(path='cache'):
base_path = 'cache/' # 当前文件所在目录 base_path = path+'/' # 当前文件所在目录
print(base_path) # print(base_path)
os.makedirs(base_path,exist_ok=True)
file_name = os.listdir(base_path) file_name = os.listdir(base_path)
file_name = list(filter(lambda x: str(x).endswith('.js'), file_name)) file_name = list(filter(lambda x: str(x).endswith('.js'), file_name))
# print(file_name) # print(file_name)
...@@ -112,6 +114,26 @@ def getRules(): ...@@ -112,6 +114,26 @@ def getRules():
rules = {'list': rule_list, 'count': len(rule_list)} rules = {'list': rule_list, 'count': len(rule_list)}
return rules return rules
def getHost(mode=0):
ip = request.remote_addr
port = request.environ.get('SERVER_PORT')
# mode 为0是本地,1是局域网 2是线上
if mode == 0:
host = f'localhost:{port}'
elif mode == 1:
host = f'{ip}:{port}'
else:
host = 'cms.nokia.press'
return host
@app.route('/favicon.ico') # 设置icon
def favicon():
return app.send_static_file('img/favicon.svg')
# 对于当前文件所在路径,比如这里是static下的favicon.ico
return send_from_directory(os.path.join(app.root_path, 'static'), 'img/favicon.svg', mimetype='image/vnd.microsoft.icon')
@app.route('/rules') @app.route('/rules')
def rules(): def rules():
return render_template('rules.html',rules=getRules()) return render_template('rules.html',rules=getRules())
...@@ -120,6 +142,33 @@ def rules(): ...@@ -120,6 +142,33 @@ def rules():
def rules_raw(): def rules_raw():
return render_template('raw.html',rules=getRules()) return render_template('raw.html',rules=getRules())
@app.route('/config/<int:mode>')
def config_render(mode):
html = render_template('config.txt',rules=getRules('js'),host=getHost(mode),mode=mode)
response = make_response(html)
response.headers['Content-Type'] = 'application/json; charset=utf-8'
return response
@app.route('/configs')
def config_gen():
# 生成文件
set_local = render_template('config.txt',rules=getRules('js'),mode=0,host=getHost(0))
set_area = render_template('config.txt',rules=getRules('js'),mode=1,host=getHost(1))
set_online = render_template('config.txt',rules=getRules('js'),mode=1,host=getHost(2))
with open('pycms0.json','w+',encoding='utf-8') as f:
set_dict = json.loads(set_local)
f.write(json.dumps(set_dict,ensure_ascii=False,indent=4))
with open('pycms1.json','w+',encoding='utf-8') as f:
set_dict = json.loads(set_area)
f.write(json.dumps(set_dict,ensure_ascii=False,indent=4))
with open('pycms2.json','w+',encoding='utf-8') as f:
set_dict = json.loads(set_online)
f.write(json.dumps(set_dict,ensure_ascii=False,indent=4))
files = [os.path.abspath(f'pycms{i}.json') for i in range(3)]
# print(files)
return jsonify(error.success('猫配置生成完毕,文件位置在:\n'+'\n'.join(files)))
@app.route("/plugin/<name>",methods=['GET']) @app.route("/plugin/<name>",methods=['GET'])
def plugin(name): def plugin(name):
# name=道长影视模板.js # name=道长影视模板.js
......
...@@ -5,7 +5,7 @@ var rule = { ...@@ -5,7 +5,7 @@ var rule = {
url:'/t/fyclass/fypage.html', url:'/t/fyclass/fypage.html',
searchUrl:'/s/**/fypage.html', searchUrl:'/s/**/fypage.html',
headers:{ headers:{
'User-Agent':'Mozilla/5.0 (Linux; U; Android 9; zh-CN; MI 9 Build/PKQ1.181121.001) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 UCBrowser/12.5.5.1035 Mobile Safari/537.36' 'User-Agent':'UC_UA'
}, },
timeout:5000, timeout:5000,
class_parse:'.bm-item-list a:gt(0):lt(7);a&&Text;a&&href;/(\\d+).html', class_parse:'.bm-item-list a:gt(0):lt(7);a&&Text;a&&href;/(\\d+).html',
......
...@@ -32,6 +32,8 @@ class CMS: ...@@ -32,6 +32,8 @@ class CMS:
headers[k] = MOBILE_UA headers[k] = MOBILE_UA
elif v == 'PC_UA': elif v == 'PC_UA':
headers[k] = PC_UA headers[k] = PC_UA
elif v == 'UC_UA':
headers[k] = UC_UA
lower_keys = list(map(lambda x:x.lower(),keys)) lower_keys = list(map(lambda x:x.lower(),keys))
if not 'user-agent' in lower_keys: if not 'user-agent' in lower_keys:
headers['User-Agent'] = UA headers['User-Agent'] = UA
...@@ -50,6 +52,9 @@ class CMS: ...@@ -50,6 +52,9 @@ class CMS:
self.class_name = rule.get('class_name','') self.class_name = rule.get('class_name','')
self.class_url = rule.get('class_url','') self.class_url = rule.get('class_url','')
self.class_parse = rule.get('class_parse','') self.class_parse = rule.get('class_parse','')
self.filter_name = rule.get('filter_name', '')
self.filter_url = rule.get('filter_url', '')
self.filter_parse = rule.get('filter_parse', '')
self.double = rule.get('double',False) self.double = rule.get('double',False)
self.一级 = rule.get('一级','') self.一级 = rule.get('一级','')
self.二级 = rule.get('二级','') self.二级 = rule.get('二级','')
......
{
"sites":[
{
"key":"dr_yanaifei",
"name":"鸭奈飞(道长)",
"type":1,
"api":"http://cms.nokia.press/vod?rule=鸭奈飞",
"searchable": 1,
"quickSearch": 1,
"filterable": 1
},
{
"key":"dr_lmys",
"name":"蓝莓影视(道长)",
"type":1,
"api":"http://cms.nokia.press/vod?rule=蓝莓影视",
"searchable": 0,
"quickSearch": 0,
"filterable": 1
},
{
"key":"dr_555",
"name":"555影视(道长)",
"type":1,
"api":"http://cms.nokia.press/vod?rule=555影视",
"searchable": 1,
"quickSearch": 1,
"filterable": 1
},
{
"key":"dr_wojj",
"name":"玩偶姐姐(道长)",
"type":1,
"api":"http://cms.nokia.press/vod?rule=玩偶姐姐",
"searchable": 0,
"quickSearch": 0,
"filterable": 0
},{
"key":"dr_mm",
"name":"喵喵(道长)",
"type":1,
"api":"http://cms.nokia.press/vod?rule=喵喵",
"searchable": 1,
"quickSearch": 1,
"filterable": 1
},{
"key":"dr_ckmv",
"name":"cokemv(道长)",
"type":1,
"api":"http://cms.nokia.press/vod?rule=cokemv&ext=https://gitcode.net/qq_32394351/dr_py/-/raw/master/js/cokemv.js",
"searchable": 1,
"quickSearch": 1,
"filterable": 1
}
],
"parses":[
{"name":"解析聚合","type":3,"url":"Demo"},
{"name":"Json并发","type":2,"url":"Parallel"},
{"name":"Json轮询","type":2,"url":"Sequence"},
{"name":"油果","type":1,"url":"http://json.youguo520.top/fufeng/?url=","ext":{"flag":["qiyi","爱奇艺","奇艺","qq","腾讯","youku","优酷","pptv","PPTV","letv","乐视","bilibili","哔哩哔哩","哔哩","mgtv","芒果"],"header":{"User-Agent":"Dart/2.14 (dart:io)"}}},
{"name":"江湖","type":1,"url":"http://jx.vipmv.co/?url=","ext":{"flag":["qq","qiyi","mgtv","youku","letv","sohu","xigua","cntv","1905"],"header":{"User-Agent":"Dart/2.14 (dart:io)"}}}
],
"flags":["youku","qq","iqiyi","qiyi","letv","sohu","tudou","pptv","mgtv","wasu","bilibili","renrenmi"],
"ijk":[
{"group":"软解码","options":[
{"category":4,"name":"opensles","value":"0"},
{"category":4,"name":"overlay-format","value":"842225234"},
{"category":4,"name":"framedrop","value":"1"},
{"category":4,"name":"soundtouch","value":"1"},
{"category":4,"name":"start-on-prepared","value":"1"},
{"category":1,"name":"http-detect-range-support","value":"0"},
{"category":1,"name":"fflags","value":"fastseek"},
{"category":2,"name":"skip_loop_filter","value":"48"},
{"category":4,"name":"reconnect","value":"1"},
{"category":4,"name":"enable-accurate-seek","value":"0"},
{"category":4,"name":"mediacodec","value":"0"},
{"category":4,"name":"mediacodec-auto-rotate","value":"0"},
{"category":4,"name":"mediacodec-handle-resolution-change","value":"0"},
{"category":4,"name":"mediacodec-hevc","value":"0"},
{"category":1,"name":"dns_cache_timeout","value":"600000000"}
]},
{"group":"硬解码","options":[
{"category":4,"name":"opensles","value":"0"},
{"category":4,"name":"overlay-format","value":"842225234"},
{"category":4,"name":"framedrop","value":"1"},
{"category":4,"name":"soundtouch","value":"1"},
{"category":4,"name":"start-on-prepared","value":"1"},
{"category":1,"name":"http-detect-range-support","value":"0"},
{"category":1,"name":"fflags","value":"fastseek"},
{"category":2,"name":"skip_loop_filter","value":"48"},
{"category":4,"name":"reconnect","value":"1"},
{"category":4,"name":"enable-accurate-seek","value":"0"},
{"category":4,"name":"mediacodec","value":"1"},
{"category":4,"name":"mediacodec-auto-rotate","value":"1"},
{"category":4,"name":"mediacodec-handle-resolution-change","value":"1"},
{"category":4,"name":"mediacodec-hevc","value":"1"},
{"category":1,"name":"dns_cache_timeout","value":"600000000"}
]}
],
"ads":["mimg.0c1q0l.cn","www.googletagmanager.com","www.google-analytics.com","mc.usihnbcq.cn","mg.g1mm3d.cn","mscs.svaeuzh.cn","cnzz.hhttm.top","tp.vinuxhome.com","cnzz.mmstat.com","www.baihuillq.com","s23.cnzz.com","z3.cnzz.com","c.cnzz.com","stj.v1vo.top","z12.cnzz.com","img.mosflower.cn","tips.gamevvip.com","ehwe.yhdtns.com","xdn.cqqc3.com","www.jixunkyy.cn","sp.chemacid.cn","hm.baidu.com","s9.cnzz.com","z6.cnzz.com","um.cavuc.com","mav.mavuz.com","wofwk.aoidf3.com","z5.cnzz.com","xc.hubeijieshikj.cn","tj.tianwenhu.com","xg.gars57.cn","k.jinxiuzhilv.com","cdn.bootcss.com","ppl.xunzhuo123.com","xomk.jiangjunmh.top","img.xunzhuo123.com","z1.cnzz.com","s13.cnzz.com","xg.huataisangao.cn","z7.cnzz.com","xg.huataisangao.cn","z2.cnzz.com","s96.cnzz.com","q11.cnzz.com","thy.dacedsfa.cn","xg.whsbpw.cn","s19.cnzz.com","z8.cnzz.com","s4.cnzz.com","f5w.as12df.top","ae01.alicdn.com","www.92424.cn","k.wudejia.com","vivovip.mmszxc.top","qiu.xixiqiu.com","cdnjs.hnfenxun.com","cms.qdwght.com"]
}
\ No newline at end of file
{
"sites":[
{
"key":"dr_yanaifei",
"name":"鸭奈飞(道长)",
"type":1,
"api":"http://localhost:5705/vod?rule=鸭奈飞",
"searchable": 1,
"quickSearch": 1,
"filterable": 1
},
{
"key":"dr_lmys",
"name":"蓝莓影视(道长)",
"type":1,
"api":"http://localhost:5705/vod?rule=蓝莓影视",
"searchable": 0,
"quickSearch": 0,
"filterable": 1
},
{
"key":"dr_555",
"name":"555影视(道长)",
"type":1,
"api":"http://localhost:5705/vod?rule=555影视",
"searchable": 1,
"quickSearch": 1,
"filterable": 1
},
{
"key":"dr_wojj",
"name":"玩偶姐姐(道长)",
"type":1,
"api":"http://localhost:5705/vod?rule=玩偶姐姐",
"searchable": 0,
"quickSearch": 0,
"filterable": 0
},
{
"key":"dr_mm",
"name":"喵喵(道长)",
"type":1,
"api":"http://localhost:5705/vod?rule=喵喵",
"searchable": 1,
"quickSearch": 1,
"filterable": 1
},{
"key":"dr_ckmv",
"name":"cokemv(道长)",
"type":1,
"api":"http://localhost:5705/vod?rule=cokemv&ext=https://gitcode.net/qq_32394351/dr_py/-/raw/master/js/cokemv.js",
"searchable": 1,
"quickSearch": 1,
"filterable": 1
}
],
"parses":[
{"name":"解析聚合","type":3,"url":"Demo"},
{"name":"Json并发","type":2,"url":"Parallel"},
{"name":"Json轮询","type":2,"url":"Sequence"},
{"name":"油果","type":1,"url":"http://json.youguo520.top/fufeng/?url=","ext":{"flag":["qiyi","爱奇艺","奇艺","qq","腾讯","youku","优酷","pptv","PPTV","letv","乐视","bilibili","哔哩哔哩","哔哩","mgtv","芒果"],"header":{"User-Agent":"Dart/2.14 (dart:io)"}}},
{"name":"江湖","type":1,"url":"http://jx.vipmv.co/?url=","ext":{"flag":["qq","qiyi","mgtv","youku","letv","sohu","xigua","cntv","1905"],"header":{"User-Agent":"Dart/2.14 (dart:io)"}}}
],
"flags":["youku","qq","iqiyi","qiyi","letv","sohu","tudou","pptv","mgtv","wasu","bilibili","renrenmi"],
"ijk":[
{"group":"软解码","options":[
{"category":4,"name":"opensles","value":"0"},
{"category":4,"name":"overlay-format","value":"842225234"},
{"category":4,"name":"framedrop","value":"1"},
{"category":4,"name":"soundtouch","value":"1"},
{"category":4,"name":"start-on-prepared","value":"1"},
{"category":1,"name":"http-detect-range-support","value":"0"},
{"category":1,"name":"fflags","value":"fastseek"},
{"category":2,"name":"skip_loop_filter","value":"48"},
{"category":4,"name":"reconnect","value":"1"},
{"category":4,"name":"enable-accurate-seek","value":"0"},
{"category":4,"name":"mediacodec","value":"0"},
{"category":4,"name":"mediacodec-auto-rotate","value":"0"},
{"category":4,"name":"mediacodec-handle-resolution-change","value":"0"},
{"category":4,"name":"mediacodec-hevc","value":"0"},
{"category":1,"name":"dns_cache_timeout","value":"600000000"}
]},
{"group":"硬解码","options":[
{"category":4,"name":"opensles","value":"0"},
{"category":4,"name":"overlay-format","value":"842225234"},
{"category":4,"name":"framedrop","value":"1"},
{"category":4,"name":"soundtouch","value":"1"},
{"category":4,"name":"start-on-prepared","value":"1"},
{"category":1,"name":"http-detect-range-support","value":"0"},
{"category":1,"name":"fflags","value":"fastseek"},
{"category":2,"name":"skip_loop_filter","value":"48"},
{"category":4,"name":"reconnect","value":"1"},
{"category":4,"name":"enable-accurate-seek","value":"0"},
{"category":4,"name":"mediacodec","value":"1"},
{"category":4,"name":"mediacodec-auto-rotate","value":"1"},
{"category":4,"name":"mediacodec-handle-resolution-change","value":"1"},
{"category":4,"name":"mediacodec-hevc","value":"1"},
{"category":1,"name":"dns_cache_timeout","value":"600000000"}
]}
],
"ads":["mimg.0c1q0l.cn","www.googletagmanager.com","www.google-analytics.com","mc.usihnbcq.cn","mg.g1mm3d.cn","mscs.svaeuzh.cn","cnzz.hhttm.top","tp.vinuxhome.com","cnzz.mmstat.com","www.baihuillq.com","s23.cnzz.com","z3.cnzz.com","c.cnzz.com","stj.v1vo.top","z12.cnzz.com","img.mosflower.cn","tips.gamevvip.com","ehwe.yhdtns.com","xdn.cqqc3.com","www.jixunkyy.cn","sp.chemacid.cn","hm.baidu.com","s9.cnzz.com","z6.cnzz.com","um.cavuc.com","mav.mavuz.com","wofwk.aoidf3.com","z5.cnzz.com","xc.hubeijieshikj.cn","tj.tianwenhu.com","xg.gars57.cn","k.jinxiuzhilv.com","cdn.bootcss.com","ppl.xunzhuo123.com","xomk.jiangjunmh.top","img.xunzhuo123.com","z1.cnzz.com","s13.cnzz.com","xg.huataisangao.cn","z7.cnzz.com","xg.huataisangao.cn","z2.cnzz.com","s96.cnzz.com","q11.cnzz.com","thy.dacedsfa.cn","xg.whsbpw.cn","s19.cnzz.com","z8.cnzz.com","s4.cnzz.com","f5w.as12df.top","ae01.alicdn.com","www.92424.cn","k.wudejia.com","vivovip.mmszxc.top","qiu.xixiqiu.com","cdnjs.hnfenxun.com","cms.qdwght.com"]
}
\ No newline at end of file
#### dr模板的python实现 #### dr模板的python实现
###### 更新日志 ###### 更新日志
2022/08/26 ###### 2022/08/27
- [X] 1.增加PC_UA变量
- [X] 2.首页增加更多功能按钮
- [X] 3.增加猫配置自动生成,分别有本地配置,局域网配置,在线配置
- [ ] 4.引入sqlite3数据进行缓存分类定位到的标签
- [ ] 5.增加filter一键爬取和入库(filter_name,filter_url,filter_parse)
###### 2022/08/26
- [X] 1.支持首页推荐功能,模板属性增加limit参数 - [X] 1.支持首页推荐功能,模板属性增加limit参数
- [X] 2.支持纯一级的功能(比如车车网没二级) - [X] 2.支持纯一级的功能(比如车车网没二级)
- [X] 3.解决配置首页报错和嗅探播放报错问题 - [X] 3.解决配置首页报错和嗅探播放报错问题
...@@ -29,6 +35,8 @@ ...@@ -29,6 +35,8 @@
[远程网站](http://cms.nokia.press/index) [远程网站](http://cms.nokia.press/index)
[本地网站](http://192.168.10.99:5705/index) [本地网站](http://192.168.10.99:5705/index)
[需要安装nodejs](https://registry.npmmirror.com/binary.html?path=node/latest-v14.x/) [需要安装nodejs](https://registry.npmmirror.com/binary.html?path=node/latest-v14.x/)
[本地服务配置地址](http://localhost:5705/config/0)
[远程服务配置地址](http://cms.nokia.press/config/1)
### 配置相关 ### 配置相关
本地地址 clan://localhost/pycms_local.json 本地地址 clan://localhost/pycms_local.json
......
此差异已折叠。
{
"dr_count": {{rules.list|length}},
"mode": {{ mode }},
"sites": [{% for rule in rules.list %}{% if mode == 0 %}
{
"key":"dr_{{ rule }}",
"name":"{{ rule }}(道长)",
"type":1,
"api":"http://{{ host }}/vod?rule={{ rule }}",
"searchable": 1,
"quickSearch": 1,
"filterable": 1
}{% else %}
{
"key":"dr_{{ rule }}",
"name":"{{ rule }}(道长)",
"type":1,
"api":"http://{{ host }}/vod?rule={{ rule }}",
"searchable": 1,
"quickSearch": 1,
"filterable": 1
}{% endif %}{% if loop.last==False %},{% endif %}{% endfor %}],
"parses": [{
"name": "解析聚合",
"type": 3,
"url": "Demo"
}, {
"name": "Json并发",
"type": 2,
"url": "Parallel"
}, {
"name": "Json轮询",
"type": 2,
"url": "Sequence"
}, {
"name": "油果",
"type": 1,
"url": "http://json.youguo520.top/fufeng/?url=",
"ext": {
"flag": ["qiyi", "爱奇艺", "奇艺", "qq", "腾讯", "youku", "优酷", "pptv", "PPTV", "letv", "乐视", "bilibili", "哔哩哔哩", "哔哩", "mgtv", "芒果"],
"header": {
"User-Agent": "Dart/2.14 (dart:io)"
}
}
}, {
"name": "江湖",
"type": 1,
"url": "http://jx.vipmv.co/?url=",
"ext": {
"flag": ["qq", "qiyi", "mgtv", "youku", "letv", "sohu", "xigua", "cntv", "1905"],
"header": {
"User-Agent": "Dart/2.14 (dart:io)"
}
}
}],
"flags": ["youku", "qq", "iqiyi", "qiyi", "letv", "sohu", "tudou", "pptv", "mgtv", "wasu", "bilibili", "renrenmi"],
"ijk": [{
"group": "软解码",
"options": [{
"category": 4,
"name": "opensles",
"value": "0"
}, {
"category": 4,
"name": "overlay-format",
"value": "842225234"
}, {
"category": 4,
"name": "framedrop",
"value": "1"
}, {
"category": 4,
"name": "soundtouch",
"value": "1"
}, {
"category": 4,
"name": "start-on-prepared",
"value": "1"
}, {
"category": 1,
"name": "http-detect-range-support",
"value": "0"
}, {
"category": 1,
"name": "fflags",
"value": "fastseek"
}, {
"category": 2,
"name": "skip_loop_filter",
"value": "48"
}, {
"category": 4,
"name": "reconnect",
"value": "1"
}, {
"category": 4,
"name": "enable-accurate-seek",
"value": "0"
}, {
"category": 4,
"name": "mediacodec",
"value": "0"
}, {
"category": 4,
"name": "mediacodec-auto-rotate",
"value": "0"
}, {
"category": 4,
"name": "mediacodec-handle-resolution-change",
"value": "0"
}, {
"category": 4,
"name": "mediacodec-hevc",
"value": "0"
}, {
"category": 1,
"name": "dns_cache_timeout",
"value": "600000000"
}]
}, {
"group": "硬解码",
"options": [{
"category": 4,
"name": "opensles",
"value": "0"
}, {
"category": 4,
"name": "overlay-format",
"value": "842225234"
}, {
"category": 4,
"name": "framedrop",
"value": "1"
}, {
"category": 4,
"name": "soundtouch",
"value": "1"
}, {
"category": 4,
"name": "start-on-prepared",
"value": "1"
}, {
"category": 1,
"name": "http-detect-range-support",
"value": "0"
}, {
"category": 1,
"name": "fflags",
"value": "fastseek"
}, {
"category": 2,
"name": "skip_loop_filter",
"value": "48"
}, {
"category": 4,
"name": "reconnect",
"value": "1"
}, {
"category": 4,
"name": "enable-accurate-seek",
"value": "0"
}, {
"category": 4,
"name": "mediacodec",
"value": "1"
}, {
"category": 4,
"name": "mediacodec-auto-rotate",
"value": "1"
}, {
"category": 4,
"name": "mediacodec-handle-resolution-change",
"value": "1"
}, {
"category": 4,
"name": "mediacodec-hevc",
"value": "1"
}, {
"category": 1,
"name": "dns_cache_timeout",
"value": "600000000"
}]
}],
"ads": ["mimg.0c1q0l.cn", "www.googletagmanager.com", "www.google-analytics.com", "mc.usihnbcq.cn", "mg.g1mm3d.cn", "mscs.svaeuzh.cn", "cnzz.hhttm.top", "tp.vinuxhome.com", "cnzz.mmstat.com", "www.baihuillq.com", "s23.cnzz.com", "z3.cnzz.com", "c.cnzz.com", "stj.v1vo.top", "z12.cnzz.com", "img.mosflower.cn", "tips.gamevvip.com", "ehwe.yhdtns.com", "xdn.cqqc3.com", "www.jixunkyy.cn", "sp.chemacid.cn", "hm.baidu.com", "s9.cnzz.com", "z6.cnzz.com", "um.cavuc.com", "mav.mavuz.com", "wofwk.aoidf3.com", "z5.cnzz.com", "xc.hubeijieshikj.cn", "tj.tianwenhu.com", "xg.gars57.cn", "k.jinxiuzhilv.com", "cdn.bootcss.com", "ppl.xunzhuo123.com", "xomk.jiangjunmh.top", "img.xunzhuo123.com", "z1.cnzz.com", "s13.cnzz.com", "xg.huataisangao.cn", "z7.cnzz.com", "xg.huataisangao.cn", "z2.cnzz.com", "s96.cnzz.com", "q11.cnzz.com", "thy.dacedsfa.cn", "xg.whsbpw.cn", "s19.cnzz.com", "z8.cnzz.com", "s4.cnzz.com", "f5w.as12df.top", "ae01.alicdn.com", "www.92424.cn", "k.wudejia.com", "vivovip.mmszxc.top", "qiu.xixiqiu.com", "cdnjs.hnfenxun.com", "cms.qdwght.com"]
}
\ No newline at end of file
...@@ -2,11 +2,13 @@ ...@@ -2,11 +2,13 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
<meta http-equiv="Cache-Control" content="no-siteapp;no-transform"> <meta http-equiv="Cache-Control" content="no-siteapp;no-transform">
<meta name="applicable-device" content="pc,mobile"> <meta name="applicable-device" content="pc,mobile">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>dr_py首页</title> <title>dr_py首页</title>
<script src="/static/js/jquery.min.js"></script>
</head> </head>
<style> <style>
.btn{ .btn{
...@@ -23,6 +25,18 @@ ...@@ -23,6 +25,18 @@
} }
</style> </style>
<body> <body>
<script>
$(document).ready(function(){
$("#gen_config").click(function(){
// let rule = this.innerText.trim();
let code = $.ajax({url:"/configs",async:false}).responseText;
code = typeof(code) === "object"?code:JSON.parse(code);
if(code.code === 200){
alert(code.msg);
}
});
});
</script>
<h1>欢迎使用dr_py项目</h1> <h1>欢迎使用dr_py项目</h1>
<p>可以简单的自定义爬虫实现cms数据接口</p> <p>可以简单的自定义爬虫实现cms数据接口</p>
<div class="btn"> <div class="btn">
...@@ -34,5 +48,17 @@ ...@@ -34,5 +48,17 @@
<div class="btn"> <div class="btn">
<a href="/raw">缓存文件列表-查看</a> <a href="/raw">缓存文件列表-查看</a>
</div> </div>
<div class="btn">
<a href="http://{{ getHost(0) }}/config/0">本地配置地址</a>
</div>
<div class="btn">
<a href="http://{{ getHost(1) }}/config/1">局域网配置地址</a>
</div>
<div class="btn">
<a href="http://{{ getHost(2) }}/config/2">远程配置地址</a>
</div>
<div class="btn">
<a href="javascript:void(0);" id="gen_config">生成配置文件</a>
</div>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -2,11 +2,12 @@ ...@@ -2,11 +2,12 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
<meta http-equiv="Cache-Control" content="no-siteapp;no-transform"> <meta http-equiv="Cache-Control" content="no-siteapp;no-transform">
<meta name="applicable-device" content="pc,mobile"> <meta name="applicable-device" content="pc,mobile">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>已缓存规则列表-{{rules.count}}</title> <title>查看已缓存规则列表-{{rules.count}}</title>
<script src="/static/js/jquery.min.js"></script> <script src="/static/js/jquery.min.js"></script>
</head> </head>
<style> <style>
......
...@@ -2,11 +2,12 @@ ...@@ -2,11 +2,12 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
<meta http-equiv="Cache-Control" content="no-siteapp;no-transform"> <meta http-equiv="Cache-Control" content="no-siteapp;no-transform">
<meta name="applicable-device" content="pc,mobile"> <meta name="applicable-device" content="pc,mobile">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>已缓存规则列表-{{rules.count}}</title> <title>删除已缓存规则列表-{{rules.count}}</title>
<script src="/static/js/jquery.min.js"></script> <script src="/static/js/jquery.min.js"></script>
</head> </head>
<style> <style>
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
MOBILE_UA = 'Mozilla/5.0 (Linux; Android 11; M2007J3SC Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045714 Mobile Safari/537.36' MOBILE_UA = 'Mozilla/5.0 (Linux; Android 11; M2007J3SC Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045714 Mobile Safari/537.36'
PC_UA = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36' PC_UA = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36'
UA = 'Mozilla/5.0' UA = 'Mozilla/5.0'
UC_UA = 'Mozilla/5.0 (Linux; U; Android 9; zh-CN; MI 9 Build/PKQ1.181121.001) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 UCBrowser/12.5.5.1035 Mobile Safari/537.36'
headers = { headers = {
'Referer': 'https://www.baidu.com', 'Referer': 'https://www.baidu.com',
'user-agent': UA, 'user-agent': UA,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册