提交 d6fb43eb 编写于 作者: H hjdhnx

大版本升级

上级 84fe26b2
js:let html=JSON.parse(fetch(input,fetch_params));let data=html.data;let tilte=data.title;let img=data.cdncover;let vod_type=data.moviecategory.join(",");let area=data.area.join(",");let director=data.director.join(",");let actor=data.actor.join(",");let content=data.description;base_vod={vod_id:input,vod_name:tilte,type_name:vod_type,vod_actor:actor,vod_director:director,vod_content:content,vod_remarks:area,vod_pic:urljoin2(input,img)};let delta=200;let vod_play={};let sites=data.playlink_sites;for(let i in sites){let site=sites[i];let playList="";let vodItems=[];if(data.allupinfo){let total=parseInt(data.allupinfo[site]);for(let j=1;j<total;j+=delta){let end=Math.min(total,j+delta-1);let url2=buildUrl(input,{start:j,end:end,site:site});let vod_data=JSON.parse(fetch(url2),fetch_params).data;if(vod_data.allepidetail){vod_data=vod_data.allepidetail[site];vod_data.forEach(function(item,index){vodItems.push((item.playlink_num||"")+"$"+(item.url||""))})}else{vod_data=vod_data.defaultepisode;vod_data.forEach(function(item,index){vodItems.push((item.period||"")+(item.name||"")+"$"+item.url||"")})}}}else{let item=data.playlinksdetail[site];vodItems.push((item.sort||"")+"$"+(item.default_url||""))}if(vodItems.length>0){playList=vodItems.join("#")}if(playList.length<1){continue}vod_play[site]=playList}let tabs=Object.keys(vod_play);let playUrls=[];for(let id in tabs){playUrls.push(vod_play[tabs[id]])}if(tabs.length>0){vod_play_from=tabs.join("$$$");vod_play_url=playUrls.join("$$$");base_vod.vod_play_from=vod_play_from;base_vod.vod_play_url=vod_play_url}vod=base_vod;
\ No newline at end of file
js:cacheUrl=getParse(input);if(cacheUrl){input=cacheUrl}else{try{let html=fetch(input,fetch_params);let ret=html.match(/var player_(.*?)=(.*?)</)[2];let url=JSON.parse(ret).url;if(url.length>10){real_url="https://player.buyaotou.xyz/?url="+url;saveParse(input,real_url);input=real_url}}catch(e){print("网络请求发生错误:"+e.message)}}
\ No newline at end of file
js:var MY_HOME="http://lanmeiguojiang.com:5244/d/%E8%93%9D%E8%8E%93%E4%BA%91%E7%9B%98";print(fetch_params);let html=fetch(input,fetch_params);var player=JSON.parse(html.match(/r player_.*?=(.*?)</)[1]);var jsurl=player.url;var from=player.from;if(player.encrypt=="1"){var jsurl=unescape(jsurl)}else if(player.encrypt=="2"){var jsurl=unescape(base64Decode(jsurl))}else{jsurl}if(/ddzy|duoduo/.test(from)){let mx=false;if(mx){let html=request(MY_HOME+"/pzwj.js");eval(html);var jx=MacPlayerConfig.player_list[from].parse;print("第1次多多解析:",jx);eval(fetch(jx+jsurl,fetch_params).match(/var config = {[\s\S]*?}/)[0]);jx=jx.replace("?url=","");eval(fetch(jx+"js/decode.js",fetch_params));jxk=fetch(jx+"js/setting.js",fetch_params).split(",");jx+="555tZ4pvzHE3BpiO838.php";print("第2次多多解析:",jx);config.tm=(new Date).getTime();config.sign="F4penExTGogdt6U8";input=getVideoInfo(JSON.parse(fetch(buildUrl(jx,config),fetch_params)).url)}}else{let jxurl="https://lanmeiguojiang.com/dd/?url="+jsurl;input=maoss(jxurl,jxurl,"A42EAC0C2B408472")}
\ No newline at end of file
......@@ -41,7 +41,7 @@
$(".cls").click(function(){
let cls = this.innerText.trim();
if(confirm('确认清除规则'+cls+'缓存的分类?')){
let code = $.ajax({url:"/clearcls/"+cls,async:false}).responseText;
let code = $.ajax({url:"/cls/clear/"+cls,async:false}).responseText;
code = typeof(code) === "object"?code:JSON.parse(code);
if(code.code === 200){
alert('操作成功!\n'+code.msg);
......@@ -54,7 +54,7 @@
});
</script>
<h1>缓存规则列表</h1>
<h1>缓存规则列表-{{rules.count}}</h1>
{% if rules.count < 1 %}
<h3>暂无已缓存的规则</h3>
{% endif %}
......@@ -79,7 +79,7 @@
{% endfor %}
<h1>缓存分类列表</h1>
<h1>缓存分类列表-{{classes|length}}</h1>
{% if classes|length < 1 %}
<h3>暂无已缓存的分类</h3>
{% endif %}
......
......@@ -35,12 +35,12 @@
$(".cls").click(function(){
// location.reload();
let cls = this.innerText.trim();
location.href = '/cls/'+cls;
location.href = '/cls/get/'+cls;
});
});
</script>
<h1>缓存规则列表</h1>
<h1>缓存规则列表-{{rules.count}}</h1>
{% if rules.count < 1 %}
<h3>暂无已缓存的规则</h3>
{% endif %}
......@@ -64,7 +64,7 @@
<!-- if条件必须有endif,否则会报错 -->
{% endfor %}
<h1>缓存分类列表</h1>
<h1>缓存分类列表-{{ classes|length }}</h1>
{% if classes|length < 1 %}
<h3>暂无已缓存的分类</h3>
{% endif %}
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# File : files.py
# Author: DaShenHan&道长-----先苦后甜,任凭晚风拂柳颜------
# Date : 2022/9/6
import os
from utils.system import getHost
from utils.encode import base64Encode
from controllers.service import storage_service
def getPics(path='images'):
base_path = os.path.dirname(os.path.abspath(os.path.dirname(__file__))) # 上级目录
img_path = os.path.join(base_path, f'{path}')
os.makedirs(img_path,exist_ok=True)
file_name = os.listdir(img_path)
# file_name = list(filter(lambda x: str(x).endswith('.js') and str(x).find('模板') < 0, file_name))
# print(file_name)
pic_list = [base_path+file for file in file_name]
# pic_list = file_name
# print(type(pic_list))
return pic_list
def get_live_url(new_conf,mode):
host = getHost(mode)
lsg = storage_service()
# t1 = time()
live_url = host + '/lives' if new_conf.get('LIVE_MODE',1) == 0 else lsg.getItem('LIVE_URL',getHost(2)+'/lives')
live_url = base64Encode(live_url)
# print(f'{get_interval(t1)}毫秒')
return live_url
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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# File : system.py
# Author: DaShenHan&道长-----先苦后甜,任凭晚风拂柳颜------
# Date : 2022/9/6
from werkzeug.utils import import_string
from base import config
from flask import request
import psutil
import sys
from easydict import EasyDict as edict
def get_conf(obj):
new_conf = {}
if isinstance(obj, str):
obj = import_string(obj)
for key in dir(obj):
if key.isupper():
new_conf[key] = getattr(obj, key)
return new_conf
cfg = edict(get_conf(config))
def get_wlan_info():
info = psutil.net_if_addrs()
# print(info)
netcard_info = []
ips = []
for k, v in info.items():
for item in v:
if item[0] == 2:
netcard_info.append((k, item[1]))
ips.append(item[1])
return netcard_info,ips
def get_host_ip(): # 获取局域网ip
netcard_info,ips = get_wlan_info()
# print(netcard_info)
real_ips = list(filter(lambda x: x and x != '127.0.0.1', ips))
jyw = list(filter(lambda x: str(x).startswith('192.168'), real_ips))
return real_ips[-1] if len(jyw) < 1 else jyw[0]
def getHost(mode=0,port=None):
port = port or request.environ.get('SERVER_PORT')
# mode 为0是本地,1是局域网 2是线上
if mode == 0:
host = f'http://localhost:{port}'
elif mode == 1:
REAL_IP = get_host_ip()
ip = REAL_IP
host = f'http://{ip}:{port}'
else:
host = cfg.get('PLAY_URL','http://cms.nokia.press')
return host
def is_linux():
return not 'win' in sys.platform
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册