♻️ 书源 id 去掉 ext. 前缀,沿用旧内置源数据

Co-authored-by: Copilot <[email protected]>
This commit is contained in:
GarfieldandCopilot committed 2026-11-16 14:07:45 +08:00
1 parent 6379a117c2
commit 0174664163
15 files changed
+47 -47

No files matched your search

@@ -21,7 +21,7 @@ local Client = {}
local API = "https://api.zhihu.com"
local WEB = "https://www.zhihu.com"
local UA = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
local SOURCE_ID = "ext.zhihu"
local SOURCE_ID = "zhihu"
local CAPTCHA = "https://captcha.zhihu.com/api/v1/captcha"
local CAPTCHA_APP = "lsxNQs26Wva2"
@@ -34,7 +34,7 @@ local CAPTCHA_APP = "lsxNQs26Wva2"
---@return string|nil
function Client.cookie()
local cookie = require("utils.settings").getSource("ext.zhihu").cookie
local cookie = require("utils.settings").getSource("zhihu").cookie
return type(cookie) == "string" and cookie ~= "" and cookie or nil
end
@@ -66,7 +66,7 @@ local function get(url, headers, cb)
local cookie = Client.cookie()
return Request.get(url, opts(withCookie(headers)), function(body, err, res)
if res and tonumber(res.code) == 401 and cookie and cookie == Client.cookie() then
cb(nil, require("source.auth").expire("ext.zhihu", _("知乎登录已失效,请重新登录")))
cb(nil, require("source.auth").expire("zhihu", _("知乎登录已失效,请重新登录")))
return
end
cb(body, err)
@@ -377,7 +377,7 @@ function Client.putProgressAsync(section_id, fraction, cb)
["Content-Type"] = "application/json", Referer = WEB .. "/",
})), function(raw, err, res)
if res and tonumber(res.code) == 401 and cookie == Client.cookie() then
cb(nil, require("source.auth").expire("ext.zhihu", _("知乎登录已失效,请重新登录")))
cb(nil, require("source.auth").expire("zhihu", _("知乎登录已失效,请重新登录")))
return
end
local wire = decode(raw)