[
{
"bookSourceComment": "Pixiv 书源(更新时间:2024-06-17)\n\n可用功能:✅搜索✅发现✅添加链接✅订阅源\n搜索小说:✅小说名称✅作者名称✅小说标签\n发现小说:✅关注作者✅追更列表✅推荐✅收藏\n添加网址:✅Pixiv小说链接✅Pixiv系列小说链接\n订阅用法:点击订阅源打开小说/系列小说,【刷新】,点击【加入书架】按钮添加小说到书架\n\n书源发布:兽人阅读频道 https://t.me/FurryReading\n项目地址:https://github.com/windyhusky/PixivSource\n规则订阅:https://cdn.jsdelivr.net/gh/windyhusky/PixivSource@main/pixiv.json\nhttps://raw.githubusercontent.com/windyhusky/PixivSource/main/pixiv.json",
"bookSourceGroup": "🔞 Pixiv",
"bookSourceName": "Pixiv",
"bookSourceType": 0,
"bookSourceUrl": "https://www.pixiv.net",
"bookUrlPattern": "(https?://)?(www.)?pixiv.net/(ajax/|)novel/.*",
"customOrder": 0,
"enabled": true,
"enabledCookieJar": false,
"enabledExplore": true,
"exploreUrl": "[\n {\n \"title\": \"关注作者\",\n \"url\": \"https://www.pixiv.net/ajax/follow_latest/novel?p={{page}}&mode=all&lang=zh\",\n \"style\": {\n \"layout_flexGrow\": 1,\n \"layout_flexBasisPercent\":0.3\n }\n },\n {\n \"title\": \"追更列表\",\n \"url\": \"https://www.pixiv.net/ajax/watch_list/novel?p={{page}}&new=1&lang=zh\",\n \"style\": {\n \"layout_flexGrow\": 1,\n \"layout_flexBasisPercent\":0.3\n }\n },\n {\n \"title\": \"推荐小说\",\n \"url\": \"https://www.pixiv.net/ajax/top/novel?mode=all&lang=zh\",\n \"style\": {\n \"layout_flexGrow\": 1,\n \"layout_flexBasisPercent\":0.3\n }\n },\n {\n \"title\": \"收藏小说\",\n \"url\": \"https://www.pixiv.net/ajax/user/{{cache.get(\\\"pixiv:uid\\\")}}/novels/bookmarks?tag=&offset={{(page-1)*24}}&limit=24&rest=show&lang=zh\",\n \"style\": {\n \"layout_flexGrow\": 1,\n \"layout_flexBasisPercent\":0.3\n }\n }\n]",
"header": "{\"referer\":\"https://www.pixiv.net\"}",
"lastUpdateTime": 1718385310822,
"loginCheckJs": "var util = {}\n\nfunction objStringify(obj) {\n return JSON.stringify(obj, (n, v) => {\n if (typeof v == \"function\")\n return v.toString();\n return v;\n });\n}\n\nfunction publicFunc() {\n let u = {}\n\n u.cacheGetAndSet = (key, supplyFunc) => {\n let v = cache.get(key)\n if (v === undefined || v === null) {\n v = JSON.stringify(supplyFunc())\n // 缓存10分钟\n cache.put(key, v, 600)\n }\n return JSON.parse(v)\n }\n u.getAjaxJson = (url) => {\n return util.cacheGetAndSet(url, () => {\n return JSON.parse(java.ajax(url))\n })\n }\n u.getWebviewJson = (url, parseFunc) => {\n return util.cacheGetAndSet(url, () => {\n let html = java.webView(null, url, null)\n return JSON.parse(parseFunc(html))\n })\n }\n u.debugFunc = (func) => {\n if (String(source.getVariable()) === \"debug\") {\n func()\n }\n }\n\n u.urlNovelDetailed = (nid) => {\n return `https://www.pixiv.net/ajax/novel/${nid}`\n }\n u.urlSeries = (seriesId) => {\n return `https://www.pixiv.net/ajax/novel/series/${seriesId}?lang=zh`\n }\n u.urlSeriesNovels = (seriesId, limit, offset) => {\n if (limit > 30) {\n limit = 30\n }\n\n if (limit < 10) {\n limit = 10\n }\n\n return `https://www.pixiv.net/ajax/novel/series_content/${seriesId}?limit=${limit}&last_order=${offset}&order_by=asc&lang=zh`\n }\n u.searchNovel = (novelName, page) =>{\n return `https://www.pixiv.net/ajax/search/novels/${encodeURI(novelName)}?word=${encodeURI(novelName)}&order=date_d&mode=all&p=${page}&s_mode=s_tag&lang=zh`\n }\n // 完全匹配用户名\n u.urlSearchUser = (username) => {\n return `https://www.pixiv.net/search_user.php?s_mode=s_usr&nick=${encodeURI(username)}&nick_mf=1`\n }\n u.urlUserAllWorks = (uid) => {\n return `https://www.pixiv.net/ajax/user/${uid}/profile/all?lang=zh`\n }\n u.urlUserNovels = (uid, nidList) => {\n return `https://www.pixiv.net/ajax/user/${uid}/novels?${nidList.map(v => \"ids[]=\" + v).join(\"&\")}`\n }\n\n u.urlIllustDetailed = (illustId) => {\n return `https://www.pixiv.net/ajax/illust/${illustId}?lang=zh`\n }\n u.urlSeriesIllusts = (seriesId) => {\n return `https://www.pixiv.net/ajax/series/${seriesId}?p=1&lang=zh`\n }\n u.urlCoverUrl = (url) => {\n return `${url},{\"headers\": {\"Referer\":\"https://www.pixiv.net/\"}}`\n }\n\n u.formatNovels = function (novels) {\n novels.forEach(novel => {\n novel.detailedUrl = util.urlNovelDetailed(novel.id)\n const time = this.dateFormat(novel.updateDate);\n novel.tags = novel.tags.join(\",\")\n novel.coverUrl = util.urlCoverUrl(novel.url)\n novel.description += `\\n更新时间:${time}`\n })\n return novels\n }\n\n u.dateFormat = function (str) {\n let addZero = function (num) {\n return num < 10 ? '0' + num : num;\n }\n\n let time = new Date(str);\n let Y = time.getFullYear() + \"年\";\n let M = addZero(time.getMonth() + 1) + \"月\";\n let D = addZero(time.getDate()) + \"日\";\n return Y + M + D;\n }\n\n\n util = u\n java.put(\"util\", objStringify(u))\n}\n\npublicFunc()\n\n// 获取请求的user id方便其他ajax请求构造\nlet uid = java.getResponse().headers().get(\"x-userid\")\nif (uid != null) {\n cache.put(\"pixiv:uid\", uid)\n}\njava.getStrResponse(null, null)",
"loginUrl": "https://accounts.pixiv.net/login",
"respondTime": 180000,
"ruleBookInfo": {
"author": "author",
"coverUrl": "coverUrl",
"init": "@js:\nvar util = objParse(String(java.get(\"util\")))\n\nfunction objParse(obj) {\n return JSON.parse(obj, (n, v) => {\n if (typeof v == \"string\" && v.match(\"()\")) {\n return eval(`(${v})`)\n }\n return v;\n })\n}\n\n(function (res) {\n // 获取网址id,请求并解析数据\n let isHtml = result.startsWith(\"\")\n if (isHtml) {\n var novelId = 0\n let isSeries = baseUrl.match(new RegExp(\"pixiv.net/(ajax/|)novel/series\"))\n if (isSeries) {\n let seriesId = baseUrl.match(new RegExp(\"\\\\d+\"))[0]\n java.log(`系列ID:${seriesId}`)\n // 获取系列第一篇小说的 id\n let url = util.urlSeriesNovels(seriesId, 30, 0)\n res = util.cacheGetAndSet(url, () => {\n return JSON.parse(java.ajax(url))\n })\n novelId = res.body.thumbnails.novel[0].id\n java.log(`小说ID:${novelId}`)\n res = util.getAjaxJson(util.urlNovelDetailed(novelId)).body\n // java.log(JSON.stringify(res))\n } else {\n let isNovel = baseUrl.match(new RegExp(\"pixiv.net/(ajax/|)novel\"))\n if (isNovel) {\n novelId = baseUrl.match(new RegExp(\"\\\\d+\"))[0]\n java.log(`小说ID:${novelId}`)\n res = util.getAjaxJson(util.urlNovelDetailed(novelId)).body\n // java.log(JSON.stringify(res))\n } else {\n return []\n }\n }\n } else {\n // 从搜索直接获取 json\n res = JSON.parse(result).body\n if (res.total === 0) {\n return []\n }\n }\n\n let info = {}\n info.author = res.userName\n info.name = res.title\n info.tags = res.userNovels[`${res.id}`].tags\n info.wordCount = res.wordCount\n info.latestChapter = null\n info.desc = res.description\n info.coverUrl = res.coverUrl\n info.catalogUrl = util.urlNovelDetailed(res.id)\n\n if (res.seriesNavData === undefined || res.seriesNavData === null) {\n info.name = res.title\n info.catalog = util.urlNovelDetailed(res.id)\n info.tags.unshift('单本')\n } else {\n info.name = res.seriesNavData.title\n info.catalog = util.urlSeries(res.seriesNavData.id)\n info.tags.unshift('长篇')\n }\n info.tags = info.tags.join(\",\")\n\n return info\n})();",
"intro": "desc",
"kind": "tags",
"name": "name",
"tocUrl": "catalogUrl",
"wordCount": "wordCount"
},
"ruleContent": {
"content": "@js:\nvar util = objParse(String(java.get(\"util\")))\n\nfunction objParse(obj) {\n return JSON.parse(obj, (n, v) => {\n if (typeof v == \"string\" && v.match(\"()\")) {\n return eval(`(${v})`)\n }\n return v;\n })\n}\n\n(() => {\n let res = JSON.parse(result).body\n let content = res.content\n // 在正文内部添加小说描述\n if (res.seriesNavData !== undefined && res.seriesNavData !== null && res.description !== \"\") {\n content = res.description + \"\\n\" + \"——————————\\n\".repeat(2) + content\n }\n\n // 获取 [uploadedimage:] 的图片链接\n let hasEmbeddedImages = res.textEmbeddedImages !== undefined && res.textEmbeddedImages !== null\n if (hasEmbeddedImages) {\n Object.keys(res.textEmbeddedImages).forEach((key) => {\n // 不再使用 linpx 服务加载图片\n // content = content.replace(`[uploadedimage:${key}]`, `
`)\n content = content.replace(`[uploadedimage:${key}]`, `
`)\n\n })\n }\n\n // // 获取 [pixivimage:] 的图片链接\n let matched = content.match(RegExp(/\\[pixivimage:(\\d+)]/gm))\n if (matched) {\n for (let i in matched) {\n let illustId = matched[i].match(RegExp(\"\\\\d+\"))\n let res2 = util.getAjaxJson(util.urlIllustDetailed(illustId)).body\n let illustOriginal = res2.urls.original\n content = content.replace(`${matched[i]}`, `
`)\n }\n }\n\n\n // 替换 Pixiv 分页标记符号 [newpage]\n matched = content.match(RegExp(/[ ]*\\[newpage][ ]*/gm))\n if (matched) {\n for (let i in matched){\n java.log(matched[i])\n content = content.replace(`${matched[i]}`, `${\"
\".repeat(3)}`)\n }\n }\n\n // 替换 Pixiv 章节标记符号 [chapter:]\n matched = content.match(RegExp(/\\[chapter:(.*?)]/gm))\n if (matched) {\n for (let i in matched) {\n let matched2 = matched[i].match(/\\[chapter:(.*?)]/m)\n let chapter = matched2[1].trim()\n // content = content.replace(`${matched[i]}`, `${\"
\".repeat(3)}${chapter}
`)\n content = content.replace(`${matched[i]}`, `${chapter}
`)\n }\n }\n\n // 替换 Pixiv 跳转页面标记符号 [[jump:]]\n matched = content.match(RegExp(/\\[jump:(\\d+)]/gm))\n if (matched) {\n for (let i in matched) {\n let page = matched[i].match(/\\d+/)\n content = content.replace(`${matched[i]}`, `\\n\\n跳转至第${page}节`)\n }\n }\n\n // 替换 Pixiv 链接标记符号 [[jumpuri: > ]]\n matched = content.match(RegExp(/\\[\\[jumpuri:(.*?)>(.*?)]]/gm))\n if (matched) {\n for (let i in matched) {\n let matched2 = matched[i].match(/\\[\\[jumpuri:(.*?)>(.*?)]]/m)\n let matchedText = matched2[0]\n let urlName = matched2[1].trim()\n let urlLink = matched2[2].trim()\n // 阅读不支持超链接\n //content = content.replace(`${matchedText}`, `${urlName}`)\n if (urlLink === urlName) {\n content = content.replace(`${matchedText}`, `${urlName}`)\n } else {\n content = content.replace(`${matchedText}`, `${urlName}: ${urlLink}`)\n }\n }\n }\n\n // 替换 Pixiv 注音标记符号 [[rb: > ]]\n matched = content.match(RegExp(/\\[\\[rb:(.*?)>(.*?)]]/gm))\n if (matched) {\n for (let i in matched) {\n let matched2 = matched[i].match(/\\[\\[rb:(.*?)>(.*?)]]/m)\n let matchedText = matched2[0]\n let kanji = matched2[1].trim()\n let kana = matched2[2].trim()\n // kana为中文,则替换回《书名号》\n var reg = new RegExp(\"[\\\\u4E00-\\\\u9FFF]+\",\"g\");\n if (reg.test(kana)) {\n content = content.replace(`${matchedText}`, `${kanji}《${kana}》`)\n } else{\n // 阅读不支持