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

Latest version of youtube-dl (2013.02.25) running on CentOS 5.x does not work #744

Closed
DT-PI opened this issue Mar 15, 2013 · 6 comments
Closed

Comments

@DT-PI
Copy link

@DT-PI DT-PI commented Mar 15, 2013

Hello. First time user.

OS version: CentOS 5.8
Python version: 2.6

  1. Downloaded the bits using the provided instructions
  2. sudo wget http://youtube-dl.org/downloads/2013.02.25/youtube-dl -O /usr/local/bin/youtube-dl
  3. sudo chmod a+x /usr/local/bin/youtube-dl
  4. /usr/local/bin/youtube-dl -h
    File "/usr/local/bin/youtube-dl", line 2
    SyntaxError: Non-ASCII character '\xcc' 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

While I can go ahead and follow the given instructions ..., I am just curious as of what I have done wrong, as I was expecting things work right out-of-the-box.

Perhaps I am doing something trivial wrong.

Sorry, if thjis is something trivial that the 1st-time user should had known.
DT
DT

@phihag
Copy link
Contributor

@phihag phihag commented Mar 15, 2013

No, you didn't do anything wrong - that should work. What output do you get for

which python
python --version
/usr/bin/env python --version

?

@DT-PI
Copy link
Author

@DT-PI DT-PI commented Mar 26, 2013

Hi. Sorry for being off the radar ...
Thx for getting back to me.
To answer your questions: Since both python 2.4 & 2.6 have been installed on the system that I use (and /usr/bin/python is 2.4) I made the following chg in the youtube-dl, so it would use python2.6, i.e. the first line in the script is
#!/usr/bin/env /usr/bin/python2.6

Perhaps the above change is necessary but not sufficient, hence causing the error.
Let me know if I need to mk any other adjustments.

Thx
danesh

@yasoob
Copy link
Contributor

@yasoob yasoob commented Jul 3, 2013

@DT-PI did you use pythonbrew or what to install different versions of python ?

@broberts01
Copy link

@broberts01 broberts01 commented Jan 23, 2014

Same issue here. I used
yum install python26
which placed python26 in /usr/bin
I tried changing the #!/usr/bin/env python to #!/usr/bin/env python26, but still the error remains.
Calling directly via
/usr/bin/python26 youtube-dl
resulted in the same error.
I also tried linking /usr/bin/python26 to ~/bin then modifying PATH to put ~/bin first. This results in which python returning /home/br/bin/python -- the 2.6 version. /usr/bin/env python --version returns Python 2.6.8
Is perhaps the issue with 2.6 on Centos5?

@broberts01
Copy link

@broberts01 broberts01 commented Jan 23, 2014

Update -- recp'd and did a MD5 checksum. It seems something got corrupted when editing the first line. Explicitly calling
python26 youtube-dl
works fine, as does messing with the PATH and linking hack.

@phihag
Copy link
Contributor

@phihag phihag commented Jan 24, 2014

@DT-PI Based on the experiences of @broberts01, it looks like you may have accidentally changed the file somewhere. You can try redownloading and running

python2.6 /usr/local/bin/youtube-dl

If that works, the error is in the editing. Make sure to use a hex editor and not a text one. Otherwise, simply comment and we'll reopen this issue.

@phihag phihag closed this Jan 24, 2014
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
4 participants
You can’t perform that action at this time.