AllMangasReader-dev / mirrors

View the magic behind how we control our mirrors and push your contributions.
GNU General Public License v3.0
9 stars 16 forks source link

Mirror Mangafox MangaFox.js not working anymore #25

Closed typhoe closed 7 years ago

typhoe commented 7 years ago

Hi,

as reported in various places, MangaFox mirror is not working anymore. http://community.allmangasreader.com/comments.php?type=2&id=191 http://www.allmangasreader.com/forum/viewtopic.php?f=3&t=4760

When you try to display the whole chapter for any manga, all you get is thumbnails of the cover in place of each images.

Regards.

typhoe commented 7 years ago

Well, I tried to see if I could debug the problem by myself... but to no avail... I don't really know javascript and can't even load the MangaFox.js locally. I tried to follow the instructions but all I get is errors. Here's what I did:

Otherwise, I tried to see what Chromium sees when I try to display a Manga. I tried with http://mangafox.me/manga/azumi/v19/c141/1.html All my browser display is covers from the url http://h.mfcdn.net/store/manga/12852/cover.jpg?token=ac065426311a1fa0366564287183e33d&ttl=1482580800 But if I inspect the page (Ctrl+Maj+I), I see that all the right images are loaded: 1st one: http://h.mfcdn.net/store/manga/12852/19-141.0/compressed/e183012_009_019_130_copy.jpg?token=7ae243c9a7fa132f4043aeac1861c89e&ttl=1482580800 2nd one: http://h.mfcdn.net/store/manga/12852/19-141.0/compressed/e183012_009_019_131_copy.jpg?token=b5a25b10a0084cf8950733104d555449&ttl=1482580800

So something is happening wrongly when displaying, but not when grabbing the images...

That's all I'm able to see so far...

Snipeon commented 7 years ago

hmm..., pretty sure it has something to do with this line of code...

var src = $('#image').attr('src') || $("meta[property='og:image']", div).attr("content").replace(/thumbnails\/(?:mini.)?/, "compressed/"); $(image).attr("src", src);

Linked it for you just in case you wanna take a crack at it. https://github.com/AllMangasReader-dev/mirrors/blob/master/MangaFox.js#L192-L193

well, I'm pretty rusty already, seeing as I have not even coded for the past three years. Have fun~

typhoe commented 7 years ago

Thanks @Snipeon .

That's what I also though after reading the documentation about the functions in the Mirror javascript file.

My problem is that without being able to test anything, it's kind of hard to try to change the code and see the result...

Snipeon commented 7 years ago

you realize you can load a custom AMR to read the mirrors off your computer/own github branch? Here's how to do it...

http://allmangasreader.com/dev.php

typhoe commented 7 years ago

Yes, that's the instructions I tried to follow... As stated in my first post, it doesn't seem to work.

I'm using Arch Linux and Chromium 55.

Snipeon commented 7 years ago

Well, in that case I'll suggest you load the mirrors off your github branch and edit from there. Removes the need to constantly reload the extension as well.

Just change var amrc_repository = "https://community.allmangasreader.com/latest_v2/"; var amrc_root = "https://community.allmangasreader.com/latest_v2/"; var amrc_repository_backup = "https://raw.github.com/AllMangasReader-dev/mirrors/master/";

to var amrc_repository = "https://raw.github.com/typhoe/mirrors/tree/master"; var amrc_root = "https://community.allmangasreader.com/latest_v2/"; var amrc_repository_backup = "https://raw.github.com/typhoe/mirrors/tree/master";

Edited: sorry, as said, I'm pretty rusty after all...

typhoe commented 7 years ago

First, thank you for taking time to try to help me!

So ok, I tried again (I already tried that I think):

cp -prv .config/chromium/Default/Extensions/nhjloagockgobfpopemejpgjjechcpfd ~/AMR-test Then Change mgEntry.js grep "var amrc_root" ~/AMR-test/1.5.10.1_1/js/mgEntry.js //var amrc_root = "https://community.allmangasreader.com/latest_v2/"; var amrc_root = "https://raw.github.com/typhoe/mirrors/tree/master/";

Then in Chromium, activate Dev Mode, and load unpacked extension (previously removed the official extension) And at last, in the plugin, refresh "Websites implementations"

Well, when I look in Chromium Developer Tools, the file MangaFox.js appears loaded from community.allmangasreader.com/latest_v2/ and not from my github repository...

I added a comment on line 2 in the file to see if I'm loading the right one and still not see it... https://github.com/typhoe/mirrors/blob/master/MangaFox.js#L2

If I try to also change the var amrc_repository, the extension doesn't seem to be able to load any mirror.

An other idea?

Snipeon commented 7 years ago

Just change var amrc_repository = "https://community.allmangasreader.com/latest_v2/"; var amrc_root = "https://community.allmangasreader.com/latest_v2/"; var amrc_repository_backup = "https://raw.github.com/AllMangasReader-dev/mirrors/master/";

to var amrc_repository = "https://raw.github.com/typhoe/mirrors/master"; var amrc_root = "https://community.allmangasreader.com/latest_v2/"; var amrc_repository_backup = "https://raw.github.com/typhoe/mirrors/master";

Edited: sorry, as said, I'm pretty rusty after all...

Edited again: Sigh.... I didn't realized I left in a unnecessary part of the url as well... I updated it so that it should work even if u copy pasta the whole thing. Sorry bout that.

If it still doesn't work try these 2 urls: https://rawgit.com/typhoe/mirrors/tree/master https://cdn.rawgit.com/typhoe/mirrors/tree/master

typhoe commented 7 years ago

Ok, I eventually succeed in loading my own copy of the mirror file...

To sum it up:

  1. you need the / at the end of the urls
  2. github won't work whatever url you try to use... (and thus, I don't think the amrc_repository_backup is of any use at all...)
  3. you need to use your own web server allowing the indexes option (to view the files in the directory)

Here are the various tries I did:

`// Original values //var amrc_repository = "https://community.allmangasreader.com/latest_v2/"; //var amrc_root = "https://community.allmangasreader.com/latest_v2/"; //var amrc_repository_backup = "https://raw.github.com/AllMangasReader-dev/mirrors/master/";

// Works !!! Own web server allowing the view of the files in the directory var amrc_repository = "https://allmangasreader.typhoe.com/"; var amrc_root = "https://community.allmangasreader.com/latest_v2/"; var amrc_repository_backup = "https://raw.github.com/AllMangasReader-dev/mirrors/master/";

// Uncaught TypeError: Cannot create property 'jsCode' on string '[' //var amrc_repository = "https://raw.github.com/typhoe/mirrors/master/"; //var amrc_root = "https://community.allmangasreader.com/latest_v2/"; //var amrc_repository_backup = "https://raw.github.com/typhoe/mirrors/master/";

// Uncaught TypeError: Cannot create property 'jsCode' on string '[' //var amrc_repository = "https://raw.githubusercontent.com/typhoe/mirrors/master/"; //var amrc_root = "https://community.allmangasreader.com/latest_v2/"; //var amrc_repository_backup = "https://raw.githubusercontent.com/typhoe/mirrors/master/";

// https://raw.github.com/typhoe/mirrors/masterwebsites.json not found 404 (missing /) //var amrc_repository = "https://raw.github.com/typhoe/mirrors/master"; //var amrc_root = "https://community.allmangasreader.com/latest_v2/"; //var amrc_repository_backup = "https://raw.github.com/typhoe/mirrors/master";

// https://rawgit.com/typhoe/mirrors/tree/master/websites.json not found 404 //var amrc_repository = "https://rawgit.com/typhoe/mirrors/tree/master/"; //var amrc_root = "https://community.allmangasreader.com/latest_v2/"; //var amrc_repository_backup = "https://rawgit.com/typhoe/mirrors/tree/master/";

// https://cdn.rawgit.com/typhoe/mirrors/tree/master/websites.json not found 404 //var amrc_repository = "https://cdn.rawgit.com/typhoe/mirrors/tree/master/"; //var amrc_root = "https://community.allmangasreader.com/latest_v2/"; //var amrc_repository_backup = "https://cdn.rawgit.com/typhoe/mirrors/tree/master/"; `

And now, the hardest part, understanding javascript and finding the error...

Thanks again for trying to help me @Snipeon

typhoe commented 7 years ago

Hi,

I have created a pull request with the solution to the problem. https://github.com/AllMangasReader-dev/mirrors/pull/26

Thanks again @Snipeon for your help!

Regards.