-
-
Notifications
You must be signed in to change notification settings - Fork 996
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
[twitter] add support for nitter.net URLs in pattern #890
Conversation
JFTR, despite the
So possible failures should be unrelated to this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the first 2 lines of each regex pattern now share the same code, could you add a global BASE_PATTERN
value and simplify the regexs like in, for example, DeviantArt and Imgur?
gallery-dl/gallery_dl/extractor/deviantart.py
Lines 22 to 26 in cb0132e
BASE_PATTERN = ( | |
r"(?:https?://)?(?:" | |
r"(?:www\.)?deviantart\.com/([\w-]+)|" | |
r"(?!www\.)([\w-]+)\.deviantart\.com)" | |
) |
gallery-dl/gallery_dl/extractor/imgur.py
Line 15 in cb0132e
BASE_PATTERN = r"(?:https?://)?(?:www\.|[im]\.)?imgur\.com" |
Yes! I was unsure to do that given that there was only an extra domain but that's indeed much more possibly easily factorable if there will be more nitter instances or similar. I will change it in the next couple of minutes and force push to the pull request! |
Thanks @mikf, I have just updated the pull request based on your comment and I will keep an eye on the Travis CI results to spot if there is any possible regression (locally testing them seems fine). |
I think you'll have to put an |
Please note that only URLs are "translated", all requests are still done always via the Twitter API.
@mikf Whoops, sorry! I have just added them. Thanks again! |
This pull request add support for nitter.net URLs.
Nitter is an alternative front-end to Twitter - free and open-source available
at: https://github.com/zedeus/nitter
nitter.net is the official public instance.