Skip to content

Commit c1af867

Browse files
勉强算是更新了一点点.
1 parent c95e99d commit c1af867

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
## 说明
66

77
- 能用就行.
8-
- 要在**Http标头**里添加请求参数才能正常使用,请新建一个****`Platform`,****`1`的参数.
98
- 在使用**搜索**时,筛选功能不生效.
109
- 当筛选的**主题**的值为`推荐`时,**地区/进度**的值不生效.
1110

index.js

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
let headers = {
2+
Platform: 1
3+
}
4+
15
async function setMangaListFilterOptions() {
26
const url = 'https://api.mangacopy.com/api/v3/h5/filter/comic/tags';
37
try {
@@ -24,7 +28,8 @@ async function setMangaListFilterOptions() {
2428
const rawResponse = await window.Rulia.httpRequest({
2529
url: url,
2630
method: 'GET',
27-
payload: 'format=json&type=1'
31+
payload: 'format=json&type=1',
32+
headers: headers
2833
});
2934
const response = JSON.parse(rawResponse);
3035
for (var item of response.results.theme) {
@@ -53,7 +58,9 @@ async function getMangaListByRecommend(page, pageSize) {
5358
const rawResponse = await window.Rulia.httpRequest({
5459
url: url,
5560
method: 'GET',
56-
payload: 'format=json&limit=' + pageSize + '&offset=' + ((page - 1) * pageSize) + '&pos=3200102'
61+
payload: 'format=json&limit=' + pageSize + '&offset=' + ((page - 1) * pageSize) +
62+
'&pos=3200102',
63+
headers: headers
5764
});
5865
const response = JSON.parse(rawResponse);
5966
var result = {
@@ -92,7 +99,8 @@ async function getMangaListByCategory(page, pageSize, filterOptions) {
9299
const rawResponse = await window.Rulia.httpRequest({
93100
url: url,
94101
method: 'GET',
95-
payload: payload
102+
payload: payload,
103+
headers: headers
96104
})
97105
const response = JSON.parse(rawResponse);
98106
var result = {
@@ -121,7 +129,8 @@ async function getMangaListBySearching(page, pageSize, keyword) {
121129
url: url,
122130
method: 'GET',
123131
payload: '_update=true&format=json&limit=' + pageSize + '&offset=' + ((page - 1) * pageSize) +
124-
'&platform=1&q=' + keyword + '&q_type='
132+
'&platform=1&q=' + keyword + '&q_type=',
133+
headers: headers
125134
});
126135
const response = JSON.parse(rawResponse);
127136
var result = {
@@ -158,10 +167,11 @@ async function getMangaData(dataPageUrl) {
158167
const detailRawResponse = await window.Rulia.httpRequest({
159168
url: detailUrl,
160169
method: 'GET',
161-
payload: 'format=json&platform=3'
170+
payload: 'format=json&platform=3',
171+
headers: headers
162172
})
163173
const detailResponse = JSON.parse(detailRawResponse);
164-
var result = {
174+
let result = {
165175
title: detailResponse.results.comic.name,
166176
description: detailResponse.results.comic.brief,
167177
coverUrl: detailResponse.results.comic.cover,
@@ -170,7 +180,8 @@ async function getMangaData(dataPageUrl) {
170180
const chapterListRawResponse = await window.Rulia.httpRequest({
171181
url: chapterListUrl,
172182
method: 'GET',
173-
payload: '_update=true&format=json&limit=500&offset=0'
183+
payload: '_update=true&format=json&limit=500&offset=0',
184+
headers: headers
174185
});
175186
const chapterListResponse = JSON.parse(chapterListRawResponse);
176187

@@ -218,4 +229,4 @@ async function getChapterImageList(chapterUrl) {
218229

219230
async function getImageUrl(path) {
220231
window.Rulia.endWithResult(path);
221-
}
232+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@rulia/CopyManga",
33
"title": "拷贝漫画",
44
"description": "拷贝漫画插件.",
5-
"version": "0.0.3",
5+
"version": "0.0.4",
66
"author": "LittleStar_OuO",
77
"tags": ["Copy", "Manga", "CopyManga"],
88
"homepage": "https://github.com/LittleStar-OuO/plugin.CopyManga"

0 commit comments

Comments
 (0)