feat: implement Hitomi.la scraper with dynamic gg.js parsing and image proxy integration
This commit is contained in:
1 parent
18ea6596e5
commit
3bad81169e
21 files changed
+6824
-4
No files matched your search
@@ -0,0 +1,25 @@
|
||||
const fs = require('fs');
|
||||
let commonJs = fs.readFileSync('scratch/common.js', 'utf8');
|
||||
let ggJs = fs.readFileSync('scratch/gg.js', 'utf8');
|
||||
let galleryJs = fs.readFileSync('scratch/gallery_4159707.js', 'utf8');
|
||||
|
||||
global.document = { location: { hostname: 'hitomi.la' } };
|
||||
global.window = global;
|
||||
global.navigator = { platform: 'Win32', userAgent: 'Chrome' };
|
||||
global.gg = {};
|
||||
global.$ = function() { return { ready: function() {}, on: function() {}, remove: function() {} }; };
|
||||
global.$.ajax = function() {};
|
||||
|
||||
eval(commonJs);
|
||||
eval(ggJs);
|
||||
eval(galleryJs);
|
||||
|
||||
console.log("Gallery Title:", galleryinfo.title);
|
||||
|
||||
const imgUrlWebp = url_from_url_from_hash(galleryinfo.id, galleryinfo.files[0], 'webp');
|
||||
const imgUrlAvif = url_from_url_from_hash(galleryinfo.id, galleryinfo.files[0], 'avif');
|
||||
const thumbUrl = url_from_url_from_hash(galleryinfo.id, galleryinfo.files[0], 'webp', 'webp', 'tn');
|
||||
|
||||
console.log("WebP URL:", imgUrlWebp);
|
||||
console.log("Avif URL:", imgUrlAvif);
|
||||
console.log("Thumb URL:", thumbUrl);
|
||||
Reference in new issue
Block a user