question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

raise InvalidURL(f"URL can't contain control characters. {url!r} "

See original GitHub issue

Even with the simple example I have this error : File “C:\Users\rcxsm\AppData\Local\Programs\Python\Python38\lib\http\client.py”, line 1200, in _validate_path raise InvalidURL(f"URL can’t contain control characters. {url!r} " raise InvalidURL(f"URL can’t contain control characters. {url!r} "

I commented out these lines, but it didnt help

from pytube import YouTube
YouTube('https://www.youtube.com/watch?v=Ic_FnHBiOYo').streams.first().download()
print ("ok")

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
tfdahlincommented, Dec 8, 2020

Sorry that I can’t help more, I just can’t seem to reproduce this problem myself, even when I copy and paste your code sample, and that error output makes it look like its an issue with the C:\Users\rcxsm\AppData\Local\Programs\Python\Python38\lib\http\client.py file

0reactions
rcsmitcommented, Dec 8, 2020

Hello! Thank you for your help. I did, but it didn’t resolve my problem. If I am the only one, it seems to be out of scope of pytube though. Thanks again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

I get InvalidURL: URL can't contain control characters when I ...
I am trying to get a JSON response from the link used as a parameter to the urllib request. but it gives me...
Read more >
request.get - InvalidURL("URL can't contain control characters.
get - InvalidURL("URL can't contain control characters. Dear all,. The code below works in my local computer, but I receive an error here....
Read more >
My URL has spaces in it and Python won't let me make a request
raise InvalidURL (f"URL can't contain control characters. {url!r} " http.client.InvalidURL: URL can't contain control characters.
Read more >
URL can't contain control characters. - Sololearn
how to resolve this error raise InvalidURL(f"URL can't contain control characters. {url!r} " http.client.InvalidURL: URL can't contain ...
Read more >
Parsing json files with ansible - Google Groups
using this role, however i can't seem to get to the portgroups, ... raise InvalidURL(f"URL can't contain control characters. {url!r} ".
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found