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

Non-ASCII Character error? #6572

Closed
NickWinston123 opened this issue Aug 16, 2015 · 7 comments
Closed

Non-ASCII Character error? #6572

NickWinston123 opened this issue Aug 16, 2015 · 7 comments

Comments

@NickWinston123
Copy link

@NickWinston123 NickWinston123 commented Aug 16, 2015

root@Nicks-Kali:/Music# youtube-dl https://ormolycka.bandcamp.com/album/pistol-disko-2004-2011-oo43
File "/usr/local/bin/youtube-dl", line 2
SyntaxError: Non-ASCII character '\xe3' in file /usr/local/bin/youtube-dl on line 3, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
root@Nicks-Kali:
/Music# youtube-dl -U
File "/usr/local/bin/youtube-dl", line 2
SyntaxError: Non-ASCII character '\xe3' in file /usr/local/bin/youtube-dl on line 3, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

root@Nicks-Kali:~/Music# apt-get install python2.7
Reading package lists... Done
Building dependency tree
Reading state information... Done
python2.7 is already the newest version.
The following packages were automatically installed and are no longer required:
libav-tools libavfilter5 libcg libcggl libportaudiocpp0 nvidia-cg-dev
nvidia-cg-toolkit rtmpdump
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 16 not upgraded.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Aug 16, 2015

Does the system default python version 2.6 or above? Check it with the following command:

$ python --version
@NickWinston123
Copy link
Author

@NickWinston123 NickWinston123 commented Aug 17, 2015

@yan12125 Thanks for the response, this is what I get when entering that in.

root@Nicks-Kali:~# python --version
Python 2.7.9

EDIT: Oh it looks like its working now, just did a reboot and reinstall. Thanks!

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Aug 17, 2015

Closing as the problem is solved. Feel free to open a new issue if there are other problems.

A side note: DO NOT run youtube-dl as root unless you're updating it. Running as root introduces unnecessary security risks.

@yan12125 yan12125 closed this Aug 17, 2015
@ctrlcctrlv
Copy link

@ctrlcctrlv ctrlcctrlv commented Aug 28, 2015

I have the same problem on FreeBSD 10.1...

master% youtube-dl
  File "/usr/local/bin/youtube-dl", line 2
SyntaxError: Non-ASCII character '\xe3' in file /usr/local/bin/youtube-dl on line 3, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
master% uname -a
FreeBSD master 10.1-RELEASE-p16 FreeBSD 10.1-RELEASE-p16 #0: Tue Jul 28 12:04:19 UTC 2015     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
master% python2 --version
Python 2.7.10
@ctrlcctrlv
Copy link

@ctrlcctrlv ctrlcctrlv commented Aug 28, 2015

Adding a -*- coding: utf-8 -*- does not help

master% youtube-dl                   
  File "/usr/local/bin/youtube-dl", line 3
    PKG�oTd����U�U����M���[U�����R��L�m3+;U�kfץB��W̾��uYW�ҿ�bVN��5�hhL�bU&GGIZ���G        <�N�����Lf�j]��[F�]>k����h����n]��MWگ/�>����X� f}���u>[Ve�[�o����^u�
      ^
SyntaxError: invalid syntax

Why is this even being distributed in binary form, it's a Python script. :\

@ctrlcctrlv
Copy link

@ctrlcctrlv ctrlcctrlv commented Aug 28, 2015

Install from pip works

master# rm /usr/local/bin/youtube-dl
master# pip install youtube-dl
You are using pip version 7.0.3, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting youtube-dl
  Downloading youtube_dl-2015.08.28-py2.py3-none-any.whl (1.0MB)
    100% |████████████████████████████████| 1.0MB 246kB/s   
Installing collected packages: youtube-dl
Successfully installed youtube-dl-2015.8.28
master# youtube-dl
Usage: youtube-dl [OPTIONS] URL [URL...]

youtube-dl: error: You must provide at least one URL.
Type youtube-dl --help to see a list of all options.
master# which youtube-dl
/usr/local/bin/youtube-dl

And /usr/local/bin/youtube-dl is not a binary if you install from pip. Weird...

@ctrlcctrlv
Copy link

@ctrlcctrlv ctrlcctrlv commented Aug 28, 2015

OK, I've solved the mystery...

Somehow my download got corrupted or someone is doing something nasty on my network.

c1f528b2412c108afebc2524773192a8f45f3b63345d6d30c75e1ed7d5062140 youtube-dl # BAD YOUTUBE-DL
3f6a925fc4f324de8f5e2ca8aad1b47408a11b83fee29ae15f6ece2ffb804f10 youtube-dl # WORKING YOUTUBE-DL

Thanks.

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
3 participants
You can’t perform that action at this time.