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

URL Validation: Add support for other schemes apart from https, http, ftp #327

Closed
dvignacioglobal opened this issue Mar 12, 2024 · 8 comments · Fixed by #339
Closed

URL Validation: Add support for other schemes apart from https, http, ftp #327

dvignacioglobal opened this issue Mar 12, 2024 · 8 comments · Fixed by #339
Labels
duplicate Issue/PR: Redundant enhancement Issue/PR: A new feature

Comments

@dvignacioglobal
Copy link

dvignacioglobal commented Mar 12, 2024

Given in the documentation link, the validator does not return True if I use a different scheme such as rtmp or rtsp.

  foo://admin:[email protected]:8042/over/there?name=ferret#nose
  \_/   \___/ \_____/ \_________/ \__/\_________/ \_________/ \__/
   |      |       |       |        |       |          |         |
scheme username password hostname port    path      query    fragment

An example of this is

rtmp://192.168.1.123:1935/live/test

If I run this code:

import validators

streamurl = "rtmp://192.168.1.123:1935/live/test"
print(validators.url(streamurl))

The output is:

ValidationError(func=url, args={'value': 'rtmp://192.168.1.123:1935/live/test'})

It would be nice if the URL validator supports other schemes. Thanks.

@yozachar yozachar added duplicate Issue/PR: Redundant enhancement Issue/PR: A new feature labels Mar 13, 2024
@yozachar
Copy link
Collaborator

"ftp", "ftps", "git", "http", "https",
"rtmp", "rtmps", "rtsp", "sftp",
"ssh", "telnet",

Apart from these, do you have any other protocols in mind that follows a similar scheme://netloc/path;parameters?query#fragment syntax?

@dvignacioglobal
Copy link
Author

Thanks for replying! I have nothing more to add to the list.

@nyuware
Copy link

nyuware commented Jun 7, 2024

Opening the issue again, would it be possible to parse all the available schemes from IANA available here instead of hardcoding a list ? Like it's already being done for the TLDS
Thanks!

@yozachar
Copy link
Collaborator

yozachar commented Jun 8, 2024

parse all the available schemes from IANA

Would be impractical. Hence to cover as much as possible #352 exists.

@tofetpuzo
Copy link

is this feature still live?

@yozachar
Copy link
Collaborator

is this feature still live?

What are you referring to specifically?

@tofetpuzo
Copy link

is this feature still live?

What are you referring to specifically?

Hey @yozachar here -> "feature add non-exhaustive Url validation"

@yozachar
Copy link
Collaborator

is this feature still live?

What are you referring to specifically?

Hey @yozachar here -> "feature add non-exhaustive Url validation"

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issue/PR: Redundant enhancement Issue/PR: A new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants