Skip to content

Commit

Permalink
修复高速解析问题
Browse files Browse the repository at this point in the history
  • Loading branch information
qinlili23333 committed Aug 24, 2024
1 parent 0fd91cd commit c8acf93
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
7 changes: 5 additions & 2 deletions ctbtn.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(() => {
const ctfile = {
version: "2.6.7-button",
version: "2.6.8-button",
IconPack: {
load: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0iI2U4N2E5MCI+DQogICAgPHBhdGggb3BhY2l0eT0iLjI1IiBkPSJNMTYgMCBBMTYgMTYgMCAwIDAgMTYgMzIgQTE2IDE2IDAgMCAwIDE2IDAgTTE2IDQgQTEyIDEyIDAgMCAxIDE2IDI4IEExMiAxMiAwIDAgMSAxNiA0IiAvPg0KICAgIDxwYXRoIGQ9Ik0xNiAwIEExNiAxNiAwIDAgMSAzMiAxNiBMMjggMTYgQTEyIDEyIDAgMCAwIDE2IDR6Ij4NCiAgICAgICAgPGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJyb3RhdGUiIGZyb209IjAgMTYgMTYiIHRvPSIzNjAgMTYgMTYiIGR1cj0iMnMiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiAvPg0KICAgIDwvcGF0aD4NCjwvc3ZnPg==",
fail: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSIyOCIgaGVpZ2h0PSIyOCIgdmlld0JveD0iMCAwIDQ4IDQ4IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMCA0NEgzOEMzOS4xMDQ2IDQ0IDQwIDQzLjEwNDYgNDAgNDJWMTRMMzEgNEgxMEM4Ljg5NTQzIDQgOCA0Ljg5NTQzIDggNlY0MkM4IDQzLjEwNDYgOC44OTU0MyA0NCAxMCA0NFoiIHN0cm9rZT0iIzMzMyIgc3Ryb2tlLXdpZHRoPSIzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48cGF0aCBkPSJNMTggMjJMMzAgMzQiIHN0cm9rZT0iIzMzMyIgc3Ryb2tlLXdpZHRoPSIzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48cGF0aCBkPSJNMzAgMjJMMTggMzQiIHN0cm9rZT0iIzMzMyIgc3Ryb2tlLXdpZHRoPSIzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48cGF0aCBkPSJNMzAgNFYxNEg0MCIgc3Ryb2tlPSIjMzMzIiBzdHJva2Utd2lkdGg9IjMiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==",
Expand Down Expand Up @@ -73,6 +73,9 @@
return ctfile.getByID(link.substring(link.lastIndexOf("/") + 1, (link.lastIndexOf("?") == -1) ? undefined : link.lastIndexOf("?")), (link.lastIndexOf("p=") == -1) ? password : link.substring(link.lastIndexOf("p=") + 2), token, firstcallback);
},
getByID: async (fileid, password, token, firstcallback) => {
if (!token) {
token = ctfile.buildToken();
}
const origin = () => {
//兼容node.js
if (document && !(document.location.origin == 'file://')) {
Expand All @@ -92,7 +95,7 @@
}
}
}
jsonText = JSON.parse(await (await fetch("https://webapi.ctfile.com/getfile.php?path=" + path(fileid) + "&f=" + fileid + "&passcode=" + password + "&token=" + token + "false&r=" + Math.random() + "&ref=" + origin(), {
jsonText = JSON.parse(await (await fetch("https://webapi.ctfile.com/getfile.php?path=" + path(fileid) + "&f=" + fileid + "&passcode=" + password + "&token=" + token + "&r=" + Math.random() + "&ref=" + origin(), {
"headers": {
"origin": origin(),
"referer": origin()
Expand Down
7 changes: 5 additions & 2 deletions ctget.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(() => {
const ctfile = {
version: () => { return "2.6.7" },
version: () => { return "2.6.8" },
buildToken: () => {
let token = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
document.getElementById("token").value = token;
Expand All @@ -11,6 +11,9 @@
return ctfile.getByID(link.substring(link.lastIndexOf("/") + 1, (link.lastIndexOf("?") == -1) ? undefined : link.lastIndexOf("?")), (link.lastIndexOf("p=") == -1) ? password : link.substring(link.lastIndexOf("p=") + 2), token, firstcallback);
},
getByID: async (fileid, password, token, firstcallback) => {
if (!token) {
token = ctfile.buildToken();
}
const origin = () => {
//兼容node.js
if (document && !(document.location.origin == 'file://')) {
Expand All @@ -30,7 +33,7 @@
}
}
}
jsonText = JSON.parse(await (await fetch("https://webapi.ctfile.com/getfile.php?path=" + path(fileid) + "&f=" + fileid + "&passcode=" + password + "&token=" + token + "false&r=" + Math.random() + "&ref=" + origin(), {
jsonText = JSON.parse(await (await fetch("https://webapi.ctfile.com/getfile.php?path=" + path(fileid) + "&f=" + fileid + "&passcode=" + password + "&token=" + token + "&r=" + Math.random() + "&ref=" + origin(), {
"headers": {
"origin": origin(),
"referer": origin()
Expand Down
2 changes: 1 addition & 1 deletion sw.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var APP_PREFIX = '城通解析';
var VERSION = '2.4.0Patch1';
var VERSION = '2.4.1';
var CACHE_NAME = APP_PREFIX + VERSION
var URLS = []

Expand Down
2 changes: 1 addition & 1 deletion yuni/about.yuniml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div id="settings" style="height:auto;">
<img alt="城通网盘" src="./icon.webp" style="margin-top:10vh;width:25vw;max-width:160px;border-radius: 20px ;">
<H2>城通网盘解析器</H2>
<H4 id="update" style="padding:10px;">版本:Asaki(V2) 2.4.0</H4>
<H4 id="update" style="padding:10px;">版本:Asaki(V2) 2.4.1</H4>
<H5>程序:<a href="https://qinlili.bid" target="_blank">琴梨梨</a></H5>
<br>
<button onclick="window.open('https://github.com/qinlili23333/ctfileGet', '_blank');">
Expand Down

0 comments on commit c8acf93

Please sign in to comment.