提交 87e9cbb5 编写于 作者: H hjdhnx

支持alist

上级 abcbe303
......@@ -535,9 +535,10 @@ def config_render(mode):
new_conf = dict(app.config)
host = getHost(mode)
jxs = getJxs()
alists = getAlist()
live_url = get_live_url(new_conf,mode)
# html = render_template('config.txt',rules=getRules('js'),host=host,mode=mode,jxs=jxs,base64Encode=base64Encode,config=new_conf)
html = render_template('config.txt',rules=getRules('js'),host=host,mode=mode,jxs=jxs,live_url=live_url,config=new_conf)
html = render_template('config.txt',rules=getRules('js'),host=host,mode=mode,jxs=jxs,alists=alists,live_url=live_url,config=new_conf)
response = make_response(html)
response.headers['Content-Type'] = 'application/json; charset=utf-8'
return response
......@@ -576,10 +577,11 @@ def config_gen():
os.makedirs('txt',exist_ok=True)
new_conf = dict(app.config)
jxs = getJxs()
set_local = render_template('config.txt',rules=getRules('js'),live_url=get_live_url(new_conf,0),mode=0,host=getHost(0),jxs=jxs)
alists = getAlist()
set_local = render_template('config.txt',rules=getRules('js'),alists=alists,live_url=get_live_url(new_conf,0),mode=0,host=getHost(0),jxs=jxs)
print(set_local)
set_area = render_template('config.txt',rules=getRules('js'),live_url=get_live_url(new_conf,1),mode=1,host=getHost(1),jxs=jxs)
set_online = render_template('config.txt',rules=getRules('js'),live_url=get_live_url(new_conf,2),mode=1,host=getHost(2),jxs=jxs)
set_area = render_template('config.txt',rules=getRules('js'),alists=alists,live_url=get_live_url(new_conf,1),mode=1,host=getHost(1),jxs=jxs)
set_online = render_template('config.txt',rules=getRules('js'),alists=alists,live_url=get_live_url(new_conf,2),mode=1,host=getHost(2),jxs=jxs)
with open('txt/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))
......
# c=[];for(let i in a){c.push(i+','+a[i])}d=c.join('\n');console.log(d);
🔮嗨翻,https://pan.hikerfans.com
🦀9T(Adult),https://drive.9t.ee
🐱梓澪の妙妙屋,https://xn--i0v44m.xyz
🚆资源小站,https://pan.142856.xyz
🌤晴园的宝藏库,https://alist.52qy.repl.co
🐭米奇妙妙屋,https://anime.mqmmw.ga
💂小兵组网盘影视,https://6vv.app
📀小光盘,https://alist.xiaoguanxiaocheng.life
🐋一只鱼,https://alist.youte.ml
🌊七米蓝,https://al.chirmyram.com
🌴非盘,http://www.feifwp.top
🥼帅盘,https://hi.shuaipeng.wang
🐉神族九帝,https://alist.shenzjd.com
☃姬路白雪,https://pan.jlbx.xyz
🎧听闻网盘,https://wangpan.sangxuesheng.com
💾DISK,http://124.222.140.243:8080
🌨云播放,https://quanzi.laoxianghuijia.cn
✨星梦,https://pan.bashroot.top
🌊小江,https://dyj.me
💫触光,https://pan.ichuguang.com
🕵好汉吧,https://8023.haohanba.cn
🥗AUNEY,http://121.227.25.116:8008
🎡资源小站,https://960303.xyz/
🏝fenwe,http://www.fenwe.tk:5244
🎢轻弹浅唱,https://g.xiang.lol
\ No newline at end of file
{
"🔮嗨翻":"https://pan.hikerfans.com",
"🦀9T(Adult)":"https://drive.9t.ee",
"🐱梓澪の妙妙屋":"https://xn--i0v44m.xyz",
"🚆资源小站":"https://pan.142856.xyz",
"🌤晴园的宝藏库":"https://alist.52qy.repl.co",
"🐭米奇妙妙屋":"https://anime.mqmmw.ga",
"💂小兵组网盘影视":"https://6vv.app",
"📀小光盘":"https://alist.xiaoguanxiaocheng.life",
"🐋一只鱼":"https://alist.youte.ml",
"🌊七米蓝":"https://al.chirmyram.com",
"🌴非盘":"http://www.feifwp.top",
"🥼帅盘":"https://hi.shuaipeng.wang",
"🐉神族九帝":"https://alist.shenzjd.com",
"☃姬路白雪":"https://pan.jlbx.xyz",
"🎧听闻网盘":"https://wangpan.sangxuesheng.com",
"💾DISK":"http://124.222.140.243:8080",
"🌨云播放":"https://quanzi.laoxianghuijia.cn",
"✨星梦":"https://pan.bashroot.top",
"🌊小江":"https://dyj.me",
"💫触光":"https://pan.ichuguang.com",
"🕵好汉吧":"https://8023.haohanba.cn",
"🥗AUNEY":"http://121.227.25.116:8008",
"🎡资源小站":"https://960303.xyz/",
"🏝fenwe":"http://www.fenwe.tk:5244",
"🎢轻弹浅唱":"https://g.xiang.lol"
}
3.1.6
\ No newline at end of file
3.1.7
\ No newline at end of file
......@@ -51,6 +51,7 @@
- [X] 2.增加了后台管理界面修改直播源地址和同步直播源
- [X] 3.首页推荐内容不限制数量(新版pluto牛逼!!!)
- [X] 4.增加lsg配置模型和缓存
- [X] 5.增加了默认alist挂载
###### 2022/09/05
- [X] 1.内置jar修复了原本tv_box无法播放直播的问题
- [X] 2.重新构建了三种平台的镜像 amd64,armv7,arm64
......
......@@ -3,6 +3,7 @@
"dr_count": {{rules.list|length}},
"mode": {{ mode }},
"spider": "{{ host }}/liveslib",
{% if alists|length > 0 %}"drives": {{alists}},{% endif %}
"homepage":"https://gitcode.net/qq_32394351/dr_py",
"sites": [{% for rule in rules.list %}{% if mode == 0 %}
{
......
......@@ -3,7 +3,7 @@
# File : web.py
# Author: DaShenHan&道长-----先苦后甜,任凭晚风拂柳颜------
# Date : 2022/8/25
import os
import socket
import hashlib
from werkzeug.utils import import_string
......@@ -115,4 +115,27 @@ def getHeaders(url):
headers.setdefault("User-Agent", PC_UA)
headers.setdefault("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9")
headers.setdefault("Accept-Language", "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2")
return headers
\ No newline at end of file
return headers
def getAlist():
base_path = os.path.dirname(os.path.abspath(os.path.dirname(__file__))) # 上级目录
alist_path = os.path.join(base_path, 'js/alist.conf')
with open(alist_path,encoding='utf-8') as f:
data = f.read().strip()
alists = []
for i in data.split('\n'):
i = i.strip()
dt = i.split(',')
if not i.strip().startswith('#'):
obj = {
'name': dt[0],
'server': dt[1],
'type':"alist",
}
if len(dt) > 2:
obj.update({
'password': dt[2]
})
alists.append(obj)
print(f'共计{len(alists)}条alist记录')
return alists
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册