consumet / consumet.ts

Nodejs library that provides high-level APIs for obtaining information on various entertainment media such as books, movies, comic books, anime, manga, and so on.
https://consumet.org/extensions/list/
GNU General Public License v3.0
376 stars 205 forks source link

Fix Megacloud extractVariables for Zoro #521

Closed Kylart closed 2 months ago

Kylart commented 2 months ago

What kind of change does this PR introduce? It seems gogoanime are working on making this difficult or something.

This PR fixes (again) Megacloud extractVariables for Zoro.

Did you add tests for your changes?

If relevant, did you update the documentation?

Summary

Other information Fixes #517

Kylart commented 2 months ago

I wanted to add built files but my yarn build made a ton of file changes even on unrelated files

Kylart commented 2 months ago

@abhishek-exists Can you confirm it's working with these changes?

abhishek-exists commented 2 months ago

Its not reliable @Kylart I used uptime kuma and it seems they change their js code regularly. I found the best regex which is still working for me even during different alterations Let me know if you're still facing issues with it.

allvars =
        text
          .match(/\w{1,2}=new URLSearchParams\(window\[.+?new MobileDetect.+?;(?=function)/gm)
          ?.at(-1) ?? "";

CC: @riimuru

riimuru commented 2 months ago

I just tested it, and it seems to be working fine