s25g5d4 / e-hentai-retriever Goto Github PK
View Code? Open in Web Editor NEWe-hentai.org image link retriever & auto-pager
License: MIT License
e-hentai.org image link retriever & auto-pager
License: MIT License
When large thumbnail settings is enabled, parsing image URL will fail.
Generally, retrieving more than 60 pages would result in a status code 429 error in "loadPage" of EhRetriever.retrieve(). Maybe we should add some sleeping mechanism.
A naive version:
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
let fetchPage;
try {
const url = `${this.ehentaiHost}/api.php`;
const config = {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
// assign e = {'imgkey': ..., 'page': ...} to object literal {'method': ..., 'gid': ..., 'showkey': ...}
// does not modify e
body: JSON.stringify(Object.assign({
method: 'showpage',
gid: this.gallery.gid,
showkey: this.showkey
}, e))
};
let response = await this.fetch(url, config);
while (response.status == 429) {
await sleep(30000);
response = await this.fetch(url, config);
}
if (!response.ok) {
throw new Error(response.statusText);
}
fetchPage = await response.json();
} catch (error) {
console.warn(error);
throw error;
}
using JSZip
It is possible because GM_xmlhttpRequest supports cross origin request and responses with blob.
see 8/10 abysszzz R: [推薦] e-hentai retriever 瀏覽器擴充腳本
g/891300/1776e1146d/
它有32張,我 e-hentai 的設定是只有 4 rows,我選大縮圖,
一row只能顯示5張,4 rows只有20張圖,所以總覽時會有兩頁 < 1 2 >
第一頁有20張圖,在第一頁點進隨便一張圖,
先按 Set Range, default 是 1 到 32 不動,按 Retrieve!
RangeError: invalid stop number: 31, start: 0(…)
trace
case 8:
if (!(stop < start || stop >= this.pages.length || isNaN(stop))) {
_context3.next = 10;
break;
}
throw new RangeError('invalid stop number: ' + stop + ', start: ' + start);
不合的原因是第二個,this.pages.length 是20 (見上述),stop是 31 >= 20
but I'm busy now
QQ
My firefox version is 98.0.1(64 bit) and the e-hentai retriever version is 4.2.0. When I click the "Retrieve!" button, the firefox console shows "GM_xmlhttpRequest is not defined".
According to the StackOverflow, replacing the "GM_xmlhttpRequest " with "GM.xmlHttpRequest" fixed it.
will reduce ~30% size.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.