Skip to content

Search for links throughout whole message #430

@PROger4ever

Description

@PROger4ever

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions