From f6d68c6d14038028d9ec870e508fe8f3bd14e262 Mon Sep 17 00:00:00 2001 From: unknown <724804113@qq.com> Date: Mon, 27 May 2024 04:02:21 +0800 Subject: [PATCH] update. --- README.md | 9 +++ icon.jpg | Bin 0 -> 5374 bytes index.js | 216 +++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 9 +++ 4 files changed, 234 insertions(+) create mode 100644 README.md create mode 100644 icon.jpg create mode 100644 index.js create mode 100644 package.json diff --git a/README.md b/README.md new file mode 100644 index 0000000..f83313a --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# FeigeBlog Plugin + +用于阅读[飞鸽博客](https://feigeblog.com/)漫画板块的 Rulia 插件. + +## 说明 + + - 使用前需要在 Rulia 插件设置中手动添加一个HTTP标头,该标头的**键**为 `referer` **值**为 `https://feigeblog.com/` . +![plugin.FeigeBlog](https://img2.imgtp.com/2024/05/27/yO49YjN5.png) + - 在使用过程中,在使用**搜索**时,筛选功能不生效. diff --git a/icon.jpg b/icon.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1e802a1e8aecaa392e8923dbea9b6572b1cae837 GIT binary patch literal 5374 zcmds4cT`hZx4(d30hQ1}z=BGXDqX-)ngoF%bOJ#^K)?`s6>v~csS-*M2#i38gc4~% zO29&q8fxeuV36M1P{J3S<(m29d-J`w*8AtZeeSvExAxxWclJJI-FprP4!;7dU~OG( zfQ}9T=x7BvoTL}g)zGm06=JBZdspj+fu0AT$uVgFfV+8nLUe9lu&}hcaHRVw_wBvh zf8u}B(s;MXN9+L5Bk^zS|4DW7frFPl&1r>Jy*+7z(}I0K!yHb3V*ev-_a}}%!k#7& z4VusIG%VuuH*EJe?C0(7P4oG3_aiKi~yG z03F~q4gasoU-OB`0sy5=0AP6am(K1r091qn0MF20y34-igGP{1>@ip!MOW<%ysbC*Tp_09*ic0XM)Nkfb45 zKpKz%6b^?04S<23{^+5}G1|j;f|2pqF~(EJk29TMImN=le2SU*^cgnR(`P_un3-9* zSV8O@oSd92XSsQ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98oJGBgy6(CgM+#B6C);23*YhqO#|uj$i4|5q)q?p6S3p!EQCwh7JvE`yDH9czPo)Hm?bh<^1*Tl4Wh$0qzmhp?l$w_WSOQKf8kT`j8 zU+$X|QVQdmm##Y9adf;Sj~XSuupBClktXvxVB9yUSB1_Sr%snEu8o-6C>S=%%r9-P zX|2Zv=S?ILDtm@x%le3#vm=!38tZeRlT4vET3m8q2X^~*`>8?LxftkcRB4@HzI(RBwGjPYd@kZD`k~Hr zQrTYZHS@S-DUO~HtYH8Z^3xmX)pYUbd)SlVWh;5aW zg7OS60YqqAB__bZgHy$HrWt%aYW41-Vu{G?%Uti2$%@$&oP4ZC5C<5##}9_qX~b+P zDPODll=>3JY&Zq$b|h>#%U9Id)Vx0SzMa}b2^E<~#V7H!ehUh<-+nIK zOm+MS7VE~s*su^#-bsn{2Nn83Y^s^c2f3BFM?Em26Sa#X!R4G3LeXBHYgf0%cJLK2 zHF>48b*4smqL)xj;GF8YUok5W4n`E55~>%{K1aP&*5LJl*M*A@rG;L1h;oIm$m`Ts zm>714$}EIg4_r2LrXfnesYlcA z9IEdLdKe{|TCLee>W_F;`s8#EC=mv0ptYC)%)uR>Am*kWJ0<@fDn<_e{Oot9Zv1K)-?kk5-gm14(OV&+%~y75 zm!d`ib}UEjc;0FmR&dvQ9#?t@uqcMUDdO8kaYLpHVHoFt-Za#vy0A}Scm?|^zU>d~ zjCINUwELd+6P7R5(V?uVeE9^oq=rWCm1OQpT%xX@-?9`%8dkMt*JSQ<=*$MT8Rp`;SUNK*06`%xTmVA1gG_7V=G hYnqN#R_-wL6IB}yak#+d`vhS6=T-Q>YdwEB_%Gg^g<}8! literal 0 HcmV?d00001 diff --git a/index.js b/index.js new file mode 100644 index 0000000..a53d10c --- /dev/null +++ b/index.js @@ -0,0 +1,216 @@ +let headers = { + appversion: '2.1.0' +} + +async function setMangaListFilterOptions() { + try { + let result = [{ + label: '分区', + name: 'filter_class_id', + options: [{ + label: '同人', + value: 1 + }, + { + label: '原创', + value: 2 + } + ] + }] + window.Rulia.endWithResult(result); + } catch (error) { + window.Rulia.endWithResult([]) + } +} + +async function getMangaListByCategory(page, pageSize, filterOptions) { + const url = 'https://feigeblog.com/api/channel/searchUserChannel'; + try { + + const payload = { + filter_block: 2, + refresh_time: Date.now().toString(), + page: page.toString(), + filter_class_id: filterOptions.filter_class_id + } + + const rawResponse = await window.Rulia.httpRequest({ + url: url, + method: 'POST', + payload: JSON.stringify(payload), + contentType: 'application/json', + headers: headers + }) + + const response = JSON.parse(rawResponse); + + var result = { + list: [] + } + for (var manga of response.data.data) { + var comic = { + title: manga.name, + url: manga.id, + coverUrl: manga.cover + } + result.list.push(comic); + } + window.Rulia.endWithResult(result); + } catch (error) { + window.Rulia.endWithException(error.message); + } +} + + +async function getMangaListBySearching(page, pageSize, keyword) { + const url = 'https://feigeblog.com/api/channel/searchUserChannel'; + try { + + const payload = { + filter_block: 2, + keyword_type: 1, + keyword: keyword.toString(), + page: page.toString(), + refresh_time: Date.now().toString(), + } + + const rawResponse = await window.Rulia.httpRequest({ + url: url, + method: 'POST', + payload: JSON.stringify(payload), + contentType: 'application/json', + headers: headers + }) + + const response = JSON.parse(rawResponse); + + var result = { + list: [] + } + for (var manga of response.data.data) { + var comic = { + title: manga.name, + url: manga.id, + coverUrl: manga.cover + } + result.list.push(comic); + } + window.Rulia.endWithResult(result); + } catch (error) { + window.Rulia.endWithException(error.message); + } +} + +async function getMangaList(page, pageSize, keyword, rawFilterOptions) { + if (keyword) { + return await getMangaListBySearching(page, pageSize, keyword); + } else { + return await getMangaListByCategory(page, pageSize, JSON.parse(rawFilterOptions)); + } +} + +async function getMangaData(dataPageUrl) { + + const url = 'https://feigeblog.com/api/ajax/getAlbumDetailById'; + const listUrl = 'https://feigeblog.com/api/ajax/getWorksListByAlbumId'; + + try { + const payload = { + id: dataPageUrl + } + + const listPayload = { + id: dataPageUrl, + page: 1, + refreshTime: Date.now().toString(), + order_sort: 'asc' + } + + const rawResponse = await window.Rulia.httpRequest({ + url: url, + method: 'POST', + payload: JSON.stringify(payload), + contentType: 'application/json', + headers: headers + }) + + const listRawResponse = await window.Rulia.httpRequest({ + url: listUrl, + method: 'POST', + payload: JSON.stringify(listPayload), + contentType: 'application/json', + headers: headers + }) + + const response = JSON.parse(rawResponse); + + const listResponse = JSON.parse(listRawResponse); + + let result = { + title: response.data.name, + description: response.data.desc, + coverUrl: response.data.cover, + chapterList: [] + } + + for (var manga of listResponse.data.data) { + let mangaTitle = manga.content; + let match = manga.content.match(/^(.*?)\n/); + if (match && match[1]) { + mangaTitle = match[1] + } + var comic = { + title: '[' + mangaTitle + '][' + manga.update_time + ']', + url: manga.id + } + result.chapterList.push(comic); + } + + window.Rulia.endWithResult(result); + } catch (error) { + window.Rulia.endWithException(error.message); + } +} + + + +async function getChapterImageList(chapterUrl) { + const url = 'https://feigeblog.com/api/ajax/worksDetail'; + + try { + const payload = { + id: chapterUrl + } + + const rawResponse = await window.Rulia.httpRequest({ + url: url, + method: 'POST', + payload: JSON.stringify(payload), + contentType: 'application/json', + headers: headers + }) + + const response = JSON.parse(rawResponse); + + let result = []; + let list = response.data.image.split(','); + + for (var i = 0; i < list.length; i++) { + result.push({ + url: list[i], + index: i, + width: 1, + height: 1 + }); + } + + window.Rulia.endWithResult(result); + + } catch (error) { + window.Rulia.endWithException(error.message); + } +} + +async function getImageUrl(path) { + window.Rulia.endWithResult(path); +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..8904870 --- /dev/null +++ b/package.json @@ -0,0 +1,9 @@ +{ + "name": "@rulia/FeigeBlog", + "title": "飞鸽博客", + "description": "您正在用RuliaReader阅读[飞鸽博客]的漫画板块捏.", + "version": "0.0.1", + "author": "LittleStar_OuO", + "tags": ["FeigeBlog", "manga", "comic"], + "homepage": "https://github.com/LittleStar-OuO/plugin.FeigeBlog" +}