I am running Raspbian and tried the below command to watch Youtube videos in the command line mode

yt --player omxplayer

But I got the below error message

Traceback (most recent call last):
  File "/usr/local/bin/yt", line 9, in <module>
    load_entry_point('whitey==0.3', 'console_scripts', 'yt')()
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.3-py2.7.egg/yt/__init__.py", line 31, in main
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.3-py2.7.egg/yt/__init__.py", line 84, in run
  File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.3-py2.7.egg/yt/__init__.py", line 127, in _curses_main
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.3-py2.7.egg/yt/__init__.py", line 185, in _update_screen
    self._add_table_row(self._help, 0, 0, w-1, self._bar_attr, max_width=16, win=self._help_bar)
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.3-py2.7.egg/yt/__init__.py", line 362, in _add_table_row
    win.addstr(y, x, truncate('%s:%s' % (k,v), min(w-x, cell_w)).encode(self._code), attr)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2026' in position 12: ordinal not in range(128)

I followed the correct steps to install all the software package

    sudo apt-get install omxplayer
    sudo apt-get install youtube-dl
    sudo youtube-dl -U
    sudo youtube-dl --update
    sudo apt-get install python-setuptools
    sudo easy_install whitey

my youtube-dl is the latest version. I still cannot run the yt program.


2 Answers 2


Take a look at this tutorial. Here is what I think you need to do:

Navigate to whitey's /src/yt/ directory, and edit __init__.py (your path to that file is /usr/local/lib/python2.7/dist-packages/whitey-0.3-py2.7.egg/yt/__init__.py). The line that has the mplayer command in it, change mplayer to omxplayer, and remove the argument switches. Or you could just replace that file with this one.

Other than that, your installation process worked fine for me, so I'm not sure what you did wrong.


your python script tripped over an UTF8 characters in the youtube video file name or title.

you should try something else that has ascii-only characters in the title/name and see if your installation works, then you may proceed to fix it for international characters by contacting the author of the original script or by fixing it yourself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.