fix: Bug Fixes and Feature Improvements to Linovelib Plugin (#1984)
* fix(linovelib): Searching not work * ci: fix branch cannot be correctly identified in forked environment * fix: BRANCH cannot be identified * fix(linovelib): correctly get cover image in redirect case of searching * fix: why we need a prefix slash here? remove it * chore(linovelib): update linovelib plugin version * fix: before LNReader puts its default UA to chrome, forcely set LNReader plugin's UA to Chrome's UA * refactor: intgrates FetchInit into plugin * feat: add chapter name transform * feat(linovelib): add decryptor for shuffle scramble of original html * feat(linovelib): use external server to extract shuffle coefficients * fix(linovelib): extract author name more precisely * fix(linovelib): set Referer header to bypass anti-leeching/hotlinking of image source Also, use LocalStorage to store coefficients and chapter.js version * refactor: delete FetchInit definition in this plugin * fix(linovelib): replace localStorage with storage utility for better data management * fix(linovelib): update storage import path to use the correct library * feat(linovelib): Implement chapter number * refactor(linovelib): as mobile site equipped with strong cloudflare challenge, move most of parsing logic to LDS server * fix(linovelib): update API calls to use query parameters instead of POST requests for novel, chapter, and search endpoints * fix(linovelib): add caching mechanism for novel and chapter parsing to reduce API calls * refactor(linovelib): refactor server URL handling to use class property for API requests * fix: apply changes pointed by review * docs(linovelib): make some comments
This commit is contained in:
@@ -10,13 +10,14 @@ const REMOTE = execSync('git remote get-url origin')
|
||||
const CURRENT_BRANCH = execSync('git branch --show-current')
|
||||
.toString()
|
||||
.replace(/[\s\n]/g, '');
|
||||
const BRANCH = process.env.BRANCH ? process.env.BRANCH : CURRENT_BRANCH;
|
||||
const matched = REMOTE.match(/([^:/]+?)\/([^/.]+)(\.git)?$/);
|
||||
if (!matched) throw Error('Cant parse git url');
|
||||
const USERNAME = matched[1];
|
||||
const REPO = matched[2];
|
||||
const USER_CONTENT_LINK = process.env.USER_CONTENT_BASE
|
||||
? process.env.USER_CONTENT_BASE
|
||||
: `https://raw.githubusercontent.com/${USERNAME}/${REPO}/${CURRENT_BRANCH}`;
|
||||
: `https://raw.githubusercontent.com/${USERNAME}/${REPO}/${BRANCH}`;
|
||||
|
||||
const STATIC_LINK = `${USER_CONTENT_LINK}/public/static`;
|
||||
// Use legacy .js/src/plugins path for backward compatibility
|
||||
|
||||
Reference in New Issue
Block a user