add search and yyets.dmesg.app

This commit is contained in:
BennyThink
2021-01-23 18:46:54 +08:00
parent 85e4c8d5ef
commit 5ba0815e7b
11 changed files with 173 additions and 11 deletions

4
.gitattributes vendored
View File

@@ -2,4 +2,6 @@ worker/public/css/* linguist-vendored
worker/public/fonts/* linguist-vendored
worker/public/img/* linguist-vendored
worker/public/js/* linguist-vendored
worker/public/404.html linguist-vendored
worker/public/404.html linguist-vendored
worker/public/index.html linguist-vendored
worker/public/resource.html linguist-vendored

1
.gitignore vendored
View File

@@ -118,3 +118,4 @@ health_check/client.session
/worker/.idea/
/worker/workers-site/node_modules/*
/worker/workers-site/worker/script.js
/health_check/client-hc.session

View File

@@ -4,6 +4,7 @@
此机器人长期维护,如果遇到问题可以发送报告给我。
# 使用说明
直接发送想要看的剧集名称就可以了可选分享网页或者链接ed2k和磁力链接
@@ -14,6 +15,9 @@
**由于译名的不同,建议输入部分译名,然后从列表中进行选择。比如说想看权力的游戏第四季,那么直接搜索"权力的游戏"就可以了。**
## Cloudflare Worker
[点此访问](https://yyets.dmesg.app/)
# 命令
```

12
worker/public/css/index.json vendored Normal file
View File

@@ -0,0 +1,12 @@
{
"越狱\nPrison Break\n逃": 10004,
"死亡地带\nThe Dead Zone\n": 10010,
"伪装者\nThe Pretender\n": 10017,
"橘子郡男孩\nTHE OC\nThe.O.C / 橘镇风云 /桔子镇": 10022,
"威尔和格蕾丝\nWill and Grace\n威尔与格蕾丝": 10026,
"黑锅\nTraveler\n逃亡之旅": 10052,
"棕榈泉疑云\nHidden Palms\n": 10053,
"降世神通 最后的气宗\nAvatar: The Last Airbender\n": 10054,
"恐怖大师\nMasters Of Horror\n": 10055,
"时间旅人\nJourneyman\n时间旅者": 10057
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 123 KiB

View File

@@ -2,6 +2,8 @@
<html>
<head>
<meta charset="utf-8">
<title>人人影视下载分享</title>
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="https://fonts.googleapis.com/css?family=Pacifico&display=swap" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" rel="stylesheet">
@@ -36,9 +38,13 @@
<h1>人人影视下载分享</h1>
<h1>By Benny</h1>
<br>
<h2>这是我偷过来的,嘿嘿😝</h2>
<h2><a style="text-decoration: none;color: deepskyblue" href="https://t.me/yyets_bot">这个 Telegram Bot</a> 里去使用哦。
</h2>
<h2>这是我偷过来的,嘿嘿😝</h2>
<h2><a style="text-decoration: none;color: deepskyblue" href="https://t.me/yyets_bot">这个 Telegram Bot</a>
里去使用,或者使用下方搜索框</h2>
<form action="search.html">
<input name="kw" type="text">
<input type="submit" value="搜索">
</form>
<h2>有问题联系 <a style="text-decoration: none;color: green" href="https://t.me/BennyThink">Benny小可爱</a></h2>
<img id="ferris" alt="a happy crab is wearing a cowboy hat and holding a lasso. 200 success."
src="img/200-wrangler-ferris.gif">

View File

@@ -194,10 +194,14 @@
<div class="desc">资源分享站 - 归档</div>
</div>
<div class="btn-group" role="group" aria-label="...">
<a id="fa-share" class="btn btn-default btn-copy"><i class="fa fa-share"></i>分享本站地址</a>
<a class="btn btn-danger btn-toggle-view" @click="expanedAll"><i class="fa fa-th-list"></i>切换为平铺视图</a>
</div>
<div class="view-count">
<span class="desc"><i class="fa fa-home"></i><a href="index.html">返回首页</a> </span> &nbsp;
<span class="desc"><i class="fa fa-eye"></i>访问量:</span>
<span class="count">{{ info.views }}</span>
</div>
@@ -295,7 +299,8 @@
<li class="item" :itemid="fileFormatsItem.itemid"
v-for="fileFormatsItem in item.items[fileFormats]">
<div class="title">
<span class="episode">{{ item.season_cn + ' 第' + fileFormatsItem.episode + '集' }}</span><img
<span class="episode">{{ item.season_cn + ' 第' + fileFormatsItem.episode + '集'
}}</span><img
v-if="fileFormatsItem.yyets_trans == 1" src="img/yyetsTrans.png"
class="yyets-translate" alt="人人影视翻译"/>
<ul class="down-links">
@@ -364,7 +369,8 @@
<li class="item" :itemid="fileFormatsItem.itemid"
v-for="fileFormatsItem in item.items[fileFormats]">
<div class="title">
<span class="episode">{{ item.season_cn }} 第{{ fileFormatsItem.episode }}集</span><img
<span class="episode">{{ item.season_cn
}} 第{{ fileFormatsItem.episode }}集</span><img
v-if="fileFormatsItem.yyets_trans == 1" src="img/yyetsTrans.png"
class="yyets-translate" alt="人人影视翻译"/>
<span class="filename">{{ fileFormatsItem.name }}</span>
@@ -654,8 +660,9 @@
getData: function getData() {
var me = this;
let resource_id = document.URL.split("id=")[1]
$.get("/id=" + resource_id, function (json) {
let prod = "/id=" + resource_id;
const dev = "css/data.json"
$.get(prod, function (json) {
// json.data.info.expire < (Date.now()/1000)
if (json.status != 1 || !json.data) {
return location.href = location.origin

126
worker/public/search.html Normal file
View File

@@ -0,0 +1,126 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>人人影视下载分享</title>
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="https://fonts.googleapis.com/css?family=Pacifico&display=swap" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" rel="stylesheet">
<style>
h1 {
font-family: Pacifico, sans-serif;
font-size: 4em;
color: #3eb5f1;
margin: 0;
}
h2 {
font-weight: 300;
font-family: sans-serif;
}
.centered {
/*position: fixed;*/
top: 50%;
left: 50%;
/*transform: translate(-50%, -50%);*/
text-align: center;
}
</style>
</head>
<body>
<div class="centered">
<br>
<h1>人人影视下载分享</h1>
<h1>By Benny</h1>
<br>
<h2>这是我偷过来的,嘿嘿😝</h2>
<h2><a style="text-decoration: none;color: deepskyblue" href="https://t.me/yyets_bot">这个 Telegram Bot</a>
里去使用,或者使用下方搜索框</h2>
<form action="search.html">
<input name="kw" id="kw" type="text">
<input type="submit" value="搜索">
</form>
<hr>
<div id="tv">
</div>
<hr>
<h2>有问题请联系 <a style="text-decoration: none;color: green" href="https://t.me/BennyThink">Benny小可爱</a></h2>
</div>
</body>
<script>
function loadJSON(path, success, error) {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState === XMLHttpRequest.DONE) {
if (xhr.status === 200) {
if (success)
success(JSON.parse(xhr.responseText));
} else {
if (error)
error(xhr);
}
}
};
xhr.open("GET", path, true);
xhr.send();
}
function doSearch() {
let search = document.getElementById("kw");
if (kw !== "undefined") {
search.value = kw;
}
let data = JSON.parse(localStorage.getItem("index"));
let div = document.getElementById("tv");
let found = false
for (let v in data) {
if (v.toLowerCase().indexOf(kw) !== -1) {
found = true
let name = v.replace(/\n/g, " ")
let id = data[v]
let html = `<h3><a style="text-decoration: none;color: cornflowerblue" href="${resourceURL}${id}">${name}</a></h3>`;
let backup = div.innerHTML;
div.innerHTML = backup + html;
}
}
if (found === false) {
div.innerHTML = `<h2>没有搜索到结果 (ノへ ̄、)</h2>`
}
}
const baseURL = "https://yyets.dmesg.app/";
const resourceURL = baseURL + "resource.html?id=";
const indexURL = baseURL + "?id=index";
// const indexURL = "css/index.json"
let kwe = document.URL.split("kw=")[1];
let kw = decodeURI(kwe).toLowerCase().replace(" ", "");
let firstSearch = localStorage.getItem("firstSearch");
let nowTS = Date.parse(Date()).toString();
let has_data = localStorage.getItem("index");
if (has_data === null || firstSearch === null || parseInt(nowTS) - parseInt(firstSearch) > 3600 * 24 * 1000 * 7) {
localStorage.setItem("firstSearch", nowTS);
loadJSON(indexURL,
function (data) {
let jsonText = JSON.stringify(data);
localStorage.setItem("index", jsonText);
doSearch()
},
function (xhr) {
console.error(xhr);
});
} else {
doSearch()
}
</script>
</html>

View File

@@ -36,7 +36,10 @@ async function handleEvent(event) {
}
return new Response(value, {
headers: {"content-type": "application/json;charset=UTF-8"},
headers: {
"content-type": "application/json;charset=UTF-8",
"Access-Control-Allow-Origin": "https://yyets.dmesg.app"
},
})
}

View File

@@ -39,7 +39,8 @@ def send_welcome(message):
bot.send_message(message.chat.id, '欢迎使用,直接发送想要的剧集标题给我就可以了,不需要其他关键字,我会帮你搜索。\n\n'
'人人影视专注于欧美日韩剧集,请不要反馈“我搜不到喜羊羊与灰太狼/流浪地球”这种问题,'
'我会生气的😠😡🤬😒\n\n'
f'目前搜索优先级 {FANSUB_ORDER}',
f'目前搜索优先级 {FANSUB_ORDER}'
f'另外,可以尝试使用一下 https://yyets.dmesg.app/ 哦!',
parse_mode='html', disable_web_page_preview=True)

View File

@@ -21,7 +21,7 @@ SHARE_API = "http://got002.com/api/v1/static/resource/detail?code={code}"
FIX_RESOURCE = "https://www.zimuxia.cn/portfolio/{name}"
FIX_SEARCH = "https://www.zimuxia.cn/?s={kw}"
# cloudflare worker
WORKERS = "https://yyets.yyetsdb.workers.dev/resource.html?id={id}"
WORKERS = "https://yyets.dmesg.app/resource.html?id={id}"
# authentication config
TOKEN = os.environ.get("TOKEN") or "TOKEN"