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

Search for links throughout whole message #430

Open
PROger4ever opened this issue Sep 23, 2024 · 1 comment
Open

Search for links throughout whole message #430

PROger4ever opened this issue Sep 23, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@PROger4ever
Copy link

PROger4ever commented Sep 23, 2024

Problem

When you share youtube-video from mobile app to telegram, it has name in the beginning like:

Respect💯 Greatest Save🦸‍♂️ #shorts #short #status #humanity #viral
https://youtube.com/shorts/1K1pMdQzV1M?si=uze3jaacXuKeWDNG

But ytdlbot searches for link in message begininng:

if not re.findall(r"^https?://", url.lower()):

This doesn't let me to share the video from youtube app to a friend using the bot in a simple way.

Proposal

Let's parse links using (probably not) rfc-compliant pattern like:

/https?:\/\/[^\s\/]+(\/\S*)?/g

In search of the perfect URL validation regex
Maybe we should validate host in the link not to be local-addresses like localhost, 127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 and so on.

@PROger4ever PROger4ever changed the title Search for links throughout the whole message Search for links throughout whole message Sep 23, 2024
@SanujaNS
Copy link
Collaborator

Hello @PROger4ever ,

Thank you for taking the time to share your valuable suggestions with us. We will carefully review your input and assess the feasibility of incorporating these ideas into our project. From the first look of this, it appears that this change may impact the bot's current YouTube search functionality. One possible solution could be to limit YouTube searches to instances where the /search command is specifically invoked. We would appreciate your thoughts on this approach and any other ideas you may have.
Please allow us some time to thoroughly evaluate your suggestions. We will get back to you as soon as we have a clear understanding of how to proceed.

Thank you.

@BennyThink BennyThink added the enhancement New feature or request label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants