AllMangasReader-dev / AMR

AllMangasReader developer branch
www.allmangasreader.com
Other
97 stars 54 forks source link

Mangahere latest chapter broken #156

Open Snipeon opened 7 years ago

Snipeon commented 7 years ago

AMR is wrongly updating all Mangahere latest chapters. All the latest chapters from Mangahere seem to have a file:// added in at the beginning.

With ref to here.

Snipeon commented 7 years ago

Seems like Mangafox has also been struck with the same problem.

twluo commented 7 years ago

From what I can tell, it might be because MangaHere just switched to htpps. Would need to change the rule here https://community.allmangasreader.com/latest_v2/MangaHere.js

twluo commented 7 years ago

I am writing a really quick fix for it that is probably going to increase latency but at least it will fix the issue. I can share it once I'm at a point that's worth sharing if you're interested.

twluo commented 7 years ago

Another fix could be changing the .attr("href") to just .href in https://github.com/AllMangasReader-dev/mirrors/blob/master/MangaHere.js. That would make it so that it returns the complete url with the https:// as opposed to just // but I haven't had the chance to test that yet.

Snipeon commented 7 years ago

Nice, good work. Too bad I suck at java.

Meaning that I can't help much.

braiam commented 7 years ago

Nice, good work. Too bad I suck at java.

Actually javascript.

Snipeon commented 7 years ago

Anything with java in the name, I suck at.

Stubbs9410 commented 7 years ago

Hi, sorry to bother, but the chrome extension of All Mangas Reader versions 1.5.10.2 is not working can I know if you will make a new extension, fix I really love this extension been using it a long time and I check github but I don't know Java script. Please respond to the message

jacobmix commented 7 years ago

I use AMR as an unpacked extension, and only thing i've edited is this line of manifest.json: http://prntscr.com/gqh0m7 | And use this to remove the Chrome start popup warning.

Do i have to edit some file with this? https://github.com/AllMangasReader-dev/mirrors/blob/master/MangaHere.js If so what file? If not is there anything else i can do to get the fix?

Edit: Using All Mangas Reader (Beta channel) 1.5.10.2 Pic of the extension folder: http://prntscr.com/gqk68v

twluo commented 7 years ago

So right now I was in the middle of a quick fix which was basically appending https: to every mangahere url since it seems that its returning as //www.mangahere.co/* as opposed to http://ww.mangahere.co. I'm not sure if it has to do with the fact that mangahere switched to https. MY solution fixes the issue but it might create some latency issues. Right now it detects that if you're in the last chapter then there's no new chapter but I'm still having some issue with updating what's the latest chapter. Once I get that part done I will fork it and share it.

twluo commented 7 years ago

From the little investigating I did yesterday night, I noticed that if you go to a mangahere detail page such as https://www.mangahere.co/manga/14_sai_no_koi/ and then you can see from https://github.com/AllMangasReader-dev/mirrors/blob/84c4a8f370b116c9b0edd798116de60067207e1e/MangaHere.js#L52-L54 that it uses .attr('href') to fetch the url. If you go to the detail page and run $(".detail_list ul li span.left a").attr("href"); on the console you will get "//www.mangahere.co/manga/14_sai_no_koi/v02/c035.7/" back. Now if you were to run $(".detail_list ul li span.left a")[0].href then you get "https://www.mangahere.co/manga/14_sai_no_koi/v02/c035.7/" which is the complete url

Same issue on https://github.com/AllMangasReader-dev/mirrors/blob/84c4a8f370b116c9b0edd798116de60067207e1e/MangaHere.js#L75-L77

By using .attr("href") we are getting how they wrote it but if we use .href then we get the absolute path.

twluo commented 7 years ago

https://github.com/twluo/AMR Is a very dirty fix but it gets stuff working. There's still some issues with the counter. It seems that the counter doesn't refresh properly but you can get it to refresh by just reloading the extension.

Snipeon commented 7 years ago

Good job. Though if you are able to grab the correct URL by changing the Mangahere.js, why are you editing the files in the main js folder? Pardon my noobness.

twluo commented 7 years ago

I'm not sure how the mirrors work and I don't really want to spent an entire night investigating it. I try copying the MangaHere.js into my local and try to use the local mirror instead of the repo one but it kept failing so I gave up. Also I just updated my fork and should be able to refresh properly.

Snipeon commented 7 years ago

Nice. Good job.

twluo commented 7 years ago

Did you use my version? Help me test :) If you find any issue besides latency notify me.

Vuzrak commented 7 years ago

On your version I'm having 2 issues, the mark latest chapter as read doesn't seem to be working even with reloading the extension. Also the options button doesn't work and just brings it to "https://options.html/", the options button under chrome://extensions/ does work fine though.

Vuzrak commented 7 years ago

Actually I don't think any of the buttons work anymore in the menu.

Snipeon commented 7 years ago

testing it right now

twluo commented 7 years ago

Maybe I messed up when I was cleaning the code. Because it works on the one I have loaded which was pre-cleaned up. Oh I never used those buttons so I didn't bother testing I know what's wrong. Also the mark latest I might have fixed it on the most recent change. When did you pull my changes?

Snipeon commented 7 years ago

for me no problems yet.

Vuzrak commented 7 years ago

I pulled the 6cfd713 commit.

twluo commented 7 years ago

@Vuzrak I fixed the settings issue. Tried to make it a bit more generic but it didn't work out. So I specify it to MangaHere should work now.

Vuzrak commented 7 years ago

Also to use the mirror locally you would have to host the files yourself and modify the mgEntry.js to get it to work.

Vuzrak commented 7 years ago

Options working now, but the mark as seen still isn't.

twluo commented 7 years ago

I did that but it wasn't working and I didn't really have the energy to look into it. I might try over the weekend. Anyways I can't reproduce the issue with the mark as read. Let me upload the "unclean" code.

Snipeon commented 7 years ago

ok, all Mangahere chapters have to be manually reloaded for there to be a working entry. The old one does not work, AMR would create a new working entry once you load the latest chapter.

However, Mangafox load full chapter option is broken.

twluo commented 7 years ago

What I did was export the mangaList and then use a text editor to change all the urls to have https:// and then re import it.

twluo commented 7 years ago

@Vuzrak have you worked with local mirrors? You could try what I suggested and see if it works.

Vuzrak commented 7 years ago

Weird, the mark read still doesn't work, gonna just try uninstalling extension and reinstalling it.

I tried your changes but they didn't seem to work, it's probably I didn't understand exactly all that was needed.

Vuzrak commented 7 years ago

No luck getting the mark read to work correctly, doesn't work either with the "Mark chapter as read when the full chapter has been downloaded" but other then that everything else seems to work fine so far.

twluo commented 7 years ago

Ok now I modified the MangaHere.js to fix it. This is not a good long term fix since there might be security vulnerabilities but it would be good until they pull the MangaHere.js file and updated it so that it gets recognized by the https://www.mangahere.co url

https://github.com/twluo/AMR/commit/e314df3a29f2f23df35312107ff5976131854f49

twluo commented 7 years ago

I made a pull request for the new MangaHere.js https://github.com/AllMangasReader-dev/mirrors/pull/32

Snipeon commented 7 years ago

Nice! Are you able to do the same thing for Mangafox? Sorry about the trouble.

twluo commented 7 years ago

Well I don't use MangaFox so I don't gain anything... lol But I can try taking a look during the weekend. Btw did you try my latest commit?

Snipeon commented 7 years ago

testing it now. Thanks for the fix!

Snipeon commented 7 years ago

Hmm.. Loading the chapter is a bit slow, though I would say it's more of Mangahere's fault than AMR. However, the chapter lists in the popup are completely broken. No chapters found yet would be shown, whether we import or manually add the manga. Trying to navigate the chapters from the popup, with the exception of the current chapter button, would just open a new tab.

Vuzrak commented 7 years ago

Replacing just the MangaHere.js does get it working again, it'll load the manga but it will only let you see one page at a time not the entire chapter.

Vuzrak commented 7 years ago

Mangahere was timing out quite a bit earlier so I'm sure the slowness was their fault.

Snipeon commented 7 years ago

@Vuzrak is the popup keeping track of your manga lists just fine?

Vuzrak commented 7 years ago

Chapter list in the popup works fine for me, I'm back to using the default dev AMR build though. The pulldown menu for chapters work too.

Snipeon commented 7 years ago

@Vuzrak ok I'll try that

Vuzrak commented 7 years ago

Oh also for running your own mirror you need to add your address to the content_security_policy in the manifest.json also.

Stubbs9410 commented 7 years ago

will there be a fix or a update for the chrome extension for those who don't know java?

Vuzrak commented 7 years ago

It'll be fixed whenever they update the mirrors. And I have no idea on javascript either.

Snipeon commented 7 years ago

@Vuzrak I'm just editing my mgEntry to use twluo's mirrors. Btw, which build of AMR are you using?

@Stubbs9410 hopefully, as soon as bug testing is over and @braiam approves the commit.

twluo commented 7 years ago

I'm using 1.5.10.

@Stubbs9410 You need to add the https://github.com/twluo/AMR/blob/develop/js/mirrors/MangaHere.js to js/Mirrors and then add https://github.com/twluo/AMR/blob/e314df3a29f2f23df35312107ff5976131854f49/js/mgEntry.js#L523-L525 and I think that should be enough. Also not sure if needed but try exporting your list and changing the urls to use https and then import it back. You can also just download https://github.com/twluo/AMR and then Load it into chrome. Not sure if it will work as is on a new machine or if there would be some tinkering involve.

Snipeon commented 7 years ago

@twluo yep, chapter lists does not work for me.

twluo commented 7 years ago

@Snipeon Ok I think I know what's your problem. It was my bad I forgot to push the edit on the manifest.json. In order to support local mirrors you need to add 'unsafe-eval' to the 'content_security_policy' in the manifest. something like this https://github.com/twluo/AMR/blob/380aee7bdddabb585d757bf98e924e3d48e1a901/manifest.json#L81

Snipeon commented 7 years ago

AHHHH... I also see what I have been doing wrong... I was trying to use your github mirrors the whole time... These mirrors... https://github.com/twluo/mirrors

Now it works.... Thanks!