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

[e621] Support for e621.cc and e621.anthro.fr #6809

Closed
ClosedPort22 opened this issue Jan 11, 2025 · 0 comments
Closed

[e621] Support for e621.cc and e621.anthro.fr #6809

ClosedPort22 opened this issue Jan 11, 2025 · 0 comments

Comments

@ClosedPort22
Copy link
Contributor

e621.cc and e621.anthro.fr are alternative frontends to e621 with better mobile support. It'd be nice if gallery-dl could recognize these domains as aliases to e621.net.

But there's a problem - both sites have nonstandard URL patterns:

https://e621.net/posts?tags=rating%3Asafe
https://e621.anthro.fr/?q=rating%3Asafe
https://e621.cc/?tags=rating%3Asafe

And although I can add alternative domains to a given instance through pattern, it doesn't seem possible to change the path or query parameter without affecting other instances as well.

I managed to work around this by adding a "proxy" extractor, like so:

class E621FrontendExtractor(Extractor):
    """Extractor for alternative frontends for e621"""
    basecategory = "E621"
    subcategory = "frontend"
    pattern = r"(?:https?://)?(?:e621\.cc/\?tags|e621\.anthro\.fr/\?q)=([^&#]*)"
    example = "https://e621.cc/?tags=TAG"

    def __init__(self, match):
        Extractor.__init__(self, match)
        self.tags = match.group(1)

    def items(self):
        yield Message.Queue, "https://e621.net/posts?tags=" + self.tags, {"_extractor": E621TagExtractor}

But this seems kind of hacky to me, and I'm at a loss for a better solution.


As always, thank you for all the work you have poured into developing and maintaining gallery-dl, @mikf !

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

No branches or pull requests

2 participants