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

SyntaxError: Non-ASCII character '\x92' in file /usr/local/bin/youtube-dl on line 3 #1131

Closed
cyberjacob opened this issue Jul 25, 2013 · 7 comments

Comments

@cyberjacob
Copy link
Contributor

@cyberjacob cyberjacob commented Jul 25, 2013

[~] # python2.7 /usr/local/bin/youtube-dl 
File "/usr/local/bin/youtube-dl", line 2
SyntaxError: Non-ASCII character '\x92' in file /usr/local/bin/youtube-dl on line 3, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

And yes, I read the FAQ

[~] # python2.7 --version
Python 2.7.3
@phihag
Copy link
Contributor

@phihag phihag commented Jul 26, 2013

That's indeed curious. How did you install youtube-dl? I cannot reproduce this problem:

# wget https://yt-dl.org/latest/youtube-dl -O /usr/local/bin/youtube-dl
# python2.7  /usr/local/bin/youtube-dl 
Usage: youtube-dl [options] url [url...]

youtube-dl: error: you must provide at least one URL
@cyberjacob
Copy link
Contributor Author

@cyberjacob cyberjacob commented Jul 26, 2013

I used

# wget http://youtube-dl.org/downloads/2013.07.25.1/youtube-dl -O /usr/local/bin/youtube-dl

to download it

@phihag
Copy link
Contributor

@phihag phihag commented Jul 26, 2013

It looks like something went awry with the download. What do you get when you type

md5sum /usr/local/bin/youtube-dl

, and does the problem persist if you download the file again?

@cyberjacob
Copy link
Contributor Author

@cyberjacob cyberjacob commented Jul 26, 2013

# md5sum /usr/local/bin/youtube-dl
81546e85d33f28bd80e491e6667e227a  /usr/local/bin/youtube-dl

I've downloaded twice, and the issue still percists.
Also, if it helps

# uname -a
Linux SNode4 2.6.33.2 #1 Tue Jun 4 12:13:48 CST 2013 armv5tel unknown
@phihag
Copy link
Contributor

@phihag phihag commented Jul 26, 2013

That's not the correct md5sum, can you send me the donwloaded file via email or upload it somewhere?

In any case, someone (say, your ISP) may be injecting random data. If you download the file via https (i.e.

# wget https://yt-dl.org/downloads/2013.07.25.1/youtube-dl -O /usr/local/bin/youtube-dl

do you get a different md5sum?

@KnappeGEIL
Copy link

@KnappeGEIL KnappeGEIL commented Nov 22, 2013

Hi,

did you by any chance try to change the path of your python interpreter using vim? I did this and I believe because of bad encoding it messed up the script. I then did those changes on a windows machine using notepad++ and everything worked all right.

Sorry for digging up the thread but maybe someone is having the problem and this might be a solution.

Cheers

@reoxb
Copy link

@reoxb reoxb commented Aug 29, 2015

I remove youtube-dl and put all this.

In my case: sudo apt-get remove youtube-dl

#wget https://yt-dl.org/latest/youtube-dl -O /usr/local/bin/youtube-dl
#python2.7 /usr/local/bin/youtube-dl
youtube-dl https://www.youtube.com/playlist?list=PLg_F6Ppg7ZkHQL0oQEdDG4ST5FK6KCoVt

for example. and it works for me.

@dstftw dstftw closed this Jun 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.