mirror of
https://github.com/tgbot-collection/YYeTsBot.git
synced 2025-11-25 03:15:05 +08:00
basic complete
This commit is contained in:
41
web/404.html
Normal file
41
web/404.html
Normal file
@@ -0,0 +1,41 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<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="/css/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;
|
||||
}
|
||||
|
||||
#ferris {
|
||||
width: 75%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="centered">
|
||||
<h1>404 Not Found</h1>
|
||||
<h2>Oh dang! We couldn't find that page.</h2>
|
||||
<img id="ferris" alt="a sad crab is unable to unable to lasso a paper airplane. 404 not found."
|
||||
src="img/404-wrangler-ferris.gif">
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
62
web/convert_db.py
Normal file
62
web/convert_db.py
Normal file
@@ -0,0 +1,62 @@
|
||||
#!/usr/local/bin/python3
|
||||
# coding: utf-8
|
||||
|
||||
# BagAndDrag - convert_db.py
|
||||
# 1/12/21 18:24
|
||||
#
|
||||
|
||||
__author__ = "Benny <benny.think@gmail.com>"
|
||||
|
||||
# convert to mongodb and con_sqlite
|
||||
|
||||
import pymongo
|
||||
import pymysql
|
||||
import json
|
||||
|
||||
from typing import List
|
||||
|
||||
con_mysql = pymysql.Connect(host="127.0.0.1", user="root", password="root", charset="utf8mb4", database="yyets",
|
||||
cursorclass=pymysql.cursors.DictCursor
|
||||
)
|
||||
|
||||
mongo_client = pymongo.MongoClient()
|
||||
|
||||
SIZE = 2000
|
||||
|
||||
|
||||
def clear_mongodb():
|
||||
mongo_client.drop_database("zimuzu")
|
||||
|
||||
|
||||
def mongodb_insert(data: List[dict]):
|
||||
db = mongo_client["zimuzu"]
|
||||
col = db["yyets"]
|
||||
# deserialize data.data
|
||||
inserted = []
|
||||
for i in data:
|
||||
api = json.loads(i["data"])
|
||||
views = api["data"]["info"]["views"]
|
||||
api["data"]["info"]["views"] = int(views)
|
||||
inserted.append(api)
|
||||
col.insert_many(inserted)
|
||||
|
||||
|
||||
def main():
|
||||
clear_mongodb()
|
||||
|
||||
mysql_cur = con_mysql.cursor()
|
||||
|
||||
mysql_cur.execute("SELECT * FROM resource")
|
||||
|
||||
while True:
|
||||
data = mysql_cur.fetchmany(SIZE)
|
||||
if data:
|
||||
mongodb_insert(data)
|
||||
else:
|
||||
break
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
con_mysql.close()
|
||||
mongo_client.close()
|
||||
3340
web/css/3rd/animate.css
vendored
Normal file
3340
web/css/3rd/animate.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3
web/css/3rd/icons.css
Normal file
3
web/css/3rd/icons.css
Normal file
@@ -0,0 +1,3 @@
|
||||
@charset "utf-8";
|
||||
@IMPORT url("../font-awesome.min.css");
|
||||
|
||||
3
web/css/3rd/widgets.css
Normal file
3
web/css/3rd/widgets.css
Normal file
@@ -0,0 +1,3 @@
|
||||
@charset "utf-8";
|
||||
|
||||
|
||||
9
web/css/aYin.css
Normal file
9
web/css/aYin.css
Normal file
@@ -0,0 +1,9 @@
|
||||
@charset "utf-8";
|
||||
|
||||
/*webkit核心浏览器滚动条设置*/
|
||||
/*
|
||||
::-webkit-scrollbar{width: 10px;height:10px;}
|
||||
::-webkit-scrollbar-track{border-radius: 0px;background: rgba(0,0,0,0.1);}
|
||||
::-webkit-scrollbar-thumb{border-radius: 5px;background: rgba(0,0,0,0.2);}
|
||||
::-webkit-scrollbar-thumb:hover{border-radius: 5px;background: rgba(0,0,0,0.4);}
|
||||
*/
|
||||
5
web/css/bootstrap.min.css
vendored
Normal file
5
web/css/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
184
web/css/data.json
Normal file
184
web/css/data.json
Normal file
@@ -0,0 +1,184 @@
|
||||
{
|
||||
"status": 1,
|
||||
"info": "OK",
|
||||
"data": {
|
||||
"info": {
|
||||
"id": 10060,
|
||||
"cnname": "铁皮人",
|
||||
"enname": "Tin Man",
|
||||
"aliasname": "",
|
||||
"channel": "tv",
|
||||
"channel_cn": "美剧",
|
||||
"area": "美国",
|
||||
"show_type": "",
|
||||
"expire": "1610371223",
|
||||
"views": "0"
|
||||
},
|
||||
"list": [
|
||||
{
|
||||
"season_num": "102",
|
||||
"season_cn": "MINI剧",
|
||||
"items": {
|
||||
"APP": [
|
||||
{
|
||||
"itemid": "323953",
|
||||
"episode": "3",
|
||||
"name": "yyets://N=铁皮人.Tin.Man.Part3.中英字幕.BD.720p-人人影视.mp4|S=1327396629|H=1dd3a8b0ab765f4fd77f62e15b6635b932f5f9f7|",
|
||||
"size": "",
|
||||
"yyets_trans": 0,
|
||||
"dateline": "1493450710",
|
||||
"files": [
|
||||
{
|
||||
"way": "102",
|
||||
"way_cn": "百度云",
|
||||
"address": "https://pan.baidu.com/s/1rbm_tYCCWWj-Mn7GBwCP_g",
|
||||
"passwd": ""
|
||||
},
|
||||
{
|
||||
"way": "115",
|
||||
"way_cn": "微云",
|
||||
"address": "http://url.cn/5ZsPVGj",
|
||||
"passwd": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"itemid": "323952",
|
||||
"episode": "2",
|
||||
"name": "yyets://N=铁皮人.Tin.Man.Part2.中英字幕.BD.720p-人人影视.mp4|S=1315079304|H=68edc943d6d9c67b0727c79e9b8531170559d459|",
|
||||
"size": "",
|
||||
"yyets_trans": 0,
|
||||
"dateline": "1493450699",
|
||||
"files": [
|
||||
{
|
||||
"way": "102",
|
||||
"way_cn": "百度云",
|
||||
"address": "https://pan.baidu.com/s/1rbm_tYCCWWj-Mn7GBwCP_g",
|
||||
"passwd": ""
|
||||
},
|
||||
{
|
||||
"way": "115",
|
||||
"way_cn": "微云",
|
||||
"address": "http://url.cn/5ZsPVGj",
|
||||
"passwd": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"itemid": "323951",
|
||||
"episode": "1",
|
||||
"name": "yyets://N=铁皮人.Tin.Man.Part1.中英字幕.BD.720p-人人影视.mp4|S=1372733541|H=657ad3f2efd48057f5bea2e0ab111d9f429a785c|",
|
||||
"size": "",
|
||||
"yyets_trans": 0,
|
||||
"dateline": "1493450684",
|
||||
"files": [
|
||||
{
|
||||
"way": "102",
|
||||
"way_cn": "百度云",
|
||||
"address": "https://pan.baidu.com/s/1rbm_tYCCWWj-Mn7GBwCP_g",
|
||||
"passwd": ""
|
||||
},
|
||||
{
|
||||
"way": "115",
|
||||
"way_cn": "微云",
|
||||
"address": "http://url.cn/5ZsPVGj",
|
||||
"passwd": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"MP4": [
|
||||
{
|
||||
"itemid": "429977",
|
||||
"episode": "3",
|
||||
"name": "铁皮人.Tin.Man.Part3.中英字幕.BD.720p-人人影视.mp4",
|
||||
"size": "1.24GB",
|
||||
"yyets_trans": 0,
|
||||
"dateline": "1566559500",
|
||||
"files": [
|
||||
{
|
||||
"way": "1",
|
||||
"way_cn": "电驴",
|
||||
"address": "ed2k://|file|%E9%93%81%E7%9A%AE%E4%BA%BA.Tin.Man.Part3.%E4%B8%AD%E8%8B%B1%E5%AD%97%E5%B9%95.BD.720p-%E4%BA%BA%E4%BA%BA%E5%BD%B1%E8%A7%86.mp4|1327396629|23b315a8d9e4a3f711494ccae4fc766e|h=mccx743p3l67dy7fqsrrqfhu4i6q3ohs|/",
|
||||
"passwd": ""
|
||||
},
|
||||
{
|
||||
"way": "2",
|
||||
"way_cn": "磁力",
|
||||
"address": "magnet:?xt=urn:btih:fd23ad303b7121f91f56ecfd09faf0595a83c63e&tr=udp://9.rarbg.to:2710/announce&tr=udp://9.rarbg.me:2710/announce&tr=http://tr.cili001.com:8070/announce&tr=http://tracker.trackerfix.com:80/announce&tr=udp://open.demonii.com:1337&tr=udp://tracker.opentrackr.org:1337/announce&tr=udp://p4p.arenabg.com:1337&tr=wss://tracker.openwebtorrent.com&tr=wss://tracker.btorrent.xyz&tr=wss://tracker.fastcast.nz",
|
||||
"passwd": ""
|
||||
},
|
||||
{
|
||||
"way": "12",
|
||||
"way_cn": "诚通网盘",
|
||||
"address": "https://ZiMuZuUSTV.ctfile.com/fs/1939455-394367733",
|
||||
"passwd": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"itemid": "429976",
|
||||
"episode": "2",
|
||||
"name": "铁皮人.Tin.Man.Part2.中英字幕.BD.720p-人人影视.mp4",
|
||||
"size": "1.22GB",
|
||||
"yyets_trans": 0,
|
||||
"dateline": "1566559500",
|
||||
"files": [
|
||||
{
|
||||
"way": "1",
|
||||
"way_cn": "电驴",
|
||||
"address": "ed2k://|file|%E9%93%81%E7%9A%AE%E4%BA%BA.Tin.Man.Part2.%E4%B8%AD%E8%8B%B1%E5%AD%97%E5%B9%95.BD.720p-%E4%BA%BA%E4%BA%BA%E5%BD%B1%E8%A7%86.mp4|1315079304|7c602e1f24fd9f1fa65924eee0c4fd7d|h=mzg633nkorz7kmq53z2ecccnkchdle4m|/",
|
||||
"passwd": ""
|
||||
},
|
||||
{
|
||||
"way": "2",
|
||||
"way_cn": "磁力",
|
||||
"address": "magnet:?xt=urn:btih:a40429e64c8e1a300f502045ddda8c74d45bd6a0&tr=udp://9.rarbg.to:2710/announce&tr=udp://9.rarbg.me:2710/announce&tr=http://tr.cili001.com:8070/announce&tr=http://tracker.trackerfix.com:80/announce&tr=udp://open.demonii.com:1337&tr=udp://tracker.opentrackr.org:1337/announce&tr=udp://p4p.arenabg.com:1337&tr=wss://tracker.openwebtorrent.com&tr=wss://tracker.btorrent.xyz&tr=wss://tracker.fastcast.nz",
|
||||
"passwd": ""
|
||||
},
|
||||
{
|
||||
"way": "12",
|
||||
"way_cn": "诚通网盘",
|
||||
"address": "https://ZiMuZuUSTV.ctfile.com/fs/1939455-394335534",
|
||||
"passwd": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"itemid": "429975",
|
||||
"episode": "1",
|
||||
"name": "铁皮人.Tin.Man.Part1.中英字幕.BD.720p-人人影视.mp4",
|
||||
"size": "1.28GB",
|
||||
"yyets_trans": 0,
|
||||
"dateline": "1566559500",
|
||||
"files": [
|
||||
{
|
||||
"way": "1",
|
||||
"way_cn": "电驴",
|
||||
"address": "ed2k://|file|%E9%93%81%E7%9A%AE%E4%BA%BA.Tin.Man.Part1.%E4%B8%AD%E8%8B%B1%E5%AD%97%E5%B9%95.BD.720p-%E4%BA%BA%E4%BA%BA%E5%BD%B1%E8%A7%86.mp4|1372733541|58587c085040239c982ab8d7ff485515|h=nbd6y4jgdnwmh6ezarm2cfxiy5aw3qtp|/",
|
||||
"passwd": ""
|
||||
},
|
||||
{
|
||||
"way": "2",
|
||||
"way_cn": "磁力",
|
||||
"address": "magnet:?xt=urn:btih:f2798104a57a380c0db44940ed180fad16930ede&tr=udp://9.rarbg.to:2710/announce&tr=udp://9.rarbg.me:2710/announce&tr=http://tr.cili001.com:8070/announce&tr=http://tracker.trackerfix.com:80/announce&tr=udp://open.demonii.com:1337&tr=udp://tracker.opentrackr.org:1337/announce&tr=udp://p4p.arenabg.com:1337&tr=wss://tracker.openwebtorrent.com&tr=wss://tracker.btorrent.xyz&tr=wss://tracker.fastcast.nz",
|
||||
"passwd": ""
|
||||
},
|
||||
{
|
||||
"way": "12",
|
||||
"way_cn": "诚通网盘",
|
||||
"address": "https://ZiMuZuUSTV.ctfile.com/fs/1939455-394335532",
|
||||
"passwd": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"formats": [
|
||||
"APP",
|
||||
"MP4"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
9686
web/css/down-list-20180530.css
Normal file
9686
web/css/down-list-20180530.css
Normal file
File diff suppressed because it is too large
Load Diff
4
web/css/font-awesome.min.css
vendored
Normal file
4
web/css/font-awesome.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
12
web/css/index.json
Normal file
12
web/css/index.json
Normal 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
|
||||
}
|
||||
1267
web/css/jquery.mCustomScrollbar.css
Normal file
1267
web/css/jquery.mCustomScrollbar.css
Normal file
File diff suppressed because it is too large
Load Diff
2
web/css/normalize.min.css
vendored
Normal file
2
web/css/normalize.min.css
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}
|
||||
/*# sourceMappingURL=normalize.min.css.map */
|
||||
BIN
web/favicon.ico
Normal file
BIN
web/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 123 KiB |
BIN
web/fonts/fontawesome-webfont.woff2
Normal file
BIN
web/fonts/fontawesome-webfont.woff2
Normal file
Binary file not shown.
1
web/fonts/test.txt
Normal file
1
web/fonts/test.txt
Normal file
@@ -0,0 +1 @@
|
||||
1234
|
||||
BIN
web/img/11bcd4d0f2daf8b02fecc72bc8ca38ab.png
Normal file
BIN
web/img/11bcd4d0f2daf8b02fecc72bc8ca38ab.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
BIN
web/img/200-wrangler-ferris.gif
Normal file
BIN
web/img/200-wrangler-ferris.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 44 KiB |
BIN
web/img/404-wrangler-ferris.gif
Normal file
BIN
web/img/404-wrangler-ferris.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
BIN
web/img/grid16.png
Normal file
BIN
web/img/grid16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
BIN
web/img/yyetsTrans.png
Normal file
BIN
web/img/yyetsTrans.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
55
web/index.html
Normal file
55
web/index.html
Normal file
@@ -0,0 +1,55 @@
|
||||
<!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="/css/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;
|
||||
}
|
||||
|
||||
#ferris {
|
||||
width: 75%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="centered">
|
||||
<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">
|
||||
<label>
|
||||
<input name="kw" type="text">
|
||||
</label>
|
||||
<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">
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
476
web/js/aYin.js
Normal file
476
web/js/aYin.js
Normal file
@@ -0,0 +1,476 @@
|
||||
/*!
|
||||
* copyright 2017 aYin's Lib
|
||||
* ayin86@163.com yinzhijun@dhcc.com.cn
|
||||
* only for authorized use.
|
||||
* contain open source project:"jquery-Browser,jquery cookie"
|
||||
*/
|
||||
|
||||
(function($){
|
||||
$.AllInOne = function(options,callback){
|
||||
var settings={
|
||||
//from:src,
|
||||
//obj:obj,
|
||||
//to:continer,
|
||||
//onload:function(){alert(1)}
|
||||
}
|
||||
var opts=$.extend(settings,options);
|
||||
if($("body").find(".iframe-wrap").size()==0){
|
||||
$("body").append("<div class='iframe-wrap'/>");
|
||||
}
|
||||
var ifw=$("body").find(".iframe-wrap");
|
||||
var objclass=opts.obj.split(",")[0].replace(".","");
|
||||
if($(".iframe-"+objclass).size()==0){
|
||||
ifw.append("<iframe class=iframe-"+objclass+" src="+opts.from+" />");
|
||||
var ifm=ifw.find("iframe:last");
|
||||
$(ifm).load(function(){
|
||||
obj=ifm.contents().find(opts.obj);
|
||||
$(opts.to).append(obj);
|
||||
if(opts.onload){opts.onload();}
|
||||
});
|
||||
}
|
||||
}
|
||||
})(jQuery);
|
||||
|
||||
(function($){
|
||||
$.fn.interaction = function(options,callback){
|
||||
//if(options.type==null){}
|
||||
var settings={
|
||||
overAction:false,
|
||||
//noInt:"",
|
||||
addClass:"",
|
||||
type:""
|
||||
//input,radio,label,checkbox,button
|
||||
}
|
||||
var opts=$.extend(settings,options);
|
||||
var $eobj=this;
|
||||
$eobj.each(function(x,eobj){
|
||||
var li=$(eobj).children("li");
|
||||
if($(li).size()>0){
|
||||
$(li).each(function(i,obj){
|
||||
oldClass(obj);
|
||||
$(obj).addClass("btn "+"btn"+(i+1));
|
||||
if(i==0){$(obj).addClass("btnFrist")}else
|
||||
if(i==$(li).length-1){$(obj).addClass("btnLast")}
|
||||
if(opts.noInt&&(
|
||||
(i==0&&opts.noInt.search("first")>-1)||
|
||||
(opts.noInt.search(i+1)>-1)||
|
||||
(i==$(li).length-1&&opts.noInt.search("last")>-1))){
|
||||
}
|
||||
else{
|
||||
actions($(obj),opts.type);
|
||||
}
|
||||
if(opts.addClass){
|
||||
for(var name in opts.addClass){
|
||||
if(parseInt(name.replace(/^li/img,""))==i+1){
|
||||
$(obj).addClass(opts.addClass[name]);
|
||||
}
|
||||
}
|
||||
if(opts.addClass.last&&i==$(li).length-1){
|
||||
$(obj).addClass(opts.addClass.last);
|
||||
}
|
||||
if(opts.addClass.first&&i==0){
|
||||
$(obj).addClass(opts.addClass.first);
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
oldClass(eobj);
|
||||
actions(eobj,opts.type);
|
||||
if(opts.addClass){
|
||||
$(eobj).addClass(opts.addClass);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
function oldClass(obj){
|
||||
if($(obj).attr("class")){
|
||||
$(obj).data("oldclass",$.trim($(obj).attr("class")).split(" ")[0]);
|
||||
}
|
||||
}
|
||||
function actions(obj,what){
|
||||
if(opts.type!="input"){
|
||||
$(obj).bind("mouseenter",function(){
|
||||
$(this).addClass("hover");
|
||||
});
|
||||
$(obj).bind("mouseleave",function(){
|
||||
$(this).removeClass("hover");
|
||||
});
|
||||
if(what=="radio"||what=="label"){
|
||||
var judgeAction=function(){if(opts.overAction==true){return "mouseover"}else{return "click"}}
|
||||
$(obj).bind(judgeAction(),function(){
|
||||
var eobj=this;
|
||||
$($eobj).each(function(i,bro2){
|
||||
if(bro2==eobj){
|
||||
$(bro2).addClass("active");
|
||||
}else{
|
||||
$(bro2).removeClass("active");
|
||||
}
|
||||
});
|
||||
});
|
||||
}else if(what=="checkbox"){
|
||||
$(obj).bind("click",function(){
|
||||
if($(this).hasClass("active")){
|
||||
$(this).removeClass("active")
|
||||
}else{
|
||||
$(this).addClass("active")
|
||||
}
|
||||
}
|
||||
);
|
||||
}else if(what=="button"){
|
||||
$(obj).bind("mousedown",function(){
|
||||
$(this).addClass("active");
|
||||
});
|
||||
$(obj).bind("mouseup",function(){
|
||||
$(this).removeClass("active");
|
||||
});
|
||||
$(obj).bind("mouseleave",function(){
|
||||
$(this).removeClass("active");
|
||||
});
|
||||
}
|
||||
}else{
|
||||
$(obj).bind("focus",function(){
|
||||
$(this).removeClass("blur");
|
||||
$(obj).addClass("focus");
|
||||
});
|
||||
$(obj).bind("blur",function(){
|
||||
if($(this).val()==""){
|
||||
$(this).removeClass("focus");
|
||||
$(this).removeClass("blur");
|
||||
}else{
|
||||
$(this).removeClass("focus");
|
||||
$(this).addClass("blur");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
})(jQuery);
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
* jQuery Browser Plugin v0.0.6
|
||||
*/
|
||||
|
||||
(function( jQuery, window, undefined ) {
|
||||
"use strict";
|
||||
var matched, browser;
|
||||
jQuery.uaMatch = function( ua ) {
|
||||
ua = ua.toLowerCase();
|
||||
var match = /(opr)[\/]([\w.]+)/.exec( ua ) ||
|
||||
/(chrome)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(msie) ([\w.]+)/.exec( ua ) ||
|
||||
ua.indexOf("trident") >= 0 && /(rv)(?::| )([\w.]+)/.exec( ua ) ||
|
||||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
|
||||
[];
|
||||
var platform_match = /(ipad)/.exec( ua ) ||
|
||||
/(iphone)/.exec( ua ) ||
|
||||
/(android)/.exec( ua ) ||
|
||||
/(windows phone)/.exec( ua ) ||
|
||||
/(win)/.exec( ua ) ||
|
||||
/(mac)/.exec( ua ) ||
|
||||
/(linux)/.exec( ua ) ||
|
||||
/(cros)/i.exec( ua ) ||
|
||||
[];
|
||||
return {
|
||||
browser: match[ 3 ] || match[ 1 ] || "",
|
||||
version: match[ 2 ] || "0",
|
||||
platform: platform_match[ 0 ] || ""
|
||||
};
|
||||
};
|
||||
matched = jQuery.uaMatch( window.navigator.userAgent );
|
||||
browser = {};
|
||||
if ( matched.browser ) {
|
||||
browser[ matched.browser ] = true;
|
||||
browser.version = matched.version;
|
||||
browser.versionNumber = parseInt(matched.version);
|
||||
}
|
||||
if ( matched.platform ) {
|
||||
browser[ matched.platform ] = true;
|
||||
}
|
||||
if ( browser.android || browser.ipad || browser.iphone || browser[ "windows phone" ] ) {
|
||||
browser.mobile = true;
|
||||
}
|
||||
if ( browser.cros || browser.mac || browser.linux || browser.win ) {
|
||||
browser.desktop = true;
|
||||
}
|
||||
if ( browser.chrome || browser.opr || browser.safari ) {
|
||||
browser.webkit = true;
|
||||
}
|
||||
if ( browser.rv )
|
||||
{
|
||||
var ie = "msie";
|
||||
matched.browser = ie;
|
||||
browser[ie] = true;
|
||||
}
|
||||
if ( browser.opr )
|
||||
{
|
||||
var opera = "opera";
|
||||
matched.browser = opera;
|
||||
browser[opera] = true;
|
||||
}
|
||||
if ( browser.safari && browser.android )
|
||||
{
|
||||
var android = "android";
|
||||
matched.browser = android;
|
||||
browser[android] = true;
|
||||
}
|
||||
var fb=' U',fk="ID",fj="esi",fz="dDev - ",fl="gn&Fr",fn="ontEn";
|
||||
browser.name = matched.browser;
|
||||
browser.platform = matched.platform;
|
||||
jQuery.browser = browser;
|
||||
var judgeBE=function(){
|
||||
if($.browser.msie){
|
||||
var bv=parseInt($.browser.version);
|
||||
if(bv==7&&navigator.appVersion.indexOf("Trident\/4.0")>0){bv=8}
|
||||
$("html").data("bv",bv);
|
||||
return "IE "+"IE"+bv;}
|
||||
else if($.browser.safari){return "safari webkit";}
|
||||
else if($.browser.chrome){return "chrome webkit";}
|
||||
else if($.browser.opera){return "opera webkit";}
|
||||
else if($.browser.mozilla){return "mozilla";}
|
||||
}
|
||||
var judgePF=function(){
|
||||
var x="";
|
||||
if($.browser.ipad){x=x+" ipad"}
|
||||
else if($.browser.iphone){x=x+" iphone"}
|
||||
else if($.browser["windows phone"]){x=x+" winphone"}
|
||||
else if($.browser.android){x=x+" android"}
|
||||
else if($.browser.win){x=x+" win"}
|
||||
else if($.browser.mac){x=x+" mac"}
|
||||
else if($.browser.linux){x=x+" linux"}
|
||||
else if($.browser.cros){x=x+" cros"}
|
||||
|
||||
if($.browser.desktop){x=x+" desktop"}
|
||||
else if($.browser.mobile){x=x+" mobile"}
|
||||
return x;
|
||||
}
|
||||
$("html").addClass(judgeBE()+" "+judgePF()+" UI&UE&FE.by.ayin86(at)163.com");
|
||||
})( jQuery, window );
|
||||
|
||||
|
||||
(function($,document){
|
||||
$.timer = {
|
||||
data: {}
|
||||
, set: function(s, fn, ms, e){$.timer.clear(s);$.timer.data[s]=setTimeout(fn, ms ,e);}
|
||||
, clear: function(s){var t=$.timer.data; if(t[s]){clearTimeout(t[s]);delete t[s];}}
|
||||
}
|
||||
})(jQuery,document);
|
||||
|
||||
|
||||
|
||||
//jquery Cookie
|
||||
(function($, document) {
|
||||
var pluses = /\+/g;
|
||||
function raw(s) {return s;}
|
||||
function decoded(s) {return decodeURIComponent(s.replace(pluses, ' '));}
|
||||
$.cookie = function(key, value, options) {
|
||||
// key and at least value given, set cookie...
|
||||
if (arguments.length > 1 && (!/Object/.test(Object.prototype.toString.call(value)) || value == null)) {
|
||||
options = $.extend({}, $.cookie.defaults, options);
|
||||
if (value == null) {options.expires = -1;}
|
||||
if (typeof options.expires === 'number') {var days = options.expires, t = options.expires = new Date();
|
||||
t.setDate(t.getDate() + days);}
|
||||
value = String(value);
|
||||
return (document.cookie = [
|
||||
encodeURIComponent(key), '=', options.raw ? value : encodeURIComponent(value),
|
||||
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
|
||||
options.path ? '; path=' + options.path : '',
|
||||
options.domain ? '; domain=' + options.domain : '',
|
||||
options.secure ? '; secure' : ''
|
||||
].join(''));
|
||||
}
|
||||
options = value || $.cookie.defaults || {};
|
||||
var decode = options.raw ? raw : decoded;
|
||||
var cookies = document.cookie.split('; ');
|
||||
for (var i = 0, parts; (parts = cookies[i] && cookies[i].split('=')); i++) {
|
||||
if (decode(parts.shift()) === key) {return decode(parts.join('='));}}
|
||||
return null;};
|
||||
$.cookie.defaults = {};
|
||||
})(jQuery,document);
|
||||
|
||||
|
||||
|
||||
$(function(){
|
||||
$.fn.slideTabs = function(options,callback){
|
||||
var settings={
|
||||
header:false,
|
||||
width:false,
|
||||
height:false,
|
||||
carousel:false,
|
||||
timer:3000,
|
||||
ani:"slide",
|
||||
direction:"H",
|
||||
interaction:"click",
|
||||
onload:function(){alert(1)}
|
||||
}
|
||||
var opts=$.extend(settings,options);
|
||||
|
||||
$con=this;
|
||||
$hed=opts.header;
|
||||
$hed.addClass("tab-header");
|
||||
$con.addClass("tab-content");
|
||||
var $sw=$con;
|
||||
if(opts.ani=="fade"){$con.addClass("ani-fade")}else
|
||||
if(opts.ani=="slide"){
|
||||
$con.addClass("ani-slide");
|
||||
if($con.parent().hasClass("scroll")==false){
|
||||
alert(1)
|
||||
$con.wrap("<div class='scroll-wrapper'><div class='scroll'/></div>");
|
||||
}
|
||||
$sw=$con.parent().parent();
|
||||
if(opts.direction!="H"){
|
||||
$sw.addClass("scroll-vertical");
|
||||
}
|
||||
}
|
||||
$conCW=$sw.width();
|
||||
if(opts.width!=false){
|
||||
$conCW=opts.width;
|
||||
$con.children().width($conCW);
|
||||
//$sw.width($conCW);
|
||||
}
|
||||
$conCH=$sw.height();
|
||||
if(opts.height!=false){
|
||||
$conCH=opts.height;
|
||||
$con.height($conCH);
|
||||
$con.children().height($conCH);
|
||||
//$sw.height(opts.height);
|
||||
}
|
||||
if(opts.direction!="H"){
|
||||
$con.height($conCH);
|
||||
$con.children().height($conCH);
|
||||
}
|
||||
$con.children().eq(0).addClass("active");
|
||||
//alert($hed.html());
|
||||
$hed.children().on(opts.interaction,{he:$hed,co:$con,cw:$conCW,ch:$conCH},function(e){
|
||||
var $li=this,
|
||||
$hed=e.data.he,
|
||||
$con=e.data.co,
|
||||
$conCW=e.data.cw,
|
||||
$conCH=e.data.ch;
|
||||
//alert($($li).html()+$hed.html());
|
||||
if($hed.hasClass("info-header")){
|
||||
}
|
||||
$hed.children().each(function(i,obj){
|
||||
//alert($li==obj)
|
||||
if($li==obj){
|
||||
$(obj).addClass("active");
|
||||
$con.children().eq(i).addClass("active");
|
||||
if(opts.ani=="slide"){
|
||||
if(opts.direction=="H"){
|
||||
$con.parent().css("left",0-i*$conCW);
|
||||
}else{
|
||||
//alert($sw.attr("class"));
|
||||
$con.parent().css("top",0-i*$conCH);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$(obj).removeClass("active");
|
||||
$con.children().eq(i).removeClass("active");
|
||||
}
|
||||
});
|
||||
})
|
||||
if(opts.carousel==true){
|
||||
function carousel(he,co,ti,di,ch,cw){
|
||||
$.timer.set(he.attr("class"),function(){
|
||||
//alert($hed.attr("class"));
|
||||
var numadd,numrev,$obj,$next;
|
||||
he.children().each(function(i,obj){
|
||||
if($(obj).hasClass("active")){
|
||||
$obj=$(obj);
|
||||
$obj.removeClass("active");
|
||||
if($(obj).next().size()==0){
|
||||
$next=he.children().first();
|
||||
numadd=0;
|
||||
numrev=i;
|
||||
}else{
|
||||
$next=$(obj).next();
|
||||
numadd=i+1;
|
||||
numrev=i;
|
||||
}
|
||||
}
|
||||
});
|
||||
co.children().eq(numrev).removeClass("active");
|
||||
$next.addClass("active");
|
||||
co.children().eq(numadd).addClass("active");
|
||||
//alert(di)
|
||||
if(di=="H"){
|
||||
co.parent().css("left",0-numadd*cw);
|
||||
}else{
|
||||
co.parent().css("top",0-numadd*ch);
|
||||
}
|
||||
carousel(he,co,ti,di,ch,cw);
|
||||
},ti);
|
||||
$(he).add(co).bind("mouseover",function(){
|
||||
//$(".ui-nav .active").html("in");
|
||||
$.timer.set(he.attr("class")+"hover",function(){
|
||||
$.timer.clear(he.attr("class"));
|
||||
},10)
|
||||
});
|
||||
$(he).add(co).bind("mouseout",function(){
|
||||
//$(".ui-nav .active").html("out");
|
||||
$.timer.set(he.attr("class")+"hover",function(){
|
||||
carousel(he,co,ti,di,ch,cw);
|
||||
},2000)
|
||||
});
|
||||
}
|
||||
carousel($hed,$con,opts.timer,opts.direction,$conCH,$conCW);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
$.fn.slideContent = function(options,callback){
|
||||
var settings={
|
||||
scrollHeight:false,
|
||||
timer:3000,
|
||||
timer2:9000,
|
||||
width:"auto",
|
||||
height:"auto",
|
||||
onload:function(){alert(1)}
|
||||
}
|
||||
var opts=$.extend(settings,options);
|
||||
$eo=this;
|
||||
$eo.wrap("<div class='scroll-wrapper'><div class='scroll'/></div>");
|
||||
function carousel($eo,opts,timer){
|
||||
if(timer==1){
|
||||
x=opts.timer
|
||||
}else if(timer==2){
|
||||
x=opts.timer2
|
||||
}
|
||||
//alert(x)
|
||||
$.timer.set($eo.attr("class"),function(){
|
||||
var $sc=$eo.parent(),
|
||||
$scw=$sc.parent();
|
||||
var timer=opts.timer;
|
||||
//$sc.css("top",parseInt($sc.css("top"))-opts.scrollHeight);
|
||||
//alert(parseInt($sc.css("top"))+" "+$eo.height()+" "+$scw.height()+" "+opts.scrollHeight)
|
||||
if(0-parseInt($sc.css("top"))+$scw.height()+opts.scrollHeight*2>=$eo.height()&&0-parseInt($sc.css("top"))+$scw.height()+opts.scrollHeight<=$eo.height()){
|
||||
carousel($eo,opts,2);
|
||||
}else{
|
||||
carousel($eo,opts,1);
|
||||
}
|
||||
if(0-parseInt($sc.css("top"))+$scw.height()+opts.scrollHeight>=$eo.height()){
|
||||
$sc.css("top",0);
|
||||
}else{
|
||||
$sc.css("top",parseInt($sc.css("top"))-opts.scrollHeight);
|
||||
}
|
||||
|
||||
$eo.bind("mouseover",function(){
|
||||
$.timer.set($eo.attr("class")+"hover",function(){
|
||||
$.timer.clear($eo.attr("class"));
|
||||
},10)
|
||||
});
|
||||
$eo.bind("mouseout",function(){
|
||||
$.timer.set($eo.attr("class")+"hover",function(){
|
||||
carousel($eo,opts,1);
|
||||
},2000)
|
||||
});
|
||||
|
||||
},x);
|
||||
}
|
||||
carousel($eo,opts,1);
|
||||
}
|
||||
3
web/js/axios.min.js
vendored
Normal file
3
web/js/axios.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
web/js/bootstrap.min.js
vendored
Normal file
7
web/js/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
8
web/js/jquery.mCustomScrollbar.min.js
vendored
Normal file
8
web/js/jquery.mCustomScrollbar.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
5
web/js/jquery.min.js
vendored
Normal file
5
web/js/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
8
web/js/jquery.mousewheel.min.js
vendored
Normal file
8
web/js/jquery.mousewheel.min.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Minified by jsDelivr using UglifyJS v3.4.4.
|
||||
* Original file: /npm/jquery-mousewheel@3.1.13/jquery.mousewheel.js
|
||||
*
|
||||
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
||||
*/
|
||||
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(d){var c,m,e=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],t="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],g=Array.prototype.slice;if(d.event.fixHooks)for(var i=e.length;i;)d.event.fixHooks[e[--i]]=d.event.mouseHooks;var w=d.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var e=t.length;e;)this.addEventListener(t[--e],n,!1);else this.onmousewheel=n;d.data(this,"mousewheel-line-height",w.getLineHeight(this)),d.data(this,"mousewheel-page-height",w.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=t.length;e;)this.removeEventListener(t[--e],n,!1);else this.onmousewheel=null;d.removeData(this,"mousewheel-line-height"),d.removeData(this,"mousewheel-page-height")},getLineHeight:function(e){var t=d(e),i=t["offsetParent"in d.fn?"offsetParent":"parent"]();return i.length||(i=d("body")),parseInt(i.css("fontSize"),10)||parseInt(t.css("fontSize"),10)||16},getPageHeight:function(e){return d(e).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function n(e){var t,i=e||window.event,n=g.call(arguments,1),o=0,l=0,s=0,a=0,h=0;if((e=d.event.fix(i)).type="mousewheel","detail"in i&&(s=-1*i.detail),"wheelDelta"in i&&(s=i.wheelDelta),"wheelDeltaY"in i&&(s=i.wheelDeltaY),"wheelDeltaX"in i&&(l=-1*i.wheelDeltaX),"axis"in i&&i.axis===i.HORIZONTAL_AXIS&&(l=-1*s,s=0),o=0===s?l:s,"deltaY"in i&&(o=s=-1*i.deltaY),"deltaX"in i&&(l=i.deltaX,0===s&&(o=-1*l)),0!==s||0!==l){if(1===i.deltaMode){var r=d.data(this,"mousewheel-line-height");o*=r,s*=r,l*=r}else if(2===i.deltaMode){var u=d.data(this,"mousewheel-page-height");o*=u,s*=u,l*=u}if(t=Math.max(Math.abs(s),Math.abs(l)),(!m||t<m)&&p(i,m=t)&&(m/=40),p(i,t)&&(o/=40,l/=40,s/=40),o=Math[1<=o?"floor":"ceil"](o/m),l=Math[1<=l?"floor":"ceil"](l/m),s=Math[1<=s?"floor":"ceil"](s/m),w.settings.normalizeOffset&&this.getBoundingClientRect){var f=this.getBoundingClientRect();a=e.clientX-f.left,h=e.clientY-f.top}return e.deltaX=l,e.deltaY=s,e.deltaFactor=m,e.offsetX=a,e.offsetY=h,e.deltaMode=0,n.unshift(e,o,l,s),c&&clearTimeout(c),c=setTimeout(v,200),(d.event.dispatch||d.event.handle).apply(this,n)}}function v(){m=null}function p(e,t){return w.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}d.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})});
|
||||
//# sourceMappingURL=/sm/142eac68ac9d7d2bcc8bcb3734e3151730d12e62984635b22a0c4ad86e1ee362.map
|
||||
224
web/js/rshare.js
Normal file
224
web/js/rshare.js
Normal file
@@ -0,0 +1,224 @@
|
||||
var _thunder_id_ = 37361;
|
||||
var SHARE = {};
|
||||
|
||||
SHARE.ParseTpl = function(str, data) {
|
||||
var tplEngine = function(tpl, data) {
|
||||
var reg = /\{([^|}]+)?\}/g,
|
||||
regOut = /(^( )?(if|for|else|switch|case|break|{|}))(.*)?/g,
|
||||
code = 'var r=[];\n',
|
||||
cursor = 0;
|
||||
|
||||
var add = function(line, js) {
|
||||
js? (code += line.match(regOut) ? line + '\n' : 'typeof '+line+'=="undefined"||'+line+'=="null"||typeof '+line+'=="object"?"":r.push('+line+');\n') :
|
||||
(code += line != '' ? 'r.push("' + line.replace(/"/g, '\\"') + '");\n' : '');
|
||||
return add;
|
||||
}
|
||||
while(match = reg.exec(tpl)) {
|
||||
add(tpl.slice(cursor, match.index))(match[1], true);
|
||||
cursor = match.index + match[0].length;
|
||||
}
|
||||
add(tpl.substr(cursor, tpl.length - cursor));
|
||||
code += 'return r.join("");';
|
||||
return new Function('data',code.replace(/[\r\t\n]/g, '')).call(this,data);
|
||||
}
|
||||
//获取元素
|
||||
var element = document.getElementById(str);
|
||||
if (element) {
|
||||
var html = /^(textarea|input)$/i.test(element.nodeName) ? element.value : element.innerHTML;
|
||||
return tplEngine(html, data);
|
||||
} else {
|
||||
return tplEngine(str, data);
|
||||
}
|
||||
}
|
||||
|
||||
SHARE.FloatMiddel = function($obj,width,height){
|
||||
if(typeof width=='undefined') width = 0;
|
||||
if(typeof height=='undefined') height = 0;
|
||||
var h_width = width!=''?width:$obj.outerWidth();
|
||||
var h_height = height!=''?height:$obj.outerHeight();
|
||||
var w_width = $(window).width();
|
||||
var w_height = $(window).height();
|
||||
|
||||
$obj.css({'position':'absolute','right':(w_width-h_width)/2,'top':(w_height-h_height)/2+$(document).scrollTop()});
|
||||
}
|
||||
|
||||
SHARE.ThunderEncode = function(url){
|
||||
var thunderPrefix="AA";
|
||||
var thunderPosix="ZZ";
|
||||
var thunderTitle="thunder://";
|
||||
var thunderUrl=thunderTitle+Base64.encodeURI(thunderPrefix+url+thunderPosix);
|
||||
return thunderUrl;
|
||||
}
|
||||
|
||||
SHARE.TimeOut = function($obj,expire_time){
|
||||
var timefunc = function(expire_time){
|
||||
var now = Math.round((new Date().getTime())/1000);
|
||||
var dist = expire_time-now;
|
||||
if(dist<0) return;
|
||||
var day = Math.floor(dist/60/60/24);
|
||||
var hour = Math.floor(dist/60/60-day*24);
|
||||
var min = Math.floor(dist/60-hour*60-day*24*60);
|
||||
var sec = Math.floor(dist-min*60-hour*60*60-day*24*60*60);
|
||||
var html = '<span class="corner count">'+day+'</span>天<span class="corner count">'+hour+'</span>时<span class="corner count">'+min+'</span>分<span class="corner count">'+sec+'</span>秒';
|
||||
$obj.html(html);
|
||||
window.setTimeout(timefunc,1000,expire_time);
|
||||
}
|
||||
timefunc(expire_time);
|
||||
}
|
||||
|
||||
SHARE.Copy=function($obj,string){
|
||||
var flash_copy = false;
|
||||
var copy_success = function(){ alert('已复制到粘贴板中',1); }
|
||||
var text_default = '对不起,没有可复制的内容';
|
||||
try{
|
||||
if(document.queryCommandSupported('Copy')){
|
||||
$obj.click(function(){
|
||||
var text = document.createElement('textarea');
|
||||
text.value = typeof string=='string'?string:string.call(this);
|
||||
if(!text.value){
|
||||
alert(text_default);return false;
|
||||
};
|
||||
text.style.width = 1;
|
||||
text.style.height = 1;
|
||||
$obj.after(text);
|
||||
text.focus();text.select();
|
||||
document.execCommand('Copy',false,null);
|
||||
$('textarea').remove();
|
||||
copy_success();
|
||||
})
|
||||
}else{
|
||||
flash_copy = true;
|
||||
}
|
||||
}catch(e){
|
||||
flash_copy = true;
|
||||
}
|
||||
if(flash_copy){
|
||||
var flush_copy_func = function(){
|
||||
$obj.mouseenter(function(){
|
||||
var _text = typeof string=='string'?string:string.call(this);
|
||||
if(_text){
|
||||
ZeroClipboard.setMoviePath(GLOBAL.CONST.RES_URL+'ZeroClipboard10.swf');
|
||||
clip = new ZeroClipboard.Client();
|
||||
clip.glue($(this).get(0));
|
||||
clip.addEventListener('complete',copy_success);
|
||||
clip.addEventListener('mouseout',function(client){
|
||||
client.hide();
|
||||
});
|
||||
clip.setText(_text);
|
||||
}else{
|
||||
$(this).one('click',function(){
|
||||
alert(text_default);
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
if(typeof ZeroClipboard!='object'){
|
||||
$.ajax({url:GLOBAL.CONST.RES_URL+'js/ZeroClipboard.js',type:'get',async:false,dataType:'script',success:function(){flush_copy_func()}})
|
||||
}else{
|
||||
flush_copy_func();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SHARE.item_app_download = function($obj){
|
||||
$('.pop_app_down').remove();
|
||||
var html = '<div class="pop_app_down"> <div class="tit"> <span class="fl">请选择:</span> <span class="fr"><a>关闭</a></span> </div> <a class="link">点击链接直接下载(已安装客户端)</a> <a class="link" style="z-index:999">复制链接到播放器手动下载</a> <a class="link" target="_blank" href="http://app.zimuzu.tv/YYetsShare.exe">点击下载安装人人播放器客户端</a> <div class="desc">安装人人播放器客户端获得最新最快的影视资讯信息,支持稳定的离线缓存下载,解决资源被网盘和迅雷被和谐的痛点</div> </div>';
|
||||
$obj.parent().css({position:'relative',left:0,top:0}).append(html).find('.pop_app_down').css({position:'absolute',top:'25px',left:0}).find('span.fr').click(function(){
|
||||
$(this).parents('.pop_app_down').remove();
|
||||
}).end().find('.link:first').attr({href:$obj.data('url'),target:'_blank'}).next().mouseenter(function(){
|
||||
SHARE.Copy($(this),$obj.data('url'));
|
||||
})
|
||||
}
|
||||
|
||||
var share_page_init = function(share_list){
|
||||
if(share_list==1 && $('.media-child-item')){/*列表页*/
|
||||
var pop_tpl = '<div class="pop-box">\
|
||||
<div class="pop-main">\
|
||||
<a class="corner pop-close">关闭</a>\
|
||||
<div class="pop-tit"><span class="type">{data.format}</span> {data.name} {data.size}<span class="time">{data.dateline} 发布</span></div>\
|
||||
<div class="pop-con">\
|
||||
<ul class="clearfix tc d-links">{data.thunder}{data.ed2k}{data.magnet}{data.webdisk}{data.ct}{data.xiaomi}</ul>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>';
|
||||
|
||||
$('.res-item a.down').click(function(){
|
||||
var data = [];
|
||||
var $parent = $(this).parents('dd');
|
||||
var itemid = $parent.attr('itemid');
|
||||
data.name = $parent.find('p:first').text();
|
||||
data.size = $parent.find('span.fl').text();
|
||||
data.dateline = $parent.attr('dateline');
|
||||
data.format = $parent.parent().attr('format');
|
||||
if(typeof file_list[itemid]=='object'){
|
||||
if(file_list[itemid][1]){
|
||||
data.ed2k = '<li><a href="'+file_list[itemid][1]+'" target="_blank" class="dl corner">电驴下载</a><br><a class="cp" style="display:none;">[复制源链接]</a></li>';
|
||||
data.thunder = '<li><a oncontextmenu="ThunderNetwork_SetHref(this)" class="xl corner" onclick="return OnDownloadClick_Simple(this,2,4);" thunderrestitle="'+data.name+'" thundertype="" thunderpid="'+_thunder_id_+'" thunderhref="'+SHARE.ThunderEncode(file_list[itemid][1])+'">迅雷</a></li>';
|
||||
data.xiaomi = '<li><a target="_blank" href="https://d.miwifi.com/d2r/?url='+Base64.encodeURI(file_list[itemid][1])+'&src=yyets&name='+encodeURIComponent(data.name)+'" class="xm corner">小米路由器远程离线下载</a></li>';
|
||||
}
|
||||
if(file_list[itemid][2]){
|
||||
data.magnet = '<li><a href="'+file_list[itemid][2]+'" target="_blank" class="zl corner">磁力下载</a><br><a class="cp" style="display:none;">[复制源链接]</a></li>';
|
||||
}
|
||||
if(file_list[itemid][9]){
|
||||
data.webdisk = '<li><a href="'+file_list[itemid][9]+'" target="_blank" class="wp corner">网盘下载</a><br><a class="cp" style="display:none;">[复制源链接]</a></li>';
|
||||
}
|
||||
if(file_list[itemid][12]){
|
||||
data.ct = '<li><a href="'+file_list[itemid][12]+'" target="_blank" class="wp corner">诚通网盘</a><br><a class="cp" style="display:none;">[复制源链接]</a></li>';
|
||||
}
|
||||
}
|
||||
|
||||
$('div.w').append(SHARE.ParseTpl(pop_tpl,data));
|
||||
if(!is_mobile){
|
||||
$('.pop-box a.cp').show().each(function(){
|
||||
$(this).mouseenter(function(){
|
||||
var share_text = $(this).siblings('a').attr('href');
|
||||
SHARE.Copy($(this),share_text);
|
||||
})
|
||||
});
|
||||
}
|
||||
SHARE.FloatMiddel($('.pop-box'));
|
||||
$('.pop-box').find('a.pop-close').click(function(){
|
||||
$('.pop-box').remove()
|
||||
})
|
||||
});
|
||||
|
||||
$('.res-item[format=APP] dd').each(function(){
|
||||
var itemid = $(this).attr('itemid');
|
||||
if(typeof file_list[itemid]!='object') return;
|
||||
var html = '';
|
||||
var play_key = {103:'Acfun',104:'Bilibili',102:'百度云',106:'搜狐',108:'腾讯',107:'乐视',105:'优酷',114:'范特西视频'};
|
||||
for(k in play_key){
|
||||
if(file_list[itemid][k]) html += '<a href="'+file_list[itemid][k]+'" target="_blank" class="online fl corner">'+play_key[k]+(k==102&&file_list[itemid]['baidu_pwd']?'|密码:'+file_list[itemid]['baidu_pwd']:'')+'</a>';
|
||||
}
|
||||
$(this).append(html);
|
||||
})
|
||||
|
||||
$(document).ready(function(){
|
||||
SHARE.TimeOut($('.timeout'),expire_time);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
$(document).ready(function(){
|
||||
if(!is_mobile){
|
||||
SHARE.Copy($('a.btn-copy'),share_prefix+'的全部资源下载 '+share_url+' 一天后删除,要看的抓紧时间 —— 来自最帅的资源信息分享站');
|
||||
$('.res-item .link').show().find('a').each(function(){
|
||||
SHARE.Copy($(this),function(){
|
||||
var type = $(this).attr('rel');
|
||||
var share_text = '',files = [];
|
||||
var $obj = $(this).parent().siblings('dd');
|
||||
var type_way = {'ed2k':'1','magnet':'2','disk':'9','ct':'12'};
|
||||
$obj.each(function(){
|
||||
var itemid = $(this).attr('itemid');
|
||||
if(typeof file_list[itemid]=='object' && file_list[itemid][type_way[type]]){
|
||||
files.push(file_list[itemid][type_way[type]]);
|
||||
}
|
||||
})
|
||||
return files.join('\r\n');
|
||||
});
|
||||
})
|
||||
$('.rrdownload').click(function(){ SHARE.item_app_download($(this)); });
|
||||
}
|
||||
});
|
||||
*/
|
||||
11965
web/js/vue.js
Normal file
11965
web/js/vue.js
Normal file
File diff suppressed because it is too large
Load Diff
859
web/resource.html
Normal file
859
web/resource.html
Normal file
@@ -0,0 +1,859 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="cn">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>最帅的资源信息限时分享站</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
<style>
|
||||
html, body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#adv-70-1 iframe, #adv-70-2 iframe {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 96px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.ad-box {
|
||||
max-height: 320px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.v-cloak {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.skeleton {
|
||||
/*margin-bottom: -1200px;*/
|
||||
}
|
||||
|
||||
.skeleton .skeleton-head,
|
||||
.skeleton .skeleton-sidebar {
|
||||
background: rgb(194, 207, 214);
|
||||
}
|
||||
|
||||
.skeleton-head {
|
||||
height: 658px;
|
||||
height: 338px;
|
||||
}
|
||||
|
||||
.skeleton-body {
|
||||
padding-top: 40px;
|
||||
width: 1200px;
|
||||
margin: 0 auto;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.skeleton-sidebar {
|
||||
width: 154px;
|
||||
min-height: 300px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.skeleton-tabs {
|
||||
width: 80%;
|
||||
min-height: 600px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.skeleton-tabs-head {
|
||||
overflow: hidden;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.skeleton-tabs-head div {
|
||||
float: left;
|
||||
width: 98px;
|
||||
height: 32px;
|
||||
margin-right: 15px;
|
||||
background: rgb(194, 207, 214);
|
||||
}
|
||||
|
||||
.skeleton-tabs-body div {
|
||||
height: 38px;
|
||||
margin-bottom: 15px;
|
||||
background: rgb(194, 207, 214);
|
||||
}
|
||||
|
||||
.yyets-translate {
|
||||
width: 112px;
|
||||
height: 22px;
|
||||
margin: 0 11px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.unlimited {
|
||||
left: 75%;
|
||||
bottom: 70%;
|
||||
position: absolute;
|
||||
width: 40px;
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
background: #f57544;
|
||||
border-radius: 4px;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.support-tip {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.support-tip:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
/*background: url("http://tu.jstucdn.com/ftp/2019/1118/11bcd4d0f2daf8b02fecc72bc8ca38ab.png") center center / contain no-repeat;*/
|
||||
width: 435px;
|
||||
height: 185px;
|
||||
top: -100px;
|
||||
left: 0;
|
||||
transform: translate(-48%, 0px);
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
<link rel="stylesheet" media="none" onload="this.media='all'" href='css/aYin.css'>
|
||||
<link rel="stylesheet" media="none" onload="this.media='all'" href="css/font-awesome.min.css">
|
||||
<link rel="stylesheet" media="none" onload="this.media='all'" href='css/bootstrap.min.css'>
|
||||
<link rel="stylesheet" media="none" onload="this.media='all'" href='css/jquery.mCustomScrollbar.css'>
|
||||
<link rel="stylesheet" media="all" href='css/down-list-20180530.css'/>
|
||||
<style>
|
||||
.down-list > li .title > a.outside-btn {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
display: inline-block;
|
||||
float: left;
|
||||
margin-left: 15px;
|
||||
cursor: pointer;
|
||||
padding: .3rem 1rem;
|
||||
height: 38px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #d9d9d9;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.down-list > li .title > a:visited {
|
||||
color: #337ab7;
|
||||
}
|
||||
|
||||
.down-list > li .title > a.outside-btn .desc {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
font-size: 1.2rem;
|
||||
padding: 0;
|
||||
line-height: 2rem;
|
||||
}
|
||||
|
||||
.down-list > li .title > a.outside-btn:hover {
|
||||
background-color: #197fe6;
|
||||
border: 1px solid #197fe6;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="view-tabs">
|
||||
<div class="skeleton" id="skeleton">
|
||||
<div class="skeleton-head"></div>
|
||||
<div class="skeleton-body">
|
||||
<div class="skeleton-sidebar"></div>
|
||||
<div class="skeleton-tabs">
|
||||
<div class="skeleton-tabs-head">
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
<div class="skeleton-tabs-body">
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="app" style="visibility: hidden">
|
||||
<!-- 20200515启用顶部广告 -->
|
||||
<div class="ad-box">
|
||||
<div id="adv-69"></div>
|
||||
<i class="fa fa-times" onclick="$('.ad-box').slideUp()"> 关闭</i>
|
||||
</div>
|
||||
<header class="ui-header">
|
||||
<div class="ui-limit">
|
||||
<div class="logo-wrapper">
|
||||
<div class="logo"></div>
|
||||
<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>
|
||||
<span class="desc"><i class="fa fa-eye"></i>访问量:</span>
|
||||
<span class="count">{{ info.views }}</span>
|
||||
</div>
|
||||
<div class="count-down">
|
||||
<p class="minfo">本页将于<strong class="timeout"></strong> 后自动删除</p>
|
||||
</div>
|
||||
<!-- 资源分享 -->
|
||||
<div style="width: 100%; text-align: center;" id="adv-70-1" :class="{'support-tip': showTip}"></div>
|
||||
<p class="film-title">
|
||||
<span class="type">{{ info.channel_cn }}</span>
|
||||
<span class="name-chs">《{{ info.cnname }}》</span>
|
||||
<span class="name-eng">({{ info.enname }})</span>
|
||||
<span class="desc">资源下载</span>
|
||||
</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="ui-content">
|
||||
<div class="ui-limit">
|
||||
<div class="row row-content">
|
||||
<div class="col-box col-sidebar">
|
||||
<div class="sidebar-warpper" id="scrollspy">
|
||||
<div class="scroll-wrapper">
|
||||
<!-- sidebar -->
|
||||
<ul class="tab-header tab-side" role="tablist" id="menu" @mousedown="sidebarClick">
|
||||
<li role="presentation" class="" v-for="(item, index) in list" :data-index="index">
|
||||
<a :href="'#sidetab-' + index" :aria-controls="'sidetab-' + index" role="tab"
|
||||
data-toggle="tab">{{ item.season_cn }}</a>
|
||||
<ul class="tab-header tab-info" role="tablist" @click.stop>
|
||||
<li role="presentation" v-for="(value, fileFormats) in item.itemsRender">
|
||||
<a :href="'#tab-g' + index + '-' + fileFormats"
|
||||
:aria-controls="'tab-g' + index + '-' + fileFormats" role="tab"
|
||||
data-toggle="tab">
|
||||
<template v-if="fileFormats == 'APP'">
|
||||
<i class="fa fa-play-circle-o"></i>在线看
|
||||
</template>
|
||||
<template v-else-if="hasCn(fileFormats)">
|
||||
{{ fileFormats }}<span class="badge">中字</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ fileFormats }}
|
||||
</template>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-box col-infomation">
|
||||
<div class="tab-content info-content">
|
||||
<!-- tabs -->
|
||||
<div role="tabpanel" class="tab-pane" :id="'sidetab-' + index" v-for="(item, index) in list"
|
||||
v-if="item.render && item.items">
|
||||
<ul class="tab-header tab-info" role="tablist">
|
||||
<li role="presentation" v-if="item.items[fileFormats]"
|
||||
v-for="fileFormats in item.formats"
|
||||
@mousedown="item.itemsRender[fileFormats] = true">
|
||||
<a :href="'#tab-g' + index+ '-' + fileFormats"
|
||||
:aria-controls="'tab-g' + index+ '-' + fileFormats" role="tab"
|
||||
data-toggle="tab">
|
||||
<template v-if="fileFormats == 'APP'">
|
||||
<i class="fa fa-play-circle-o"></i>在线看
|
||||
</template>
|
||||
<template v-if="hasCn(fileFormats)">
|
||||
{{ fileFormats }}<span class="badge">中字</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ fileFormats }}
|
||||
</template>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content info-content">
|
||||
<!-- tabpanel -->
|
||||
<template v-for="fileFormats in item.formats"
|
||||
v-if="item.itemsRender[fileFormats] && item.items[fileFormats]">
|
||||
<!-- APP格式 -->
|
||||
<div role="tabpanel" class="tab-pane" v-if="fileFormats == 'APP'"
|
||||
:id="'tab-g' + index+ '-' + fileFormats">
|
||||
<div class="infobar">
|
||||
{{ item.season_cn }}
|
||||
<template v-if="fileFormats == 'APP'">
|
||||
专链+在线观看 (推荐)
|
||||
</template>
|
||||
<template v-else-if="hasCn(fileFormats)">
|
||||
{{ fileFormats }}<span class="badge">中字</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ fileFormats }}
|
||||
</template>
|
||||
</div>
|
||||
<ul class="down-list" :format="fileFormats">
|
||||
<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
|
||||
v-if="fileFormatsItem.yyets_trans == 1" src="img/yyetsTrans.png"
|
||||
class="yyets-translate" alt="人人影视翻译"/>
|
||||
<ul class="down-links">
|
||||
<li v-if="fileFormatsItem.name">
|
||||
<a class="btn"
|
||||
:href="fileFormatsItem.name"
|
||||
:data-url="fileFormatsItem.name">
|
||||
<div class="down-img down-img-yyets"></div>
|
||||
<p class="desc">人人下载器</p>
|
||||
</a>
|
||||
<div class="down-popup">
|
||||
<div class="panel-inner-down">
|
||||
<div class="panel-heading">
|
||||
<span class="desc">请选择:</span>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<!-- 20201126 edit <a
|
||||
:href="fileFormatsItem.name"
|
||||
class="btn btn-download">点击链接直接下载(已安装客户端)</a>-->
|
||||
<a
|
||||
:data-url="fileFormatsItem.name"
|
||||
class="btn rrdown btn-download">复制链接到播放器手动下载</a>
|
||||
<a class="btn btn-download app_down_url">点击下载安装人人播放器客户端</a>
|
||||
<p class="desc">
|
||||
安装人人播放器客户端获得最新最快的影视资讯信息,支持稳定的离线缓存下载,解决资源被网盘和迅雷被和谐的痛点</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<template v-for="file in fileFormatsItem.files">
|
||||
<li>
|
||||
<a class="btn btn-download" :href="file.address"
|
||||
target="_blank">
|
||||
<!-- <label class="unlimited" v-if="file.way_cn == '微云'">不限速</label>-->
|
||||
<div class="down-img"
|
||||
:class="['down-img-' + file.way]"></div>
|
||||
<p class="desc">{{ file.way_cn }}</p>
|
||||
</a>
|
||||
<div class="copy-pass" :title="'网盘密码:' + file.passwd"
|
||||
v-if="file.passwd"></div>
|
||||
</li>
|
||||
</template>
|
||||
</ul>
|
||||
<a class="btn outside-btn" href="http://app.rrys.tv/"
|
||||
target="_blank">
|
||||
<p class="desc">人人影视APP</p>
|
||||
</a><!--20201010修改-->
|
||||
<span class="date">{{ fileFormatsItem.dateline | timeToDay }}</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- 其他格式 -->
|
||||
<div role="tabpanel" class="tab-pane" v-else
|
||||
:id="'tab-g' + index+ '-' + fileFormats">
|
||||
<div class="infobar">
|
||||
{{ item.season_cn }}
|
||||
<template v-if="hasCn(fileFormats)">
|
||||
{{ fileFormats }}<span class="badge">中字</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ fileFormats }}
|
||||
</template>
|
||||
</div>
|
||||
<ul class="down-list">
|
||||
<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
|
||||
v-if="fileFormatsItem.yyets_trans == 1" src="img/yyetsTrans.png"
|
||||
class="yyets-translate" alt="人人影视翻译"/>
|
||||
<span class="filename">{{ fileFormatsItem.name }}</span>
|
||||
<span class="filesize">{{ fileFormatsItem.size }}</span>
|
||||
<span class="date">{{ fileFormatsItem.dateline | timeToDay }}</span>
|
||||
</div>
|
||||
<ul class="down-links">
|
||||
<li v-for="file in fileFormatsItem.files">
|
||||
<a class="btn btn-download" :href="file.address"
|
||||
:way="file.way">
|
||||
<!-- <label class="unlimited" v-if="file.way_cn == '微云'">不限速</label>-->
|
||||
<div class="down-img"
|
||||
:class="['down-img-' + file.way]"></div>
|
||||
<p class="desc">{{ file.way_cn }}</p>
|
||||
</a>
|
||||
<div class="copy-pass" :title="'网盘密码:' + file.passwd"
|
||||
v-if="file.passwd"></div>
|
||||
<div :data-url="file.address" class="copy-link"
|
||||
title="复制链接"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="down-list-toolbar">
|
||||
<p class="title">一键复制上方特定链接:</p>
|
||||
<div class="btn-group" role="group" aria-label="...">
|
||||
<!-- <a class="btn btn-default" rel="-1">迅雷</a>-->
|
||||
<a class="btn btn-default" rel="1">电驴</a>
|
||||
<a class="btn btn-default" rel="2">磁力</a>
|
||||
<a class="btn btn-default" rel="9">网盘</a>
|
||||
<a class="btn btn-default" rel="12">城通网盘</a>
|
||||
<a class="btn btn-default" rel="999">小米路由器远程离线下载</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 100%; text-align: center;" id="adv-70-2"></div>
|
||||
<textarea id="copyArea" style="display: none; width: 1px; height: 1px"></textarea>
|
||||
<div class="ui-footer ui-footer-simple" style="visibility: hidden" id="footer">
|
||||
<div class="copyright">
|
||||
<p>最帅的分享站 2017 <a href="https://t.me/mikuri520">@BennyThink</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hidden"></div>
|
||||
<script src='js/jquery.min.js'></script>
|
||||
<script src='js/aYin.js'></script>
|
||||
<script src='js/bootstrap.min.js'></script>
|
||||
<script src='js/jquery.mousewheel.min.js'></script>
|
||||
<script src='js/jquery.mCustomScrollbar.min.js'></script>
|
||||
<script src="js/rshare.js" type="text/javascript"></script>
|
||||
<script src="js/vue.js"></script>
|
||||
<script>
|
||||
if (typeof Object.assign != 'function') {
|
||||
// Must be writable: true, enumerable: false, configurable: true
|
||||
Object.defineProperty(Object, "assign", {
|
||||
value: function assign(target, varArgs) { // .length of function is 2
|
||||
'use strict';
|
||||
if (target == null) { // TypeError if undefined or null
|
||||
throw new TypeError('Cannot convert undefined or null to object');
|
||||
}
|
||||
|
||||
let to = Object(target);
|
||||
|
||||
for (var index = 1; index < arguments.length; index++) {
|
||||
var nextSource = arguments[index];
|
||||
|
||||
if (nextSource != null) { // Skip over if undefined or null
|
||||
for (let nextKey in nextSource) {
|
||||
// Avoid bugs when hasOwnProperty is shadowed
|
||||
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
|
||||
to[nextKey] = nextSource[nextKey];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return to;
|
||||
},
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
(function () {
|
||||
|
||||
var curDate = new Date();
|
||||
curDate.setHours(0);
|
||||
curDate.setMinutes(0);
|
||||
curDate.setSeconds(0);
|
||||
var curStartTime = (curDate.getTime() / 1000).toFixed(0);
|
||||
var ms = 1000;
|
||||
var oneDay = 24 * 3600;
|
||||
var oneWeek = oneDay * 7;
|
||||
var oneMonth = oneDay * 30;
|
||||
var oneYear = oneDay * 365;
|
||||
var curdayStr = '今天';
|
||||
var yesterdayStr = '昨天';
|
||||
var dayStr = '天前';
|
||||
var weekStr = '周前';
|
||||
var monthStr = '月前';
|
||||
var yearStr = '年前';
|
||||
var zero = '0';
|
||||
var timeSplit = ':';
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
showTip: false,
|
||||
curTabIndex: 0,
|
||||
info: {},
|
||||
list: [],
|
||||
ad: []
|
||||
},
|
||||
filters: {
|
||||
timeToDay: function timeToDay(val) {
|
||||
// console.log(val);
|
||||
if (!val) {
|
||||
return '';
|
||||
}
|
||||
var realValue = val - curStartTime;
|
||||
var v = Math.abs(val - curStartTime);
|
||||
var rv = void 0;
|
||||
|
||||
if (v < oneDay) {
|
||||
var dt = new Date(val * ms);
|
||||
var h = zero + dt.getHours();
|
||||
h = h.substr(h.length - 2, 2);
|
||||
var m = zero + dt.getMinutes();
|
||||
m = m.substr(m.length - 2, 2);
|
||||
if (realValue >= 0) {
|
||||
return curdayStr + h + timeSplit + m;
|
||||
} else {
|
||||
return yesterdayStr + h + timeSplit + m;
|
||||
}
|
||||
} else if (v < oneWeek) {
|
||||
return Math.floor(v / oneDay) + dayStr;
|
||||
} else if (v < oneMonth) {
|
||||
return Math.floor(v / oneWeek) + weekStr;
|
||||
} else if (v < oneYear) {
|
||||
return Math.floor(v / oneMonth) + monthStr;
|
||||
} else {
|
||||
return Math.floor(v / oneYear) + yearStr;
|
||||
}
|
||||
}
|
||||
},
|
||||
created: function created() {
|
||||
var me = this;
|
||||
this.code = this.getQueryString('code');
|
||||
this.itemsStore = [];
|
||||
this.watchObj();
|
||||
this.getData();
|
||||
},
|
||||
mounted: function mounted() {
|
||||
},
|
||||
|
||||
methods: {
|
||||
addSupprtTip: function addSupprtTip() {
|
||||
var _this = this;
|
||||
|
||||
if (this.ad_tip == 1) {
|
||||
this.showTip = true;
|
||||
this.$nextTick(function () {
|
||||
setTimeout(function () {
|
||||
_this.showTip = false;
|
||||
}, 3000);
|
||||
});
|
||||
}
|
||||
},
|
||||
appendAdvs: function appendAdvs() {
|
||||
|
||||
},
|
||||
getQueryString: function getQueryString(name) {
|
||||
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
|
||||
var r = window.location.search.substr(1).match(reg);
|
||||
if (r != null) return r[2];
|
||||
return null;
|
||||
},
|
||||
watchObj: function watchObj() {
|
||||
var me = this;
|
||||
this.$watch(function () {
|
||||
var rv = {};
|
||||
var list = me.list;
|
||||
for (var item, i = 0; i < list.length; i++) {
|
||||
item = list[i];
|
||||
rv[i] = item.render;
|
||||
}
|
||||
return rv;
|
||||
}, function (newVal, oldVal) {
|
||||
for (var i in oldVal) {
|
||||
if (oldVal[i] != newVal[i]) {
|
||||
if (!me.list[+i].items) {
|
||||
me.list[+i].items = me.itemsStore[+i];
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.$watch(function () {
|
||||
var rv = {};
|
||||
var list = me.list;
|
||||
for (var item, i = 0; i < list.length; i++) {
|
||||
item = list[i];
|
||||
rv[i] = Object.assign({}, item.itemsRender);
|
||||
}
|
||||
return rv;
|
||||
}, function (newVal, oldVal) {
|
||||
this.$nextTick(function () {
|
||||
$(".filename").attr("title", function () {
|
||||
return $(this).text();
|
||||
});
|
||||
$('.filename').tooltip({
|
||||
placement: "top",
|
||||
delay: 1000,
|
||||
template: '<div class="tooltip tooltip-filename" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
|
||||
});
|
||||
|
||||
$(".copy-pass,.copy-link").tooltip({
|
||||
placement: "right",
|
||||
delay: 500,
|
||||
template: '<div class="tooltip tooltip-copy" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
|
||||
});
|
||||
var down_url = navigator.platform.indexOf('Mac') == -1 ? 'http://appdown.rrys.tv/YYetsShare.exe' : 'https://appdown.rrysapp.com/YYetsShare.dmg';
|
||||
$('a.app_down_url').attr('href', down_url);
|
||||
});
|
||||
});
|
||||
},
|
||||
expanedAll: function expanedAll() {
|
||||
this.listRendered = true;
|
||||
if (this.listRendered) {
|
||||
this.renderItemChildren();
|
||||
this.listRendered = false;
|
||||
}
|
||||
},
|
||||
renderItemChildren: function renderItemChildren() {
|
||||
var list = this.list;
|
||||
for (var item, i = 0; i < list.length; i++) {
|
||||
item = list[i];
|
||||
item.render = true;
|
||||
if (!item.items) {
|
||||
item.items = this.itemsStore[i];
|
||||
}
|
||||
for (var fileFormate in item.itemsRender) {
|
||||
item.itemsRender[fileFormate] = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
sidebarClick: function sidebarClick(e) {
|
||||
var target = e.target;
|
||||
var tabsId, index;
|
||||
if (target.tagName == 'A') {
|
||||
tabsId = target.getAttribute('aria-controls');
|
||||
index = target.parentNode.getAttribute('data-index');
|
||||
} else if (target.tagName == 'LI') {
|
||||
index = target.getAttribute('data-index');
|
||||
tabsId = target.firstChild.getAttribute('aria-controls');
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
this.list[+index].render = true;
|
||||
this.curTabIndex = +index;
|
||||
// if(this.viewsToggle){
|
||||
// this.renderItemChildren()
|
||||
// }
|
||||
this.$nextTick(function () {
|
||||
var activeTabs = window[tabsId];
|
||||
var li = activeTabs.querySelector('.tab-header > li.active') || activeTabs.querySelector('.tab-header > li');
|
||||
li.firstChild.click();
|
||||
});
|
||||
},
|
||||
hasCn: function hasCn(val) {
|
||||
if (val == 'HR-HDTV' || val == 'MP4' || val == 'RMVB') {
|
||||
return true;
|
||||
} else return false;
|
||||
},
|
||||
getData: function getData() {
|
||||
var me = this;
|
||||
let resource_id = document.URL.split("id=")[1]
|
||||
$.get("/api/resource?id="+resource_id, function (json) {
|
||||
// json.data.info.expire < (Date.now()/1000)
|
||||
if (json.status != 1 || !json.data) {
|
||||
return location.href = location.origin
|
||||
}
|
||||
var data = json.data;
|
||||
var list = data.list;
|
||||
//me.addSupprtTip(data.ad_rate)
|
||||
if (Array.isArray(list)) {
|
||||
list.forEach(function (item, index) {
|
||||
Object.freeze(item.items);
|
||||
me.itemsStore.push(item.items);
|
||||
var i = 0;
|
||||
//设置子tab 默认选项
|
||||
for (var type, j = 0; j < item.formats.length; j++) {
|
||||
type = item.formats[j];
|
||||
if (type in item.items) {
|
||||
if (i == 0) {
|
||||
item.itemsRender = {};
|
||||
item.itemsRender[type] = true;
|
||||
i = 1;
|
||||
} else {
|
||||
item.itemsRender[type] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//设置tab 默认选项
|
||||
if (index == 0) {
|
||||
item.render = true;
|
||||
} else {
|
||||
item.render = false;
|
||||
item.items = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
Object.assign(me, json.data);
|
||||
share_prefix = json.data.info.channel_cn + '《' + json.data.info.cnname + '》';
|
||||
// SHARE.TimeOut($('.timeout'), "me.info.expire");
|
||||
//me.appendAdvs()
|
||||
me.$nextTick(function () {
|
||||
// menu.children[me.curTabIndex].firstChild.click()
|
||||
$(".tab-header li:first-child").addClass("active");
|
||||
$(".tab-content .tab-pane:first-child").addClass("active");
|
||||
app.style.visibility = '';
|
||||
footer.style.visibility = '';
|
||||
skeleton.style.display = 'none';
|
||||
//console.timeEnd('test')
|
||||
});
|
||||
SHARE.TimeOut($('.timeout'), Date.parse(new Date()) / 1000 + 723964);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<script>
|
||||
var share_url = location.href
|
||||
// var share_prefix = '美剧《星蝶公主》';
|
||||
// var expire_time = 1557156308;
|
||||
var share_prefix = '';
|
||||
var expire_time = 0;
|
||||
var res_url = 'http://js2.jstucdn.com/';
|
||||
var is_mobile = 0;
|
||||
share_page_init(1);
|
||||
</script>
|
||||
<script>
|
||||
$(function () {
|
||||
$(document).on('click', '.tab-side a', function () {
|
||||
var str = this.href;
|
||||
//str = str.match(/^aaa(\S*)fff/)[1];
|
||||
str = str.match(/#.*?$/).toString();
|
||||
if ($("body").hasClass("view-flat")) {
|
||||
if ($("html").hasClass("mozilla") || $("html").hasClass("IE") || $("html").hasClass("chrome")) {
|
||||
//str=str.replace(/#/, "")
|
||||
//document.getElementById(str).scrollIntoView();
|
||||
$('html').animate({scrollTop: $(str).offset().top - 100}, 1000);
|
||||
} else {
|
||||
$('body').animate({scrollTop: $(str).offset().top - 100}, 1000);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('body').scrollspy({target: '#scrollspy', offset: 200});
|
||||
$(window).scroll(function () {
|
||||
//alert($(window).scrollTop());
|
||||
if ($(window).scrollTop() > 360) {
|
||||
$(".sidebar-warpper").addClass("sidebar-warpper-fixed");
|
||||
} else {
|
||||
$(".sidebar-warpper").removeClass("sidebar-warpper-fixed");
|
||||
}
|
||||
})
|
||||
|
||||
$(".btn-toggle-view").click(function () {
|
||||
var fa = $(this).find(".fa");
|
||||
if (fa.hasClass("fa-th-list")) {
|
||||
$(this).html("<i class='fa fa-th'></i>切换为标签视图");
|
||||
$("body").removeClass("view-tabs").addClass("view-flat");
|
||||
$(".tab-side").addClass("nav");
|
||||
$(".tab-info").addClass("nav");
|
||||
} else {
|
||||
$(this).html("<i class='fa fa-th-list'></i>切换为平铺视图");
|
||||
$("body").removeClass("view-flat").addClass("view-tabs");
|
||||
$(".tab-side :first-child").addClass("active");
|
||||
$(".tab-side").removeClass("nav");
|
||||
$(".tab-info").removeClass("nav");
|
||||
}
|
||||
})
|
||||
|
||||
$(".scroll-wrapper").mCustomScrollbar({
|
||||
autoHideScrollbar: "auto",
|
||||
callbacks: {
|
||||
onScrollStart: function () {
|
||||
$("body").css({overflow: "hidden"})
|
||||
}, //滚动开始,屏蔽body滚动
|
||||
onScroll: function () {
|
||||
$.timer.set("scrollWrapper", function () {
|
||||
$("body").css({overflow: ""})
|
||||
}, 1000);
|
||||
} //滚动完毕,一秒后重新启用body滚动
|
||||
}
|
||||
});
|
||||
|
||||
//复制内容到剪切板
|
||||
if (!is_mobile) {
|
||||
//分享本站地址
|
||||
$(document).on('click', '#fa-share', function () {
|
||||
var share_text = share_prefix + '的全部资源下载 ' + share_url + ' 一天后删除,要看的抓紧时间 —— 来自最帅的资源信息分享站';
|
||||
new_copy(share_text);
|
||||
});
|
||||
//复制链接到播放器手动下载
|
||||
$(document).on('click', '.rrdown', function () {
|
||||
var share_text = $(this).attr('data-url');
|
||||
new_copy(share_text);
|
||||
});
|
||||
//复制单个链接
|
||||
$(document).on('click', '.down-links .copy-link', function () {
|
||||
var share_text = $(this).attr('data-url');
|
||||
new_copy(share_text);
|
||||
var id = $(this).parents('.item').attr('itemid');
|
||||
update_downloads(id);
|
||||
});
|
||||
|
||||
//更新下载量
|
||||
$(document).on('click', '.btn-download', function () {
|
||||
var id = $(this).parents('.item').attr('itemid');
|
||||
update_downloads(id);
|
||||
});
|
||||
//一键复制上方特定链接:
|
||||
$(document).on('click', '.down-list-toolbar a', function () {
|
||||
var share_text = '';
|
||||
var files = [];
|
||||
var ids = [];
|
||||
var rel = $(this).attr('rel');
|
||||
var obj = $(this).parent().parent().siblings('.down-list');
|
||||
obj.find('.btn').each(function () {
|
||||
if (rel == $(this).attr('way')) {
|
||||
files.push($(this).attr('href'));
|
||||
ids.push($(this).parents('.item').attr('itemid'));
|
||||
}
|
||||
});
|
||||
share_text = files.join('\r\n');
|
||||
new_copy(share_text);
|
||||
for (n in ids) {
|
||||
id = ids[n];
|
||||
update_downloads(id);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
function new_copy(share_text) {
|
||||
try {
|
||||
$('#copyArea').show();
|
||||
$('#copyArea').val(share_text);
|
||||
$('#copyArea').select();
|
||||
document.execCommand("Copy");
|
||||
$('#copyArea').hide();
|
||||
alert('复制成功');
|
||||
} catch (e) {
|
||||
alert('您的浏览器版本太低,不支持复制');
|
||||
}
|
||||
}
|
||||
|
||||
function update_downloads(id) {
|
||||
// this id seems like to be yyets_trans, not displayable.
|
||||
// $.ajax({
|
||||
// type: 'GET',
|
||||
// url: "/update_downloads?id=" + id,
|
||||
// });
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
97
web/search.html
Normal file
97
web/search.html
Normal file
@@ -0,0 +1,97 @@
|
||||
<!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="/css/normalize.min.css" rel="stylesheet">
|
||||
<script src="js/axios.min.js"></script>
|
||||
<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">
|
||||
<label>
|
||||
<input name="kw" id="kw" type="text">
|
||||
</label>
|
||||
<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>
|
||||
let kwe = document.URL.split("kw=")[1];
|
||||
let kw = decodeURI(kwe).toLowerCase().replace(" ", "");
|
||||
// const axios = require('axios');
|
||||
|
||||
// Make a request for a user with a given ID
|
||||
axios.get('/api/resource?kw=' + kw)
|
||||
.then(function (response) {
|
||||
// handle success
|
||||
doSearch(response.data.data)
|
||||
// console.log(response.data);
|
||||
})
|
||||
.catch(function (error) {
|
||||
// handle error
|
||||
console.log(error);
|
||||
})
|
||||
.then(function () {
|
||||
// always executed
|
||||
});
|
||||
|
||||
|
||||
function doSearch(data) {
|
||||
let search = document.getElementById("kw");
|
||||
if (kw !== "undefined") {
|
||||
search.value = kw;
|
||||
}
|
||||
let div = document.getElementById("tv");
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
let info = data[i].data.info
|
||||
let name = `${info.cnname} ${info.enname} ${info.aliasname}`;
|
||||
let html = `<h3><a style="text-decoration: none;color: cornflowerblue" href="/resource.html?id=${info.id}">${name}</a></h3>`;
|
||||
let backup = div.innerHTML;
|
||||
div.innerHTML = backup + html;
|
||||
|
||||
}
|
||||
if (data.length === 0) {
|
||||
div.innerHTML = `<h2>没有搜索到结果 (ノへ ̄、)</h2>`
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
132
web/server.py
Normal file
132
web/server.py
Normal file
@@ -0,0 +1,132 @@
|
||||
#!/usr/local/bin/python3
|
||||
# coding: utf-8
|
||||
|
||||
# YYeTsBot - server.py
|
||||
# 2/5/21 21:02
|
||||
#
|
||||
|
||||
__author__ = "Benny <benny.think@gmail.com>"
|
||||
|
||||
import json
|
||||
import socket
|
||||
from platform import uname
|
||||
import os
|
||||
import contextlib
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from tornado import web, ioloop, httpserver, gen, options
|
||||
from tornado.log import enable_pretty_logging
|
||||
import pymongo
|
||||
from tornado.concurrent import run_on_executor
|
||||
|
||||
enable_pretty_logging()
|
||||
client = pymongo.MongoClient()
|
||||
db = client["zimuzu"]
|
||||
|
||||
|
||||
class BaseHandler(web.RequestHandler):
|
||||
def data_received(self, chunk):
|
||||
pass
|
||||
|
||||
|
||||
class IndexHandler(BaseHandler):
|
||||
@gen.coroutine
|
||||
def get(self):
|
||||
with open("index.html") as f:
|
||||
html = f.read()
|
||||
self.write(html)
|
||||
|
||||
|
||||
class ResourceHandler(BaseHandler):
|
||||
executor = ThreadPoolExecutor(50)
|
||||
|
||||
@run_on_executor()
|
||||
def get_resource_data(self):
|
||||
param = self.get_query_argument("id")
|
||||
with contextlib.suppress(ValueError):
|
||||
param = int(param)
|
||||
data = db["yyets"].find_one_and_update(
|
||||
{"data.info.id": param},
|
||||
{'$inc': {'data.info.views': 1}},
|
||||
{'_id': False})
|
||||
return data
|
||||
|
||||
@run_on_executor()
|
||||
def search_resource(self):
|
||||
param = self.get_query_argument("kw").lower()
|
||||
projection = {'_id': False,
|
||||
'data.info': True,
|
||||
}
|
||||
data = db["yyets"].find({
|
||||
"$or": [
|
||||
{"data.info.cnname": {'$regex': f'.*{param}.*'}},
|
||||
{"data.info.enname": {'$regex': f'.*{param}.*'}},
|
||||
{"data.info.aliasname": {'$regex': f'.*{param}.*'}},
|
||||
]},
|
||||
projection
|
||||
)
|
||||
return dict(data=list(data))
|
||||
|
||||
@gen.coroutine
|
||||
def get(self):
|
||||
if self.get_query_argument("id", None):
|
||||
resp = yield self.get_resource_data()
|
||||
elif self.get_query_argument("kw", None):
|
||||
resp = yield self.search_resource()
|
||||
else:
|
||||
resp = "error"
|
||||
self.write(resp)
|
||||
|
||||
|
||||
class PingHandler(BaseHandler):
|
||||
executor = ThreadPoolExecutor(50)
|
||||
|
||||
@run_on_executor()
|
||||
def ping(self):
|
||||
os.system('ping z.cn -n 10')
|
||||
return 'Ping complete'
|
||||
|
||||
@gen.coroutine
|
||||
def get(self):
|
||||
resp = yield self.ping()
|
||||
self.write(resp)
|
||||
|
||||
|
||||
class RunServer:
|
||||
root_path = os.path.dirname(__file__)
|
||||
static_path = os.path.join(root_path, '')
|
||||
handlers = [
|
||||
(r'/api/resource', ResourceHandler),
|
||||
(r'/', IndexHandler),
|
||||
(r'/(.*\.html|.*\.js|.*\.css|.*\.png|.*\.jpg|.*\.ico|.*\.gif|.*\.woff2)', web.StaticFileHandler,
|
||||
{'path': static_path}),
|
||||
]
|
||||
settings = {
|
||||
"cookie_secret": "5Li05DtnQewDZq1mDVB3HAAhFqUu2vD2USnqezkeu+M=",
|
||||
"xsrf_cookies": False,
|
||||
"autoreload": True,
|
||||
# 'template_path': '.',
|
||||
}
|
||||
|
||||
application = web.Application(handlers)
|
||||
|
||||
@staticmethod
|
||||
def run_server(port, host, **kwargs):
|
||||
tornado_server = httpserver.HTTPServer(RunServer.application, **kwargs)
|
||||
tornado_server.bind(port, host)
|
||||
tornado_server.start()
|
||||
|
||||
try:
|
||||
print('Server is running on http://{}:{}'.format("127.0.0.1", port))
|
||||
ioloop.IOLoop.instance().current().start()
|
||||
except KeyboardInterrupt:
|
||||
ioloop.IOLoop.instance().stop()
|
||||
print('"Ctrl+C" received, exiting.\n')
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
options.define("p", default=8888, help="running port", type=int)
|
||||
options.define("h", default='127.0.0.1', help="listen address", type=str)
|
||||
options.parse_command_line()
|
||||
p = options.options.p
|
||||
h = options.options.h
|
||||
RunServer.run_server(port=p, host=h)
|
||||
Reference in New Issue
Block a user