mirror of
https://github.com/venera-app/venera-configs.git
synced 2025-12-16 09:21:16 +00:00
28
ccc.js
28
ccc.js
@@ -8,7 +8,7 @@ class CCC extends ComicSource {
|
|||||||
// unique id of the source
|
// unique id of the source
|
||||||
key = "ccc"
|
key = "ccc"
|
||||||
|
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
|
|
||||||
minAppVersion = "1.6.0"
|
minAppVersion = "1.6.0"
|
||||||
|
|
||||||
@@ -40,7 +40,16 @@ class CCC extends ComicSource {
|
|||||||
"client_secret": "9eAhsCX3VWtyqTmkUo5EEaoH4MNPxrn6ZRwse7tE",
|
"client_secret": "9eAhsCX3VWtyqTmkUo5EEaoH4MNPxrn6ZRwse7tE",
|
||||||
"refresh_token": this.loadData("refreshToken")
|
"refresh_token": this.loadData("refreshToken")
|
||||||
});
|
});
|
||||||
this.processToken(res.body);
|
if (res.body.search("Token has been revoked") == -1) {
|
||||||
|
this.processToken(res.body);
|
||||||
|
} else {
|
||||||
|
const accountData = this.loadData("account");
|
||||||
|
if (accountData) {
|
||||||
|
await this.account.login(accountData[0], accountData[1]);
|
||||||
|
} else {
|
||||||
|
throw "請重新登錄";
|
||||||
|
}
|
||||||
|
}
|
||||||
token = this.loadData("token");
|
token = this.loadData("token");
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
@@ -76,7 +85,7 @@ class CCC extends ComicSource {
|
|||||||
title: c["name"],
|
title: c["name"],
|
||||||
subtitle: c["brief"],
|
subtitle: c["brief"],
|
||||||
description: c["description"],
|
description: c["description"],
|
||||||
cover: c["image1"],
|
cover: c["image1"]??c["image2"]??c["image3"],
|
||||||
tags: tags
|
tags: tags
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -185,7 +194,7 @@ class CCC extends ComicSource {
|
|||||||
const jsonData = JSON.parse(res.body)["data"];
|
const jsonData = JSON.parse(res.body)["data"];
|
||||||
let curTitle = null;
|
let curTitle = null;
|
||||||
for (let data of jsonData["templates"]) {
|
for (let data of jsonData["templates"]) {
|
||||||
if (data["type"] == 4) {
|
if ([4, 5].indexOf(data["type"]) != -1) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const comics = [];
|
const comics = [];
|
||||||
@@ -193,7 +202,7 @@ class CCC extends ComicSource {
|
|||||||
comics.push({
|
comics.push({
|
||||||
id: c["value"],
|
id: c["value"],
|
||||||
title: c["name"],
|
title: c["name"],
|
||||||
cover: c["image1"],
|
cover: c["image1"]??c["image2"]??c["image3"],
|
||||||
tags: [c["book_type"]["name"]],
|
tags: [c["book_type"]["name"]],
|
||||||
subtitle: c["brief"]
|
subtitle: c["brief"]
|
||||||
});
|
});
|
||||||
@@ -539,7 +548,7 @@ class CCC extends ComicSource {
|
|||||||
for (let r of recommendData["hot"]) {
|
for (let r of recommendData["hot"]) {
|
||||||
recommends.push({
|
recommends.push({
|
||||||
title: r["name"],
|
title: r["name"],
|
||||||
cover: r["image1"],
|
cover: r["image1"]??r["image2"]??r["image3"],
|
||||||
id: r["id"].toString(),
|
id: r["id"].toString(),
|
||||||
subtitle: r["brief"]
|
subtitle: r["brief"]
|
||||||
});
|
});
|
||||||
@@ -547,21 +556,21 @@ class CCC extends ComicSource {
|
|||||||
for (let r of recommendData["history"]) {
|
for (let r of recommendData["history"]) {
|
||||||
recommends.push({
|
recommends.push({
|
||||||
title: r["name"],
|
title: r["name"],
|
||||||
cover: r["image1"],
|
cover: r["image1"]??r["image2"]??r["image3"],
|
||||||
id: r["id"].toString()
|
id: r["id"].toString()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
for (let r of recommendData["also_buy"]) {
|
for (let r of recommendData["also_buy"]) {
|
||||||
recommends.push({
|
recommends.push({
|
||||||
title: r["name"],
|
title: r["name"],
|
||||||
cover: r["image1"],
|
cover: r["image1"]??r["image2"]??r["image3"],
|
||||||
id: r["id"].toString()
|
id: r["id"].toString()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return new ComicDetails({
|
return new ComicDetails({
|
||||||
title: jsonData["name"],
|
title: jsonData["name"],
|
||||||
subtitle: jsonData["brief"],
|
subtitle: jsonData["brief"],
|
||||||
cover: jsonData["image1"],
|
cover: jsonData["image1"]??jsonData["image2"]??jsonData["image3"],
|
||||||
description: jsonData["description"],
|
description: jsonData["description"],
|
||||||
likesCount: jsonData["like_count_only_uuid"],
|
likesCount: jsonData["like_count_only_uuid"],
|
||||||
chapters: chapters,
|
chapters: chapters,
|
||||||
@@ -755,4 +764,5 @@ class CCC extends ComicSource {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,7 +132,7 @@
|
|||||||
"name": "CCC追漫台",
|
"name": "CCC追漫台",
|
||||||
"fileName": "ccc.js",
|
"fileName": "ccc.js",
|
||||||
"key": "ccc",
|
"key": "ccc",
|
||||||
"version": "1.0.0"
|
"version": "1.0.1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "GoDa漫画",
|
"name": "GoDa漫画",
|
||||||
|
|||||||
Reference in New Issue
Block a user