GithubHelp home page GithubHelp logo

yt's Introduction

yt: a command-line YouTube client

yt is a command-line front-end to YouTube which allows you to browse YouTube videos and play them directly from the command-line. It uses youtube-dl and mplayer, omxplayer, or mpv to actually play the videos.

The combination of a text based interface and omxplayer makes yt a great YouTube client for the Raspberry Pi.

Usage

Launch using mplayer with:

yt

or, if you're using a Raspberry Pi, using omxplayer:

pi-yt

Installation

From PyPi (easier!)

# Install dependencies
sudo apt-get install youtube-dl
# Ensure using latest version of youtube-dl to keep up with YouTube API changes
sudo youtube-dl -U

# Install from PyPi
sudo apt-get install python-setuptools
sudo easy_install whitey

From GitHub

# Install dependencies
sudo apt-get install youtube-dl
# Ensure using latest version of youtube-dl to keep up with YouTube API changes
sudo youtube-dl -U

# Install from GitHub
sudo apt-get install python-setuptools
git clone https://github.com/rjw57/yt.git
cd yt
sudo python setup.py install

One line install for the Raspberry Pi

curl -L https://github.com/rjw57/yt/raw/master/tools/install-pi.sh | sh

Dependencies

Any of

  • youtube-dl and mplayer
  • youtube-dl and omxplayer
  • mpv (which uses libquvi)

Common problems

Videos don't play when selected in interface

Make sure you have the latest version of youtube-dl. youtube-dl has a self update mechanism:

sudo youtube-dl -U

Omxplayer starts and terminates without playing video

For high quality videos the default memory allocation on the Raspberry Pi doesn't provide enough memory to the GPU.

The default 192M ARM, 64M GPU split can be changed to a 128M ARM, 128M GPU split using raspi-config.

sudo raspi-config
# Select memory-split
# Allocate 128M to the GPU

See http://elinux.org/RPi_Advanced_Setup for more information.

Getting more help

See https://github.com/rg3/youtube-dl and https://github.com/huceke/omxplayer for more detailed help.

Contributors

  • Rich Wareham
    • Created yt.
  • Calum J. Eadie
    • Added OMXPlayer support and pi-yt entry point.

Credits

yt's People

Contributors

calumjeadie avatar giuscri avatar hololight avatar javier-lopez avatar jhawthorn avatar mishugana avatar natureshadow avatar richih avatar rjw57 avatar sumpygump avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yt's Issues

mplayer missing fullscreen option

Noticed videos not playing in fullscreen.

Checked code and it seems mplayer is missing the -fs option

def play_url_mplayer(url,novideo):

if novideo:
  player = subprocess.Popen(
        ['mplayer', '-quiet', '-novideo', '--', url.decode('UTF-8').strip()$
        stdout = subprocess.PIPE, stderr = subprocess.PIPE)
else:
  player = subprocess.Popen(
        ['mplayer', '-quiet', '', '--', url.decode('UTF-8').strip()],
        stdout = subprocess.PIPE, stderr = subprocess.PIPE)
player.wait()

Running yt fails

Running pi-yt fails with:

Traceback (most recent call last):
  File "/usr/local/bin/pi-yt", line 9, in 
    load_entry_point('whitey==0.3', 'console_scripts', 'pi-yt')()
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.3-py2.7.egg/yt/__init__.py", line 41, in main_with_omxplayer
    ui.run()
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.3-py2.7.egg/yt/__init__.py", line 84, in run
    curses.wrapper(self._curses_main)
  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 97, in _curses_main
    curses.curs_set(0)
_curses.error: curs_set() returned ERR

I'm SSH'd into my pi if that helps...

Better integrate with mplayer

There are some things that could be improved. The cript depends on mplayer, so it should integrate with it a bit better.

  • Integrate a function key that pulls up a selection list in which the mplayer profile to be used can be selected, after reading that list from mplayer
  • mplayer can be remote-controlled completely, so yt can introduce a simple interface to control it and display its status, because the normal mplayer output is hidden

http 410 Gone

Hi,
I installed yt on RasPi. Via youtube-dl I can donwload videos. When I run yt --player omxplayer, I get http error 410:

Traceback (most recent call last):
  File "/usr/local/bin/yt", line 9, in <module>
    load_entry_point('whitey==0.4', 'console_scripts', 'yt')()
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.4-py2.7.egg/yt/__init__.py", line 37, in main
    ui.run()
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.4-py2.7.egg/yt/__init__.py", line 103, in run
    curses.wrapper(self._curses_main)
  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.4-py2.7.egg/yt/__init__.py", line 147, in _curses_main
    self._run_pager()
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.4-py2.7.egg/yt/__init__.py", line 221, in _run_pager
    feed = self._get_feed(idx, n_per_page)
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.4-py2.7.egg/yt/__init__.py", line 188, in _get_feed
    self._last_feed = self._feed['fetch_cb'](start, count, self._ordering)
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.4-py2.7.egg/yt/__init__.py", line 484, in fetch_cb
    return json.load(urllib2.urlopen('%s?%s' % (url, urllib.urlencode(query))))
  File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 407, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 520, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 445, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 528, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 410: Gone

Different commands based on video aspect

This may sound really weird and is more of a feature request than a bug.

I have a machine setup without X11 installed. It is primarily just using tty and framebuffer when I need graphics.

mplayer has an fbdev video output mode for situations where you want to watch a video on the framebuffer.

mplayer by default plays the video at whatever size it is normally. SO if you have a 1280x720 video ona a1366x768 screen you get some border and of you have a 720x480 video on a 1366x768 screen you get big borders. (It errors out on videos larger than the framebuffer screen size but I'll get to that in a sec)

mplayer graciously has the option to scale videos up or down to match the framebuufer screen size.

mplayer -vo fbdev2 -zoom -xy 1366 video.file

This will scale videos to the horizontal 1366. This is fine for 16:9 and 16:10 videos. The issue comes in when you have a 4:3 video and use those options. It will scale the horizontal to 1366 but then that make the vertical res 1024 and errors out (Because 1024 is greater than the 768)

Short of a patch for mplayer I was thinking having something like

if 4:3
['mplayer', '-vo', 'fbdev2', '-zoom', '-xy', '1024', '-quiet', '', '--', url.decode('UTF-8').strip()],

if 16:9 or 16:10
['mplayer', '-vo', 'fbdev2', '-zoom', '-xy', '1366, '-quiet', '', '--', url.decode('UTF-8').strip()],

I know this is an extreme use case but would be great to have the option. Obviously people could change that to suite their particular screen size.

Be more pro-active in pushing to pypi

yt needs to be under more active development (or, at least, from the outside). This is a meta-issue. Once @rjw57 pulls his finger out and updates the PyPI packaging more often, we can close it.

resizing terminal can cause yt to crash

Resizing the terminal window when using a WM that resizes the window as the user is dragging a corner of the terminal window (as opposed to resizing after the user releases the mouse button) can cause yt to crash. After close inspection, it appears that this occurs if a resize occurs while yt displays the "Talking to YouTube..." box.

Traceback (most recent call last):
  File "/usr/local/bin/yt", line 9, in <module>
    load_entry_point('whitey==0.3', 'console_scripts', 'yt')()
  File "/Library/Python/2.7/site-packages/whitey-0.3-py2.7.egg/yt/__init__.py", line 38, in main
    ui.run()
  File "/Library/Python/2.7/site-packages/whitey-0.3-py2.7.egg/yt/__init__.py", line 117, in run
    curses.wrapper(self._curses_main)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/Library/Python/2.7/site-packages/whitey-0.3-py2.7.egg/yt/__init__.py", line 163, in _curses_main
    self._run_pager()
  File "/Library/Python/2.7/site-packages/whitey-0.3-py2.7.egg/yt/__init__.py", line 237, in _run_pager
    feed = self._get_feed(idx, n_per_page)
  File "/Library/Python/2.7/site-packages/whitey-0.3-py2.7.egg/yt/__init__.py", line 204, in _get_feed
    self._last_feed = self._feed['fetch_cb'](start, count, self._ordering)
  File "/Library/Python/2.7/site-packages/whitey-0.3-py2.7.egg/yt/__init__.py", line 607, in fetch_cb
    return json.load(urllib2.urlopen('%s?%s' % (url, urllib.urlencode(query))))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 404, in open
    response = self._open(req, data)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 422, in _open
    '_open', req)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1222, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1184, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno 65] No route to host>

Can't view video 10

The display shows 10 videos per page, numbered 1 to 10. However, the input only allows selecting videos 1-9.

Suggest mapping the 0 key to video 10.

Pressing arrow keys (and many others) in search causes yt to crash

When you press any unexpected character while the search bar is open, yt immediately crashes.
I can reliably reproduce this with all arrow keys, delete, home, end, insert, tab, all function keys, basically anything that isn't in what appears to be yt's array of expected characters. In such cases, yt crashes with the following error:

Traceback (most recent call last):
  File "/usr/bin/yt", line 439, in <module>
    main()
  File "/usr/bin/yt", line 18, in main
    ui.run()
  File "/usr/bin/yt", line 55, in run
    curses.wrapper(self._curses_main)
  File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/bin/yt", line 102, in _curses_main
    self._run_pager()
  File "/usr/bin/yt", line 250, in _run_pager
    s = self._input('search')
  File "/usr/bin/yt", line 140, in _input
    s += chr(c)
ValueError: chr() arg not in range(256)

Additionally, pressing Enter or Backspace when the search string is empty causes yt to crash immediately with the following error:

Traceback (most recent call last):
  File "/usr/bin/yt", line 439, in <module>
    main()
  File "/usr/bin/yt", line 18, in main
    ui.run()
  File "/usr/bin/yt", line 55, in run
    curses.wrapper(self._curses_main)
  File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/bin/yt", line 102, in _curses_main
    self._run_pager()
  File "/usr/bin/yt", line 250, in _run_pager
    s = self._input('search')
  File "/usr/bin/yt", line 143, in _input
    input_win.addstr(0, 0, ('%s' % (get_query_result(s),)).encode(self._code))
  File "/usr/bin/yt", line 430, in get_query_result
    result = json.load(urllib2.urlopen('%s?%s' % (url, urllib.urlencode(query))))
  File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 410, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 523, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 448, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 531, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 400: Bad Request

Thank you, and have a nice day!

pass -r syntax to omxplayer?

Hi all,
how can I pass -r syntax to omxplayer to get it actually work I already tried to add it like so:line 555
['omxplayer', '-r', '-o%s' % audio, url.decode('UTF-8').strip()],
but it crashes after a while or doesn't even start at all in some cases
I also tried to edit line 67 of OMXPlayer launcher script "/usr/bin/omxplayer" and add the -r syntax over there like so:
LD_LIBRARY_PATH="$OMXPLAYER_LIBS${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" $OMXPLAYER_BIN -r "$@"; true
but it crashes too :(
To make things clear I can run omxplayer -r myvideo.mp4 and it works perfect.
any help?

UnicodeDecodeError: 'ascii' codec can't decode byte

When searching using Swedish characters, yt crashes.

  1. Start yt
  2. Press s, and enter search string Södertälje, press enter

Expected result:
A list if videos

Actual result:
A stack trace...

[krikar@krikar-thinkpad yt]$ yt
Traceback (most recent call last):
  File "/usr/bin/yt", line 9, in <module>
    load_entry_point('whitey==0.3', 'console_scripts', 'yt')()
  File "/usr/lib/python2.7/site-packages/whitey-0.3-py2.7.egg/yt/__init__.py", line 31, in main
    ui.run()
  File "/usr/lib/python2.7/site-packages/whitey-0.3-py2.7.egg/yt/__init__.py", line 84, in run
    curses.wrapper(self._curses_main)
  File "/usr/lib64/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/lib/python2.7/site-packages/whitey-0.3-py2.7.egg/yt/__init__.py", line 128, in _curses_main
    self._run_pager()
  File "/usr/lib/python2.7/site-packages/whitey-0.3-py2.7.egg/yt/__init__.py", line 219, in _run_pager
    self._update_screen()
  File "/usr/lib/python2.7/site-packages/whitey-0.3-py2.7.egg/yt/__init__.py", line 191, in _update_screen
    self._status_bar.addstr(0, 0, truncate(self._status, w-1).encode(self._code))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 28: ordinal not in range(128)

Installed yt using Github Master branch, latest commit f1ab093

Trouble with https and mplayer

Hi,

Had some trouble with youtube-https-links coming back from youtube-dl. I couldn't play them with mplayer. Has someone experienced the same problem?

I've added --prefer-insecure as option to youtube-dl and the links coming back through this seem to work with mplayer.

Tested on my cubieboard.

Empty input in user query crashes yt

Hi,

entering an empty string into the 's'earch query is handled correctly, doing the same in 'u'ser sends the request to the server and produces an HTTP 400 error which is not caught by yt.

-nik

Do not encourage people to run scripts unverified

The proposal in the README.rst for one-liner isntallation on the Raspberry Pi is harmful in that it encourages users to run scripts right from the internet as root without further inspection. Although it looks simple, it is not something you should educate users to do.

Will yt support a proxy setting toggle?

Hi, yt is good, I'm running it on my Raspberry Pi Model A, the only problem is, I'm in China. As you might know, youtube is blocked within China.
I noticed that youtube-dl has a proxy toggle in its new version , and also has a --no-check-certificate toggle, so I tried to modify the init file under the whitey egg folder, searched for the "youtube-dl" words and added --no-check-certificate and --proxy [myhttpsproxy]. And I set bash proxy enviroment variables https_proxy and http_proxy to my proxy url too:"export http_proxy='http://192.168.1.200:8087' " and " export https_proxy='https://192.168.1.200:8087' ". Once in a while, I can get it run, and I could watch youtube videos, but can't turn pages, and could only search once, or otherwise yt will crash. After it crashed, some error messages got printed on the screen with some http errors. It crashs too much often in this way, so I can only using it through pptp vpn now, works good.
So, will you please add some proxy settings if you have time and interesting?
Better also have the --no-check-certificate toggle because I use Goagent(code.google.com/p/goagent) for my proxy server which use a faked certificate.
Thanks.
Sorry for my poor english, and I'm not sure this should be post here, but I've searched, can't find other better way to ask you. Not so good on the twitter?

Videos not playing (Youtube-dl up-to-date)

Yt is not playing any videos. If I select one it tells me "playing video", but it never happens. Instead it jumps back to video selection.

My youtube-dl is up to date and also works. I can manually download youtube videos through yt and also play them with mplayer. There is no error/debug output in yt,unfortunately. What could be the problem? It seems like yt never parses any videos to mplayer..

Error 404

Tried to install from github (version 0.3) and pip (version 0.4).

~/.local/bin$ ./yt
Traceback (most recent call last):
  File "./yt", line 11, in <module>
    load_entry_point('whitey==0.4', 'console_scripts', 'yt')()
  File "/home/evgeniy/.local/lib/python2.7/site-packages/yt/__init__.py", line 37, in main
    ui.run()
  File "/home/evgeniy/.local/lib/python2.7/site-packages/yt/__init__.py", line 103, in run
    curses.wrapper(self._curses_main)
  File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/home/evgeniy/.local/lib/python2.7/site-packages/yt/__init__.py", line 147, in _curses_main
    self._run_pager()
  File "/home/evgeniy/.local/lib/python2.7/site-packages/yt/__init__.py", line 221, in _run_pager
    feed = self._get_feed(idx, n_per_page)
  File "/home/evgeniy/.local/lib/python2.7/site-packages/yt/__init__.py", line 188, in _get_feed
    self._last_feed = self._feed['fetch_cb'](start, count, self._ordering)
  File "/home/evgeniy/.local/lib/python2.7/site-packages/yt/__init__.py", line 484, in fetch_cb
    return json.load(urllib2.urlopen('%s?%s' % (url, urllib.urlencode(query))))
  File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 435, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 548, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 473, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 556, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found```

Window size for omxplayer

recent omxplayer on raspberry pi allows window size specification. The following patch introduces such an option to yt command line.

diff -urN whitey-0.3/src/yt/__init__.py whitey-0.3-patched/src/yt/__init__.py
--- whitey-0.3/src/yt/__init__.py       2013-03-21 20:24:14.000000000 +0100
+++ whitey-0.3-patched/src/yt/__init__.py       2013-05-25 15:38:26.865483420 +0200
@@ -15,6 +15,7 @@
 # Define possible player modes.
 MPLAYER_MODE="mplayer"
 OMXPLAYER_MODE="omxplayer"
+WINDOW=""

 def main():
     """
@@ -23,9 +24,14 @@

     # Allow the user to specify whether to use mplayer or omxplayer for playing videos.
     parser = argparse.ArgumentParser(prog='yt',formatter_class=argparse.ArgumentDefaultsHelpFormatter)
-    parser.add_argument("--player",default=MPLAYER_MODE,choices=[MPLAYER_MODE,OMXPLAYER_MODE],help="specifies what program to use to play videos")
+    parser.add_argument("--player",default=OMXPLAYER_MODE,choices=[MPLAYER_MODE,OMXPLAYER_MODE],help="specifies what program to use to play videos")
+
+    parser.add_argument("--win", help="specify window position for omxplayer")

     args = parser.parse_args(sys.argv[1:])
+    global WINDOW
+    if (args.win):
+       WINDOW=args.win

     ui = Ui(args.player)
     ui.run()
@@ -401,9 +407,14 @@
     player.wait()

 def play_url_omxplayer(url):
-    player = subprocess.Popen(
-            ['omxplayer', '-ohdmi', url.decode('UTF-8').strip()],
+    if (len(WINDOW)) :
+       player = subprocess.Popen(
+            ['omxplayer', '--win', WINDOW, 
+           url.decode('UTF-8').strip()],
             stdout = subprocess.PIPE, stderr = subprocess.PIPE)
+    else :
+       player = subprocess.Popen(['omxplayer',url.decode('UTF-8').strip()],
+               stdout = subprocess.PIPE, stderr = subprocess.PIPE)
     player.wait()

 def search(terms):

Running pi-yt fails

I installed yt on my raspberry pi. When I try to run pi-yt I get:

pi@raspberrypi ~ $ pi-yt
Traceback (most recent call last):
File "/usr/local/bin/pi-yt", line 9, in
load_entry_point('whitey==0.4', 'console_scripts', 'pi-yt')()
File "/usr/local/lib/python2.7/dist-packages/whitey-0.4-py2.7.egg/yt/init.py", line 46, in main_with_omxplayer
ui = Ui(OMXPLAYER_MODE)
File "/usr/local/lib/python2.7/dist-packages/whitey-0.4-py2.7.egg/yt/init.py", line 83, in init
self._player = args.player
AttributeError: 'str' object has no attribute 'player'

Current version of youtube-dl:

pi@raspberrypi ~ $ youtube-dl -U
youtube-dl is up-to-date (2013.12.26)

Python is:

pi@raspberrypi ~ $ python --version
Python 2.7.3

Omxplayer is:

pi@raspberrypi ~ $ omxplayer --version
omxplayer - Commandline multimedia player for the Raspberry Pi
Build date: Mon, 16 Dec 2013 22:06:42 +0100
Version : b34143c [master]
Repository: https://github.com/popcornmix/omxplayer.git

mpv has no novideo option

In the code, the function play_url_mpv takes novideo as an argument but does nothing with it.I scripted a solution resembling other function, as i found that mpv has a --no-video option. It looks like this:

def play_url_mpv(url, novideo):
if novideo:
player = subprocess.Popen(['mpv', '--really-quiet',' ', '--no-video', '--', url],
stdout = subprocess.PIPE, stderr = subprocess.PIPE)
player.wait()
else:
player = subprocess.Popen(['mpv', '--really-quiet','--', url],
stdout = subprocess.PIPE, stderr = subprocess.PIPE)
player.wait()

It is not pretty, but it gets the work done. Problem is that while in no video mode, mpv stops taking keyboard input thru yt for whatever reason.

Any ideas?

pi-yt: not found

When installing the script on my RPI I get
pi-yt: not found
in the end of the script ..

Option to pick resolution

It seems that youtube-dl always plays the highest quality version of a chosen video. When 1080p is available this is fine on my home network, but my school's wifi network does not have enough bandwidth to handle the 1080p stream. I was looking at the arguments for youtube-dl to see if there was anything to maybe play a lower quality version of a video. Didn't see anything very apparent. Not sure whether this is an issue with youtube-dl or something that could be implemented in yt. If the lower quality can be played with youtube-dl a great feature for yt wold be to have an extra diiaog for quality selection or maybe an arguemnt to set the max video quality that is played.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.