Skip to content

Commit

Permalink
增加使用网页端api的搜索方式,可以搜到一些被屏蔽的作品 (#30)
Browse files Browse the repository at this point in the history
比如葬送的芙莉莲
  • Loading branch information
PipeYume authored Dec 24, 2024
1 parent 8523d85 commit 96cc170
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion copy_manga.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,9 @@ class CopyManga extends ComicSource {
q_type = options[0];
}
keyword = encodeURIComponent(keyword)
let search_url = this.loadSetting('search_api') == "webAPI" ? "https://www.copymanga.tv/api/kb/web/searchbc/comics" : "https://api.copymanga.tv/api/v3/search/comic"
var res = await Network.get(
`https://api.copymanga.tv/api/v3/search/comic?limit=21&offset=${(page - 1) * 21}&q=${keyword}&q_type=${q_type}&platform=3`,
`${search_url}?limit=21&offset=${(page - 1) * 21}&q=${keyword}&q_type=${q_type}&platform=3`,
this.headers
)
}
Expand Down Expand Up @@ -586,4 +587,25 @@ class CopyManga extends ComicSource {
throw "未支持此类Tag检索"
}
}

settings = {
search_api: {
// title
title: "搜索方式",
// type: input, select, switch
type: "select",
// options
options: [
{
value: 'baseAPI',
text: '基础API'
},
{
value: 'webAPI',
text: '网页端API(可搜屏蔽作)'
}
],
default: 'baseAPI'
}
}
}

0 comments on commit 96cc170

Please sign in to comment.