[
{
"bookSourceComment": "Pixiv 小说(系列)(更新📆:2025-05-25)\n\n使用说明:两小说书源功能完全相同,启用其一即可\n可用功能:✅搜索✅发现✅添加网址✅订阅源\n搜索小说:✅单篇✅系列✅标签✅作者\n发现小说:✅关注✅追更✅推荐✅发现\n发现小说:✅收藏✅书签✅首页✅排行\n添加网址:✅Pixiv小说链接✅Pixiv系列链接\n订阅用法:点击订阅源打开小说/系列小说,【刷新】,点击【加入书架】按钮,添加到书架\n\n书源发布:兽人阅读频道 https://t.me/FurryReading\n项目地址:https://github.com/windyhusky/PixivSource\n使用教程:https://github.com/windyhusky/PixivSource/blob/main/doc/Pixiv.md\n\n规则订阅:import 订阅源\nhttps://cdn.jsdelivr.net/gh/windyhusky/PixivSource@main/import.json\nhttps://raw.githubusercontent.com/windyhusky/PixivSource/main/import.json\n\n⚙️ 书源设置:\n书源管理 - 编辑书源 - 基本 - 变量说明 - 修改并保存\n\n❤️ 查看他人收藏:\n发现 - 长按\"Pixiv\" - 编辑 - 右上角菜单 - 设置源变量\n源变量:输入作者ID,一行一个,可添加作者名,保存\n发现 - 长按\"Pixiv\" - 刷新 - 查看他人收藏",
"bookSourceGroup": "🔞 Pixiv",
"bookSourceName": "Pixiv 小说",
"bookSourceType": 0,
"bookSourceUrl": "https://www.pixiv.net/novel",
"bookUrlPattern": "(https?://)?(www\\.)?pixiv\\.net(/ajax)?/novel/(show\\.php\\?id=|series/)?\\d+",
"concurrentRate": "180/60000",
"customOrder": 0,
"enabled": true,
"enabledCookieJar": false,
"enabledExplore": true,
"exploreUrl": "@js:\nlet SHOW_R18_GENRE, SHOW_GENERAL_NEW, SHOW_GENERAL_RANK, SHOW_GENERAL_GENRE\ntry {\n settings = JSON.parse(String(source.variableComment).match(RegExp(/{([\\s\\S]*?)}/gm)))\n SHOW_R18_GENRE = settings.SHOW_R18_GENRE // 发现:热门分类显示R18小说\n SHOW_GENERAL_NEW = settings.SHOW_GENERAL_NEW // 发现:最新、企划、约稿显示一般小说\n SHOW_GENERAL_RANK = settings.SHOW_GENERAL_RANK // 发现:排行榜显示一般小说\n SHOW_GENERAL_GENRE = settings.SHOW_GENERAL_GENRE // 发现:热门分类显示一般小说\n} catch (e) {\n SHOW_R18_GENRE = false\n SHOW_GENERAL_NEW = false\n SHOW_GENERAL_RANK = false\n SHOW_GENERAL_GENRE = false\n}\n\nli = [\n {\"⭐️ 关注\": \"https://www.pixiv.net/ajax/follow_latest/novel?p={{page}}&mode=r18&lang=zh\"},\n {\"📃 追更\": \"https://www.pixiv.net/ajax/watch_list/novel?p={{page}}&new=1&lang=zh\"},\n {\"💯 推荐\": \"https://www.pixiv.net/ajax/top/novel?mode=r18&lang=zh\"},\n {\"🔍 发现\": \"https://www.pixiv.net/ajax/novel/discovery?mode=r18&lang=zh\"},\n {\"❤️ 收藏\": \"https://www.pixiv.net/ajax/user/{{cache.get(\\\"pixiv:uid\\\")}}/novels/bookmarks?tag=&offset={{(page-1)*24}}&limit=24&rest=show&lang=zh\"},\n {\"㊙️ 收藏\": \"https://www.pixiv.net/ajax/user/{{cache.get(\\\"pixiv:uid\\\")}}/novels/bookmarks?tag=&offset={{(page-1)*24}}&limit=24&rest=hide&lang=zh\"},\n {\"🏷️ 书签\": \"https://www.pixiv.net/novel/marker_all.php\"},\n {\"🏠 首页\": \"https://www.pixiv.net\"},\n]\n\nnormal = [\n {\"✅ 常规 小说 推荐 ✅\": \"\"},\n {\"⭐️ 关注\": \"https://www.pixiv.net/ajax/follow_latest/novel?p={{page}}&mode=all&lang=zh\"},\n {\"💯 推荐\": \"https://www.pixiv.net/ajax/top/novel?mode=all&lang=zh\"},\n {\"🔍 发现\": \"https://www.pixiv.net/ajax/novel/discovery?mode=safe&lang=zh\"},\n {\"🆙 更新\": \"https://cdn.jsdelivr.net/gh/windyhusky/PixivSource@main/pixiv.json\"},\n]\n\nr18New = [\n {\"🆕 最新 企划 约稿 💰\": \"\"},\n {\"🆕 最新\": \"https://www.pixiv.net/ajax/novel/new?lastId=0&limit=20&r18=true&lang=zh\"},\n {\"📑 企划\": \"https://www.pixiv.net/ajax/user_event/portal/novels?mode=r18&p={{page}}&lang=zh\"},\n {\"💰 约稿\": \"https://www.pixiv.net/ajax/commission/page/request/complete/novels?mode=r18&p={{page}}&lang=zh\"},\n {\"🔍 发现\": \"https://www.pixiv.net/ajax/novel/discovery?mode=all&lang=zh\"},\n]\n\ngeneralNew = [\n {\"✅ 最新 企划 约稿 ✅\": \"\"},\n {\"最新\": \"https://www.pixiv.net/ajax/novel/new?lastId=0&limit=20&r18=false&lang=zh\"},\n {\"企划\": \"https://www.pixiv.net/ajax/user_event/portal/novels?mode=all&p={{page}}&lang=zh\"},\n {\"约稿\": \"https://www.pixiv.net/ajax/commission/page/request/complete/novels?mode=all&p={{page}}&lang=zh\"},\n {\"编辑\": \"https://www.pixiv.net/novel/editors_picks\"},\n]\n\nr18Rank = [\n {\"👑 排行榜单 👑\": \"\"},\n {\"今日\": \"https://www.pixiv.net/novel/ranking.php?mode=daily_r18\"},\n {\"本周\": \"https://www.pixiv.net/novel/ranking.php?mode=weekly_r18\"},\n {\"R18G\": \"https://www.pixiv.net/novel/ranking.php?mode=r18g\"},\n {\"男性\": \"https://www.pixiv.net/novel/ranking.php?mode=male_r18\"},\n {\"女性\": \"https://www.pixiv.net/novel/ranking.php?mode=female_r18\"}\n]\n\ngeneralRank = [\n {\"🏆 排行榜单 🏆\": \"\"},\n {\"今日\": \"https://www.pixiv.net/novel/ranking.php?mode=daily\"},\n {\"本周\": \"https://www.pixiv.net/novel/ranking.php?mode=weekly\"},\n {\"本月\": \"https://www.pixiv.net/novel/ranking.php?mode=monthly\"},\n {\"男性\": \"https://www.pixiv.net/novel/ranking.php?mode=male\"},\n {\"女性\": \"https://www.pixiv.net/novel/ranking.php?mode=female\"},\n {\"新人\": \"https://www.pixiv.net/novel/ranking.php?mode=rookie\"},\n {\"原创\": \"https://www.pixiv.net/novel/ranking.php?mode=weekly_original\"},\n {\"AI生成\": \"https://www.pixiv.net/novel/ranking.php?mode=weekly_ai\"}\n]\n\nr18Genre = [\n {\"🔥 原创热门 🔥\": \"\"},\n {\"男性\": \"https://www.pixiv.net/ajax/genre/novel/male?mode=r18&lang=zh\"},\n {\"女性\": \"https://www.pixiv.net/ajax/genre/novel/female?mode=r18&lang=zh\"},\n {\"恋爱\": \"https://www.pixiv.net/ajax/genre/novel/romance?mode=r18&lang=zh\"},\n {\"异世界奇幻\": \"https://www.pixiv.net/ajax/genre/novel/isekai_fantasy?mode=r18&lang=zh\"},\n {\"现代奇幻\": \"https://www.pixiv.net/ajax/genre/novel/contemporary_fantasy?mode=r18&lang=zh\"},\n {\"悬疑\": \"https://www.pixiv.net/ajax/genre/novel/mystery?mode=r18&lang=zh\"},\n {\"恐怖\": \"https://www.pixiv.net/ajax/genre/novel/horror?mode=r18&lang=zh\"},\n {\"科幻\": \"https://www.pixiv.net/ajax/genre/novel/sci-fi?mode=r18&lang=zh\"},\n {\"文学\": \"https://www.pixiv.net/ajax/genre/novel/literature?mode=r18&lang=zh\"},\n {\"情感\": \"https://www.pixiv.net/ajax/genre/novel/drama?mode=r18&lang=zh\"},\n {\"历史\": \"https://www.pixiv.net/ajax/genre/novel/historical_pieces?mode=r18&lang=zh\"},\n {\"耽美\": \"https://www.pixiv.net/ajax/genre/novel/bl?mode=r18&lang=zh\"},\n {\"百合\": \"https://www.pixiv.net/ajax/genre/novel/yuri?mode=r18&lang=zh\"},\n {\"散文·诗歌\": \"https://www.pixiv.net/ajax/genre/novel/poetry?mode=r18&lang=zh\"},\n {\"随笔·纪实\": \"https://www.pixiv.net/ajax/genre/novel/non-fiction??mode=r18&lang=zh\"},\n {\"剧本\": \"https://www.pixiv.net/ajax/genre/novel/screenplays?mode=r18&lang=zh\"},\n {\"评论\": \"https://www.pixiv.net/ajax/genre/novel/reviews?mode=r18&lang=zh\"},\n {\"其他\": \"https://www.pixiv.net/ajax/genre/novel/other?mode=r18&lang=zh\"}\n]\n\ngeneralgGenre = [\n {\"❤️🔥 原创热门 ❤️🔥\": \"\"},\n {\"综合\": \"https://www.pixiv.net/ajax/genre/novel/all?mode=safe&lang=zh\"},\n {\"恋爱\": \"https://www.pixiv.net/ajax/genre/novel/romance?mode=safe&lang=zh\"},\n {\"异世界奇幻\": \"https://www.pixiv.net/ajax/genre/novel/isekai_fantasy?mode=safe&lang=zh\"},\n {\"现代奇幻\": \"https://www.pixiv.net/ajax/genre/novel/contemporary_fantasy?mode=safe&lang=zh\"},\n {\"悬疑\": \"https://www.pixiv.net/ajax/genre/novel/mystery?mode=safe&lang=zh\"},\n {\"恐怖\": \"https://www.pixiv.net/ajax/genre/novel/horror?mode=safe&lang=zh\"},\n {\"科幻\": \"https://www.pixiv.net/ajax/genre/novel/sci-fi?mode=safe&lang=zh\"},\n {\"文学\": \"https://www.pixiv.net/ajax/genre/novel/literature?mode=safe&lang=zh\"},\n {\"情感\": \"https://www.pixiv.net/ajax/genre/novel/drama?mode=safe&lang=zh\"},\n {\"历史\": \"https://www.pixiv.net/ajax/genre/novel/historical_pieces?mode=safe&lang=zh\"},\n {\"耽美\": \"https://www.pixiv.net/ajax/genre/novel/bl?mode=safe&lang=zh\"},\n {\"百合\": \"https://www.pixiv.net/ajax/genre/novel/yuri?mode=safe&lang=zh\"},\n {\"散文·诗歌\": \"https://www.pixiv.net/ajax/genre/novel/poetry?mode=safe&lang=zh\"},\n {\"随笔·纪实\": \"https://www.pixiv.net/ajax/genre/novel/non-fiction??mode=safe&lang=zh\"},\n {\"剧本\": \"https://www.pixiv.net/ajax/genre/novel/screenplays?mode=safe&lang=zh\"},\n {\"评论\": \"https://www.pixiv.net/ajax/genre/novel/reviews?mode=safe&lang=zh\"},\n {\"其他\": \"https://www.pixiv.net/ajax/genre/novel/other?mode=safe&lang=zh\"}\n]\n\nbookmarks = [{\"❤️ 他人收藏 ❤️\": \"\"}]\n\nli = li.concat(normal)\nli = li.concat(r18New)\nif (SHOW_GENERAL_NEW === true) {\n li = li.concat(generalNew)\n}\nli = li.concat(r18Rank)\nif (SHOW_GENERAL_RANK === true) {\n li = li.concat(generalRank)\n}\nif (SHOW_R18_GENRE === true) {\n li = li.concat(r18Genre)\n}\nif (SHOW_GENERAL_GENRE === true) {\n li = li.concat(generalgGenre)\n}\n\nsleepToast('使用说明🔖\\n\\n发现 - 更新 - 点击\"🔰 使用教程\" - 查看')\n\ntry {\n authors = String(source.getVariable()).split(\"\\n\")\n if (authors[0].trim() !== \"\" && authors.length >= 1) {\n for (let i in authors) {\n if (authors[i] !== \"\") {\n let authorId = authors[i].match(RegExp(/\\d+/))[0]\n let resp = JSON.parse(java.ajax(`https://www.pixiv.net/ajax/user/${authorId}`))\n if (resp.error !== true) {\n let bookmark = {}\n bookmark[resp.body.name] = `https://www.pixiv.net/ajax/user/${authorId}/novels/bookmarks?tag=&offset={{(page-1)*24}}&limit=24&rest=show&lang=zh`\n bookmarks.push(bookmark)\n }\n }\n }\n li = li.concat(bookmarks)\n } else {\n sleepToast('查看他人收藏❤️\\n\\n发现 - 长按\"Pixiv\" - 编辑 - 菜单 - 设置源变量')\n }\n} catch (e) {\n sleepToast(\"⚠️源变量设置有误\\n\\n输入作者ID,一行一个,可添加作者名,保存\")\n}\n\nli.forEach(item => {\n item.title = Object.keys(item)[0]\n item.url = Object.values(item)[0]\n delete item[Object.keys(item)[0]]\n item.style = {}\n item.style.layout_flexGrow = 1\n item.style.layout_flexShrink = 1\n item.style.layout_alignSelf = \"auto\"\n item.style.layout_wrapBefore = \"false\"\n if (item.url === \"\") {\n item.style.layout_flexBasisPercent = 1\n } else {\n item.style.layout_flexBasisPercent = -1\n }\n})\n\nJSON.stringify(li)",
"header": "{\"referer\":\"https://www.pixiv.net\",}",
"jsLib": "var checkTimes = 0\n\nfunction cacheGetAndSet(cache, key, supplyFunc) {\n let v = cache.get(key)\n if (v === undefined || v === null) {\n v = JSON.stringify(supplyFunc())\n cache.put(key, v, 2*60*60) // 缓存 2h\n }\n return JSON.parse(v)\n}\nfunction isJsonString(str) {\n try {\n if (typeof JSON.parse(str) === \"object\") {\n return true\n }\n } catch(e) {}\n return false\n}\nfunction getAjaxJson(url) {\n const {java, cache} = this\n return cacheGetAndSet(cache, url, () => {\n return JSON.parse(java.ajax(url))\n })\n}\nfunction getAjaxAllJson(urls) {\n const {java, cache} = this\n return cacheGetAndSet(cache, urls, () => {\n return java.ajaxAll(urls).map(resp => JSON.parse(resp.body()).body)\n })\n}\nfunction getWebviewJson(url, parseFunc) {\n const {java, cache} = this\n return cacheGetAndSet(cache, url, () => {\n let html = java.webView(null, url, null)\n return JSON.parse(parseFunc(html))\n })\n}\n\nfunction isLogin() {\n const {java} = this\n let cookie = String(java.getCookie(\"https://www.pixiv.net/\", null))\n return cookie.includes(\"first_visit_datetime\")\n}\n\nfunction urlNovelUrl(novelId) {\n return `https://www.pixiv.net/novel/show.php?id=${novelId}`\n}\nfunction urlNovelDetailed(novelId) {\n return `https://www.pixiv.net/ajax/novel/${novelId}`\n}\nfunction urlNovelsDetailed(userId, nidList) {\n return `https://www.pixiv.net/ajax/user/${userId}/novels?${nidList.map(v => \"ids[]=\" + v).join(\"&\")}`\n}\nfunction urlNovelComments(novelId, offset, limit) {\n return `https://www.pixiv.net/ajax/novels/comments/roots?novel_id=${novelId}&offset=${offset}&limit=${limit}&lang=zh`\n}\nfunction urlNovelCommentsReply(commentId, page) {\n return `https://www.pixiv.net/ajax/novels/comments/replies?comment_id=${commentId}&page=${page}&lang=zh`\n}\n\nfunction urlSeriesUrl(seriesId) {\n return `https://www.pixiv.net/novel/series/${seriesId}`\n}\nfunction urlSeriesDetailed(seriesId) {\n return `https://www.pixiv.net/ajax/novel/series/${seriesId}?lang=zh`\n}\nfunction urlSeriesNovelsTitles(seriesId) {\n return `https://www.pixiv.net/ajax/novel/series/${seriesId}/content_titles`\n}\nfunction urlSeriesNovels(seriesId, limit, offset) {\n if (limit > 30) limit = 30\n if (limit < 10) limit = 10\n return `https://www.pixiv.net/ajax/novel/series_content/${seriesId}?limit=${limit}&last_order=${offset}&order_by=asc&lang=zh`\n}\n\nfunction urlUserWorkLatest(userID) {\n return `https://www.pixiv.net/ajax/user/${userID}/works/latest`\n}\nfunction urlUserAllWorks(userId) {\n return `https://www.pixiv.net/ajax/user/${userId}/profile/all?lang=zh`\n}\n\nfunction urlSearchNovel(novelName, page) {\n return `https://www.pixiv.net/ajax/search/novels/${novelName}?word=${novelName}&order=date_d&mode=all&p=${page}&s_mode=s_tag&lang=zh`\n}\nfunction urlSearchSeries(seriesName, page) {\n return`https://www.pixiv.net/ajax/search/novels/${seriesName}?word=${seriesName}&order=date_d&mode=all&p=${page}&s_mode=s_tag&gs=1&lang=zh`\n}\n// 不完全匹配用户名\nfunction urlSearchUser(userName, full) {\n if (full === undefined || full === false) {\n return `https://www.pixiv.net/search/users?nick=${userName}&s_mode=s_usr&nick_mf=1`\n } else {\n return `https://www.pixiv.net/search/users?nick=${userName}&s_mode=s_usr_full&i=1`\n }\n}\n\nfunction urlCoverUrl(url) {\n return `${url}, {\"headers\": {\"Referer\":\"https://www.pixiv.net/\"}}`\n}\nfunction urlIllustDetailed(illustId) {\n return `https://www.pixiv.net/ajax/illust/${illustId}?lang=zh`\n}\nfunction urlIllustOriginal(illustId, order) {\n const {java, cache} = this\n if (order <= 1) order = 1\n let url = urlIllustDetailed(illustId)\n let illustOriginal = cacheGetAndSet(cache, url, () => {\n return JSON.parse(java.ajax(url))\n }).body.urls.original\n return urlCoverUrl(illustOriginal.replace(`_p0`, `_p${order - 1}`))\n}\n\nfunction urlMessageThreadLatest(max) {\n if (max === undefined || max <= 5) max = 5\n return `https://www.pixiv.net/rpc/index.php?mode=latest_message_threads2&num=${max}&lang=zh`\n}\nfunction urlMessageThreadContents(threadId, max) {\n return `https://www.pixiv.net/rpc/index.php?mode=message_thread_contents&thread_id=${threadId}&num=${max}`\n}\nfunction urlMessageThreadDetail(threadId) {\n return `https://www.pixiv.net/rpc/index.php?mode=message_thread&thread_id=${threadId}`\n}\nfunction urlNotification() {\n return `https://www.pixiv.net/ajax/notification&lang=zh`\n}\n\nfunction dateFormat(str) {\n let addZero = function (num) {\n return num < 10 ? '0' + num : num;\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}\nfunction timeTextFormat(text) {\n return `${text.slice(0, 10)} ${text.slice(11, 19)}`\n}\nfunction sleep(time) {\n let endTime = new Date().getTime() + time\n while(true){\n if (new Date().getTime() > endTime){\n return;\n }\n }\n}\nfunction sleepToast(text, second) {\n const {java} = this\n java.log(text)\n java.longToast(text)\n if (second === undefined || second <= 2) {second = 2}\n sleep(1000*second)\n}\n\nfunction updateSource(){\n return () => {\n const {java, source} = this;\n let updateUrl = \"https://cdn.jsdelivr.net/gh/windyhusky/PixivSource@main/pixiv.json\"\n let onlineSource = JSON.parse(java.get(updateUrl,{'User-Agent': 'Mozilla/5.0 (Linux; Android 14)','X-Requested-With': 'XMLHttpRequest'}).body())[0] // 第1个书源\n let comment = onlineSource.bookSourceComment.split(\"\\n\")\n\n let htm = `data:text/html; charset=utf-8,\n\n
\n \n 更新 ${source.bookSourceName} 书源\n \n\n\n\n \n | ${source.bookSourceName} 书源 🔰 使用教程 | \n | ☁️ 远程仓库版本:${java.timeFormat(onlineSource.lastUpdateTime)} |
\n | 📥 阅读本地版本:${java.timeFormat(source.lastUpdateTime)} |
\n ${comment.slice(2,9).join(\" \")} |
\n ${comment.slice(comment.length-7, comment.length).join(\" \")} |
\n
\n \n \n \n \n | 更新 ${source.bookSourceName} 书源 | \n | \n \n | \n
\n \n | \n \n | \n
\n
\n\n`;\n java.startBrowser(htm,'更新');\n return []\n }\n}",
"lastUpdateTime": 1748102400251,
"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 java.log(String(source.bookSourceComment).split(\"\\n\")[0]) // 输出书源信息\n java.log(`本地书源更新时间:${java.timeFormat(source.lastUpdateTime)}`) // 输出书源信息\n settings = JSON.parse(String(source.variableComment).match(RegExp(/{([\\s\\S]*?)}/gm)))\n if (settings !== null) {\n java.log(\"⚙️ 使用自定义设置\")\n } else {\n settings = {}\n settings.CONVERT_CHINESE = true // 搜索:搜索时进行繁简转换\n settings.MORE_INFORMATION = false // 详情:书籍简介显示更多信息\n settings.SHOW_UPDATE_TIME = true // 目录:显示更新时间,但会增加少许请求\n settings.SHOW_ORIGINAL_LINK = true // 目录:显示原始链接,但会增加大量请求\n settings.REPLACE_TITLE_MARKS = true // 正文:注音内容为汉字时,替换为书名号\n settings.SHOW_CAPTIONS = true // 正文:章首显示描述\n settings.SHOW_COMMENTS = true // 正文:章尾显示评论\n settings.FAST = false // 全局:快速模式\n settings.DEBUG = false // 全局:调试模式\n java.log(\"⚙️ 使用默认设置(无自定义设置 或 自定义设置有误)\")\n }\n u.CONVERT_CHINESE = settings.CONVERT_CHINESE\n u.MORE_INFORMATION = settings.MORE_INFORMATION\n u.SHOW_UPDATE_TIME = settings.SHOW_UPDATE_TIME\n u.SHOW_ORIGINAL_LINK = settings.SHOW_ORIGINAL_LINK\n u.REPLACE_TITLE_MARKS = settings.REPLACE_TITLE_MARKS\n u.SHOW_CAPTIONS = settings.SHOW_CAPTIONS\n u.SHOW_COMMENTS = settings.SHOW_COMMENTS\n u.FAST = settings.FAST\n u.DEBUG = settings.DEBUG\n\n if (u.FAST === true) {\n u.CONVERT_CHINESE = false // 搜索:繁简通搜\n u.SHOW_UPDATE_TIME = true // 目录:显示章节更新时间\n u.SHOW_ORIGINAL_LINK = false // 目录:显示章节源链接\n u.SHOW_COMMENTS = true // 正文:\n }\n if (u.DEBUG === true) {\n java.log(JSON.stringify(settings, null, 4))\n java.log(`DEBUG = ${u.DEBUG}`)\n }\n u.debugFunc = (func) => {\n if (util.DEBUG) {\n func()\n }\n }\n\n // 将多个长篇小说解析为一本书\n u.combineNovels = function (novels) {\n return novels.filter(novel => {\n // 单本直接解析为一本书\n if (novel.seriesId === undefined || novel.seriesId === null) {\n return true\n }\n // 集合中没有该系列解析为一本书\n if (!seriesSet.has(novel.seriesId)) {\n seriesSet.add(novel.seriesId)\n return true\n }\n return false\n })\n }\n\n // 处理 novels 列表\n u.handNovels = function (novels, detailed=false) {\n novels.forEach(novel => {\n // novel.id = novel.id\n // novel.title = novel.title\n // novel.userName = novel.userName\n // novel.userId = novel.userId\n // novel.tags = novel.tags\n cache.put(`${novel.userName}`, novel.userId) // 加入缓存,便于搜索作者\n if (novel.tags === undefined || novel.tags === null) {\n novel.tags = []\n }\n // 默认搜索\n if (novel.isOneshot === undefined) {\n // novel.seriesId = novel.seriesId\n // novel.seriesTitle = novel.seriesTitle\n // novel.textCount = novel.textCount\n // novel.description = novel.description\n novel.coverUrl = novel.url\n // novel.createDate = novel.createDate\n // novel.updateDate = novel.updateDate\n } else { // 搜索系列\n if (novel.isOneshot === true) {\n novel.seriesId = undefined\n novel.id = novel.novelId // 获取真正的 novelId\n novel.seriesTitle = undefined\n } else {\n novel.seriesId = novel.id\n novel.id = novel.novelId= novel.latestEpisodeId // 获取真正的 novelId\n novel.seriesTitle = novel.title\n }\n novel.textCount = novel.textLength\n novel.description = novel.caption\n novel.coverUrl = novel.cover.urls[\"480mw\"]\n novel.createDate = novel.createDateTime\n novel.updateDate = novel.updateDateTime\n }\n\n // 正文详情页\n if (novel.content !== undefined) {\n novel.novelId = novel.id\n novel.tags = novel.tags.tags.map(item => item.tag)\n novel.textCount = novel.userNovels[`${novel.id}`].textCount\n // novel.latestChapter = novel.title\n // novel.description = novel.description\n novel.coverUrl = novel.userNovels[`${novel.id}`].url\n // novel.createDate = novel.createDate\n novel.updateDate = novel.uploadDate\n if (novel.seriesNavData !== undefined && novel.seriesNavData !== null) {\n novel.seriesId = novel.seriesNavData.seriesId\n novel.seriesTitle = novel.seriesNavData.title\n }\n }\n // 系列详情\n if (novel.firstNovelId !== undefined) {\n novel.seriesId = novel.id\n novel.id = novel.novelId = novel.firstNovelId\n novel.seriesTitle = novel.title\n novel.coverUrl = novel.cover.urls[\"480mw\"]\n }\n\n if (novel.seriesId === undefined || novel.seriesId === null) { // 单篇\n novel.tags.unshift(\"单本\")\n novel.latestChapter = novel.title\n novel.detailedUrl = urlNovelDetailed(novel.id)\n }\n if (novel.seriesId !== undefined && detailed === false) {\n novel.id = novel.seriesId\n novel.firstNovelId = novel.novelId\n novel.title = novel.seriesTitle\n novel.tags.unshift(\"长篇\")\n novel.detailedUrl = urlSeriesDetailed(novel.seriesId)\n // novel.seriesNavData = {}\n // novel.seriesNavData.seriesId = novel.seriesId\n // novel.seriesNavData.title = novel.seriesTitle\n }\n\n if (novel.seriesId !== undefined && detailed === true) {\n let series = getAjaxJson(urlSeriesDetailed(novel.seriesId)).body\n novel.id = series.firstNovelId\n novel.title = series.title\n // novel.userName = novel.userName\n novel.tags = novel.tags.concat(series.tags)\n novel.tags.unshift(\"长篇\")\n novel.textCount = series.publishedTotalCharacterCount\n novel.description = series.caption\n novel.coverUrl = series.cover.urls[\"480mw\"]\n\n // 发送请求获取第一章 获取标签与简介\n let firstNovel = {}\n try {\n firstNovel = getAjaxJson(urlNovelDetailed(series.firstNovelId)).body\n novel.tags = novel.tags.concat(firstNovel.tags.tags.map(item => item.tag))\n } catch (e) { // 防止系列首篇无权限获取\n try {\n firstNovel = getAjaxJson(urlSeriesNovels(novel.seriesId, 30, 0)).body.thumbnails.novel[0]\n novel.id = novel.firstNovelId = firstNovel.id\n novel.tags = novel.tags.concat(firstNovel.tags)\n } catch (e) { // 防止系列首篇无权限获取\n firstNovel = {}\n firstNovel.description = \"\"\n }\n }\n novel.tags.unshift(\"长篇\")\n if (novel.description === \"\") {\n novel.description = firstNovel.description\n }\n }\n // delete novel.titleCaptionTranslation\n // delete novel.genre\n // delete novel.profileImageUrl\n // delete novel.bookmarkCount\n // delete novel.isConcluded\n // delete novel.isWatched\n // delete novel.isNotifying\n // delete novel.wordCount\n // delete novel.publishedTextLength\n // delete novel.publishedWordCount\n // delete novel.publishedReadingTime\n // delete novel.useWordCount\n // delete novel.aiType\n // delete novel.isOriginal\n // delete novel.cover\n // delete novel.titleCaptionTranslation\n })\n util.debugFunc(() => {\n java.log(`处理小说完成`)\n })\n return novels\n }\n\n // 小说信息格式化\n u.formatNovels = function (novels) {\n novels.forEach(novel => {\n novel.title = novel.title.replace(RegExp(/^\\s+|\\s+$/g), \"\")\n novel.coverUrl = urlCoverUrl(novel.coverUrl)\n novel.readingTime = `${novel.readingTime / 60} 分钟`\n novel.createDate = dateFormat(novel.createDate);\n novel.updateDate = dateFormat(novel.updateDate);\n\n novel.tags2 = []\n for (let i in novel.tags) {\n let tag = novel.tags[i]\n if (tag.includes(\"/\")) {\n let tags = tag.split(\"/\")\n novel.tags2 = novel.tags2.concat(tags)\n } else {\n novel.tags2.push(tag)\n }\n }\n novel.tags = Array.from(new Set(novel.tags2))\n novel.tags = novel.tags.join(\",\")\n\n if (util.MORE_INFORMATION) {\n novel.description = `\\n书名:${novel.title}\\n作者:${novel.userName}\\n标签:${novel.tags}\\n上传:${novel.createDate}\\n更新:${novel.updateDate}\\n简介:${novel.description}`\n } else {\n novel.description = `\\n${novel.description}\\n上传时间:${novel.createDate}\\n更新时间:${novel.updateDate}`\n }\n })\n return novels\n }\n\n // 正文,详情,搜索:从网址获取id,返回单篇小说 res,系列返回首篇小说 res\n // pixiv 默认分享信息中有#号,不会被识别成链接,无法使用添加网址\n u.getNovelRes = function (result) {\n let novelId = 0, res = {\"body\": {}}\n let isJson = isJsonString(result)\n let isHtml = result.startsWith(\"\")\n\n if (!isJson && isHtml) {\n let id = baseUrl.match(new RegExp(\"\\\\d+\"))[0]\n let pattern = \"(https?://)?(www\\\\.)?pixiv\\\\.net/novel/series/\\\\d+\"\n let isSeries = baseUrl.match(new RegExp(pattern))\n if (isSeries) {\n java.log(`系列ID:${id}`)\n try {\n novelId = getAjaxJson(urlSeriesDetailed(id)).body.firstNovelId\n } catch (e) {\n novelId = getAjaxJson(urlSeriesNovels(id, 30, 0)).body.thumbnails.novel[0].id\n }\n } else {\n let pattern = \"(https?://)?(www\\\\.)?pixiv\\\\.net/novel/(show\\\\.php\\\\?id=)?\\\\d+\"\n let isNovel = baseUrl.match(new RegExp(pattern))\n if (isNovel) {\n novelId = id\n }\n }\n }\n if (isJson) {\n res = JSON.parse(result)\n }\n\n if (novelId) {\n java.log(`匹配小说ID:${novelId}`)\n res = getAjaxJson(urlNovelDetailed(novelId))\n }\n if (res.error === true) {\n java.log(`无法从 Pixiv 获取当前小说`)\n java.log(JSON.stringify(res))\n }\n return res.body\n }\n\n // 目录:从网址获取id,尽可能返回系列 res,单篇小说返回小说 res\n u.getNovelResSeries = function (result) {\n let seriesId = 0, res = {\"body\": {}}\n let isJson = isJsonString(result)\n let isHtml = result.startsWith(\"\")\n\n if (!isJson && isHtml) {\n let id = baseUrl.match(new RegExp(\"\\\\d+\"))[0]\n let pattern = \"(https?://)?(www\\\\.)?pixiv\\\\.net/novel/series/\\\\d+\"\n let isSeries = baseUrl.match(new RegExp(pattern))\n if (isSeries) {\n seriesId = id\n } else {\n let pattern = \"(https?://)?(www\\\\.)?pixiv\\\\.net/novel/(show\\\\.php\\\\?id=)?\\\\d+\"\n let isNovel = baseUrl.match(new RegExp(pattern))\n if (isNovel) {\n java.log(`匹配小说ID:${id}`)\n res = getAjaxJson(urlNovelDetailed(id))\n }\n }\n }\n if (isJson) {\n res = JSON.parse(result)\n }\n\n if (res.body !== undefined && res.body.seriesNavData !== undefined && res.body.seriesNavData !== null) {\n seriesId = res.body.seriesNavData.seriesId\n }\n if (seriesId) {\n java.log(`系列ID:${seriesId}`)\n res = getAjaxJson(urlSeriesDetailed(seriesId))\n }\n if (res.error === true) {\n java.log(`无法从 Pixiv 获取当前小说`)\n java.log(JSON.stringify(res))\n }\n return res.body\n }\n\n util = u\n java.put(\"util\", objStringify(u))\n}\n\nfunction checkMessageThread(checkTimes) {\n if (checkTimes === undefined) {\n checkTimes = Number(cache.get(\"checkTimes\"))\n }\n if (checkTimes === 0 && isLogin()) {\n let latestMsg = getAjaxJson(urlMessageThreadLatest(5))\n if (latestMsg.error === true) {\n java.log(JSON.stringify(latestMsg))\n } else if (latestMsg.body.total >= 1) {\n let msg = latestMsg.body.message_threads.filter(item => item.thread_name === \"pixiv事務局\")[0]\n if (msg !== undefined && new Date().getTime()- 1000*msg.modified_at <= 3*24*60*60*1000) { // 3天内进行提示\n sleepToast(`您于 ${java.timeFormat(1000*msg.modified_at)} 触发 Pixiv 【过度访问】,请修改密码并重新登录。\\n如已修改请忽略`, 3)\n sleepToast(`${msg.latest_content}`, 5)\n java.startBrowser(\"https://accounts.pixiv.net/password/change\",'修改密码')\n }\n }\n }\n cache.put(\"checkTimes\", checkTimes + 1, 4*60*60) // 缓存4h,每4h提醒一次\n // cache.put(\"checkTimes\", checkTimes + 1, 60) // 测试用,缓存60s,每分钟提醒一次\n // java.log(checkTimes + 1)\n}\n\npublicFunc()\nif (!util.FAST) checkMessageThread()\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": "userName",
"canReName": "true",
"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\nfunction novelHandler(novel){\n novel = util.formatNovels(util.handNovels([novel], true))[0]\n if (novel.seriesId === undefined || novel.seriesId === null) {\n novel.detailedUrl = urlNovelUrl(novel.id)\n novel.catalogUrl = urlNovelDetailed(novel.id)\n } else {\n novel.detailedUrl = urlSeriesUrl(novel.seriesId)\n novel.catalogUrl = urlSeriesDetailed(novel.seriesId)\n }\n return novel\n}\n\n(() => {\n return novelHandler(util.getNovelRes(result))\n})()",
"intro": "description",
"kind": "tags",
"lastChapter": "latestChapter",
"name": "title",
"tocUrl": "catalogUrl",
"wordCount": "textCount"
},
"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\nfunction getContent(res) {\n let content = String(res.content)\n // let content = \"undefined\"\n if (content.includes(\"undefined\")) {\n return checkContent()\n }\n\n // 在正文内部添加小说描述\n if (util.SHOW_CAPTIONS === true && 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 content = content.replace(`[uploadedimage:${key}]`, `
`)\n })\n }\n\n // 获取 [pixivimage:] 的图片链接 [pixivimage:1234] [pixivimage:1234-1]\n let matched = content.match(RegExp(/\\[pixivimage:(\\d+)-?(\\d+)]/gm))\n if (matched) {\n matched.forEach(pixivimage => {\n let matched2, illustId, order = 0\n if (pixivimage.includes(\"-\")) {\n matched2 = pixivimage.match(RegExp(\"(\\\\d+)-(\\\\d+)\"))\n illustId = matched2[1]; order = matched2[2]\n } else {\n matched2 = pixivimage.match(RegExp(\"\\\\d+\"))\n illustId = matched2[0];\n }\n content = content.replace(`${pixivimage}`, `
`)\n })\n }\n\n // 替换 Pixiv 分页标记符号 [newpage]\n matched = content.match(RegExp(/[ ]*\\[newpage][ ]*/gm))\n if (matched) {\n for (let i in matched) {\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]}`, `${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\n if (!util.REPLACE_TITLE_MARKS) {\n // 默认替换成(括号)\n content = content.replace(`${matchedText}`, `${kanji}(${kana})`)\n } else {\n let reg = RegExp(\"[\\\\u4E00-\\\\u9FFF]+\", \"g\");\n if (reg.test(kana)) {\n // kana为中文,则替换回《书名号》\n content = content.replace(`${matchedText}`, `${kanji}《${kana}》`)\n } else {\n // 阅读不支持