Hitomi stopped working since a few days (I didn't try to download for a few days and today every link are "offline" instead of detecting the pages.).
I'll try to see why, but I don't know sh*t about java, so I won't fix it, just try to help find the problem.
EDIT :
Here are my notes from quick look
ProgressController argument used is deprecated (just saying, I don't thing that's the problem)
I guess the "Offline Files" in Hitomi plugin comes from these lines
Code:
decryptedLinks.add(createOfflinelink(parameter));
return decryptedLinks;
If that's the case, one possible reason could be these lines
Code:
final String js = br.getRegex("src\\s*=\\s*\"([^\"]+" + gallery_id + "\\.js)\"").getMatch(0);
if (js == null) {
logger.info("Seems like this is no downloadable/supported content");
decryptedLinks.add(createOfflinelink(parameter));
return decryptedLinks;
}
Not sure but I guess this code will search for a html tag with the "*gallery_id*.js" as a src attribute ?
From what I see in galleries and reader page this script tag doesn't exist.
On the Reader page, they load "*gallerie_id*.js" from jquery at this url :
Code:
**External links are only visible to Support Staff**
the "ltn" part is fixed for prod server
Code:
var domain = (/^dev\./.test(document.location.hostname.toString()) ? 'dev' : 'ltn')+'.hitomi.la';
and the rest of the URL too
Code:
var result = window.location.href.match(/\/reader\/([0-9]+)\.html/);
var galleryid = result[1];
$.getScript('//'+domain+'/galleries/'+galleryid+'.js' ...
example what I mean with "reader page" : **External links are only visible to Support Staff****External links are only visible to Support Staff**
example what I mean with "galleries page" : **External links are only visible to Support Staff****External links are only visible to Support Staff**
There are also some changes in method "copied" from their js
Code:
private String url_from_url_from_hash(String galleryid, Map<String, String> image, String dir, String ext, String base) throws Exception {
//NEW (JS)
if ('tn' === base) {
return url_from_url('**External links are only visible to Support Staff**+dir+'/'+real_full_path_from_hash(image.hash)+'.'+ext, base);
}
//ENDNEW
return url_from_url(url_from_hash(galleryid, image, dir, ext), base);
}
New method "real_full_path_from_hash"
Code:
function real_full_path_from_hash(hash) {
return hash.replace(/^.*(..)(.)$/, '$2/$1/'+hash);
}
Code:
private String url_from_hash(String galleryid, Map<String, String> image, String dir, String ext) throws Exception {
//CHANGE JS - not sure the "split" part is equivalent, guess the java part shoud be just "split(".")" too ?
ext = ext || dir || image.name.split('.').pop();
//CHANGE JAVA (existing)
ext = isNotBlank(ext) ? ext : (isNotBlank(dir) ? dir : last(image.get("name").split("\\.")));
//ENDCHANGE
dir = isNotBlank(dir) ? dir : "images";
return "**External links are only visible to Support Staff** + dir + '/' + full_path_from_hash(image.get("hash")) + '.' + ext;
}
The whole subdomain_from_url function is too different from the JS one in hitomi sources, so I can't say for sure there is no changes
Also it seems the "base" variable is always "a" and "dir" variable is either "webp" or "avif" now, but seems "webp" will always work.
(from what I can see in JDownloader sources, it was null before)
(see in reader.js, search for "url_from_url_from_hash(", the only calls without "a" as base variable
That was a really quick look though, I hope I wasn't too confusing and this will help.