-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Add extract_urls-helper #854
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
Conversation
What about to include also captions in the helper using regex? |
@91DarioDev Good point. |
|
Fails on all except py3.6 due to |
@JosXa Can you please make sure the PR passes pre-commit and tests? |
# Conflicts: # telegram/utils/helpers.py
|
@JosXa Can you remind me why we would need/want this? And anyway I think it's more logical to sort in order of appearance rather then alphabetical? Also to parse them from captions please use the parse_caption_entites |
Turns out the issue was hidden in the call of PS: AppVeyor fail is unrelated ;) |
@Bibo-Joshi I'm not quite sure why you would want to filter this at all. The difference between having a trailing slash or not in a URL is not necessarily insignificant. Unrelated, the comment in line 185 says "dublicates" instead of "duplicates". |
@SpEcHiDe brought up an interesting point. He says that he's using something like this in his bot: Maybe we could also provide some abstractions over join links, message references, and t.me URLs 🤔 |
Test fail is unrelated |
After long considerations and real intent to see this PR merged, we, the maintainers, decided that this PR is too specific to be included in a general purpose library. |
For future reference: this will be made available through the new |
Added a new helper that extracts all URLs contained in a message and returned from Telegram