♻️ 书源 id 去掉 ext. 前缀,沿用旧内置源数据
Co-authored-by: Copilot <[email protected]>
This commit is contained in:
1 parent
730b2d6d9f
commit
1acdc500ca
7 files changed
+7
-7
No files matched your search
@@ -7,7 +7,7 @@
|
|||||||
local _ = require("l10n").get("moonsource_qqreader")
|
local _ = require("l10n").get("moonsource_qqreader")
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id = "ext.qqreader",
|
id = "qqreader",
|
||||||
name = _("QQ阅读"),
|
name = _("QQ阅读"),
|
||||||
type = "chapter",
|
type = "chapter",
|
||||||
description = _("QQ阅读书架与在线阅读"),
|
description = _("QQ阅读书架与在线阅读"),
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ local _ = require("l10n").get("moonsource_qqreader")
|
|||||||
|
|
||||||
local Client = {}
|
local Client = {}
|
||||||
|
|
||||||
local SOURCE_ID = "ext.qqreader"
|
local SOURCE_ID = "qqreader"
|
||||||
local WEB = "https://book.qq.com"
|
local WEB = "https://book.qq.com"
|
||||||
local API = WEB .. "/api"
|
local API = WEB .. "/api"
|
||||||
local UA = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) "
|
local UA = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) "
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ local Text = require("utils.text")
|
|||||||
|
|
||||||
local Mapper = {}
|
local Mapper = {}
|
||||||
|
|
||||||
local SOURCE_ID = "ext.qqreader"
|
local SOURCE_ID = "qqreader"
|
||||||
local COVER = "https://wfqqreader-1252317822.image.myqcloud.com/cover/%d/%s/b_%s.jpg"
|
local COVER = "https://wfqqreader-1252317822.image.myqcloud.com/cover/%d/%s/b_%s.jpg"
|
||||||
|
|
||||||
--- 搜索结果页(SSR HTML)→ Book[]:每条是 `<a title=书名 href=…/book-detail/书号>` 后跟简介段。
|
--- 搜索结果页(SSR HTML)→ Book[]:每条是 `<a title=书名 href=…/book-detail/书号>` 后跟简介段。
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ book.qq.com 下的 HTTPS,不能指到 passport。书架页未登录也是 200
|
|||||||
local _ = require("l10n").get("moonsource_qqreader")
|
local _ = require("l10n").get("moonsource_qqreader")
|
||||||
local CookieLogin = require("source.cookie_login")
|
local CookieLogin = require("source.cookie_login")
|
||||||
|
|
||||||
local SOURCE_ID = "ext.qqreader"
|
local SOURCE_ID = "qqreader"
|
||||||
local Setting = {}
|
local Setting = {}
|
||||||
|
|
||||||
---@return boolean
|
---@return boolean
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ package.preload["moonsource_qqreader.client"] = function()
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
local source = require("moonsource_qqreader.source").new()
|
local source = require("moonsource_qqreader.source").new()
|
||||||
local identity = { source_id = "ext.qqreader", stable_id = "9" }
|
local identity = { source_id = "qqreader", stable_id = "9" }
|
||||||
|
|
||||||
do
|
do
|
||||||
source.loadTocAsync = function(_self, _identity, cb)
|
source.loadTocAsync = function(_self, _identity, cb)
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ package.preload["moonsource_qqreader.client"] = function()
|
|||||||
requests[#requests + 1] = path
|
requests[#requests + 1] = path
|
||||||
local idx, page = #requests, tonumber(path:match("(%d+)$"))
|
local idx, page = #requests, tonumber(path:match("(%d+)$"))
|
||||||
local books = {}
|
local books = {}
|
||||||
for item = 1, 20 do books[item] = { source_id = "ext.qqreader", stable_id = tostring((page - 1) * 20 + item) } end
|
for item = 1, 20 do books[item] = { source_id = "qqreader", stable_id = tostring((page - 1) * 20 + item) } end
|
||||||
if delayed and page == 2 then late = function() cb(books) end else cb(books) end
|
if delayed and page == 2 then late = function() cb(books) end else cb(books) end
|
||||||
return { cancel = function() cancelled[idx] = true end }
|
return { cancel = function() cancelled[idx] = true end }
|
||||||
end }
|
end }
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ end
|
|||||||
package.preload["reader.session"] = function() return { current = function() return nil end } end
|
package.preload["reader.session"] = function() return { current = function() return nil end } end
|
||||||
package.preload["book.books_db"] = function()
|
package.preload["book.books_db"] = function()
|
||||||
return { prepareAccountSync = function(id, shelf_add)
|
return { prepareAccountSync = function(id, shelf_add)
|
||||||
Assert.eq(id, "ext.qqreader")
|
Assert.eq(id, "qqreader")
|
||||||
Assert.is_true(shelf_add)
|
Assert.is_true(shelf_add)
|
||||||
Assert.eq(cfg.cookie, "old")
|
Assert.eq(cfg.cookie, "old")
|
||||||
prepared = prepared + 1
|
prepared = prepared + 1
|
||||||
|
|||||||
Reference in new issue
Block a user