Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recognize v2.mangapark URLs #1578

Merged
merged 2 commits into from
May 26, 2021
Merged

recognize v2.mangapark URLs #1578

merged 2 commits into from
May 26, 2021

Conversation

thatfuckingbird
Copy link
Contributor

URLs like https://www.mangapark.net/manga/aria are redirected now to the v2 subdomain: https://v2.mangapark.net/manga/aria
This patch makes gallery-dl recognize these v2.mangapark URLs.

Looks like there is a "v3 beta" version of the site now, which has become the default. I don't really use the site so I did not investigate further compatibility with v3 beyond seeing that the URL formats are different. For now, the extractor seems to work fine with the v2 version.

@rautamiekka
Copy link
Contributor

Better make it a RegEx so that if they ever go further there's less to fix.

@thatfuckingbird
Copy link
Contributor Author

Better make it a RegEx so that if they ever go further there's less to fix.

Not sure about this... The v3 version is likely already incompatible, so accepting any subdomain won't really help (not that I know of any other they use anyway).

@rautamiekka
Copy link
Contributor

It's less of a problem to have the software use RegEx to detect whatever version the domain will use (which is obviously what I meant) than someone having to come back to edit it later. It's a much more useful futureproofing than assuming they won't upgrade later.

v(?:er(?:sion)?)?[0-9]+

@thatfuckingbird
Copy link
Contributor Author

It's less of a problem to have the software use RegEx to detect whatever version the domain will use (which is obviously what I meant) than someone having to come back to edit it later. It's a much more useful futureproofing than assuming they won't upgrade later.

v(?:er(?:sion)?)?[0-9]+

The current code likely won't be able to handle further versions of the site anyway without updating, so accepting subdomains of future versions should not be done as it will lead to accepted URLs that fail to parse. The regex should be updated together with the rest of the extractor code, so whatever gets matched can also be parsed.

Note that v2 is not the new version of the site. It is the old one, that gallery-dl can currently parse. So this subdomain is unlikely to change.

@mikf
Copy link
Owner

mikf commented May 26, 2021

You should change line 20 to https://v2.mangapark.{} so it internally uses the v2 domain without getting redirected.

@thatfuckingbird
Copy link
Contributor Author

done

@mikf mikf merged commit 264beb8 into mikf:master May 26, 2021
@rautamiekka
Copy link
Contributor

It's less of a problem to have the software use RegEx to detect whatever version the domain will use (which is obviously what I meant) than someone having to come back to edit it later. It's a much more useful futureproofing than assuming they won't upgrade later.

v(?:er(?:sion)?)?[0-9]+

The current code likely won't be able to handle further versions of the site anyway without updating, so accepting subdomains of future versions should not be done as it will lead to accepted URLs that fail to parse. The regex should be updated together with the rest of the extractor code, so whatever gets matched can also be parsed.

Note that v2 is not the new version of the site. It is the old one, that gallery-dl can currently parse. So this subdomain is unlikely to change.

Fair enough, that makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants