kuru
Who the heck is Stephan Kramer?
Updated method using mpv/quvi
note: old mvp using quvi won't work with playlists. I'll look for a workaround once I'm suitably annoyed.
Youtube puts quite some strain on older machines. Running it in firefox makes things even worse. Whether you're using HTML5 or Flashplayer makes no noticeable difference.
My elderly laptop - 2x 1.5GHz, 2GB Ram, old HD - frequently slows down to a crawl with 480p YT running in the background. It sometimes even locks up completely... unbearable. Here's how I fixed that for me and why.
Apps like smtube or minitube are light on ressources and certainly an alternative. But I want playlist support and need my subscriptions. smtube does not deliver and I had trouble building minitube. And the official Debian 8 repo has old versions which can't connect at all.
The most powerful and convenient solution I could find is VLC in combination with the YT website for managing subscriptions and browsing. I want to rightclick a video in Firefox, copy link to clipboard, and start VLC with a shortcut, passing the URL.
1) Add playlist support to VLC Player by installing an add-on from
http://addons.videolan.org/content/show.php/?content=149909
On Linux drop the .lua file in /usr/lib/vlc/lua/playlist/
2) Install xclip from e.g. Debian repository or start at
https://sourceforge.net/projects/xclip/
xclip is a nice tool that can read from or write to the X clipboard
3) create a shell script e.g. play-url-in-vlc.sh containing
'xclip -o' will output the clipboard content
$(...) makes it so the output of the command contained therein can be used as argument for another
the quotes help avoiding special characters - GET variables in URLs are separated by '&'
Add any vlc arguments you might want, mine reads
4) create a second shell script e.g. add-url-in-vlc.sh containing
play-url-in-vlc.sh will immediately start playing the URL passed to it
add-url-in-vlc.sh will append the given URL to the playlist
Put those where you deem it proper, I shoved them in .scripts in my user's home folder
5) In e.g. XFCE Open Applications Menu -> Settings -> Keyboard -> Application Shortcuts -> Add
Enter the command
Hit 'next' and put a key combo; I used Alt + W
6) Repeat #5 for add-url-in-vlc.sh and assign another shortcut, e.g. Alt + Q
In order to watch, right-click any youtube video link and 'copy link location', hit your key combo and Bob's your uncle.
There is one downside - VLC will always start at the beginning of a playlist. That's probably due to how the playlist plugin works. Could be fixable. An option to this end would be removing the playlist plugin and using the second script to build your own list.
Figuring this out was an enjoyable experience. At the very least I'll be able to find this info again, maybe it even helps somebody else.
Update 2017-02-09
There are some videos that won't play, causing VLC to throw an error 'could not open your MRL'. This is fixed by copying the updated youtube plugin to your /usr/lib/vlc/lua/playlist folder. Grab the file and rename it to youtube.lua. Copy to playlist folder. The old youtube.luac can be deleted.
note: old mvp using quvi won't work with playlists. I'll look for a workaround once I'm suitably annoyed.
Youtube puts quite some strain on older machines. Running it in firefox makes things even worse. Whether you're using HTML5 or Flashplayer makes no noticeable difference.
My elderly laptop - 2x 1.5GHz, 2GB Ram, old HD - frequently slows down to a crawl with 480p YT running in the background. It sometimes even locks up completely... unbearable. Here's how I fixed that for me and why.
Apps like smtube or minitube are light on ressources and certainly an alternative. But I want playlist support and need my subscriptions. smtube does not deliver and I had trouble building minitube. And the official Debian 8 repo has old versions which can't connect at all.
The most powerful and convenient solution I could find is VLC in combination with the YT website for managing subscriptions and browsing. I want to rightclick a video in Firefox, copy link to clipboard, and start VLC with a shortcut, passing the URL.
1) Add playlist support to VLC Player by installing an add-on from
http://addons.videolan.org/content/show.php/?content=149909
On Linux drop the .lua file in /usr/lib/vlc/lua/playlist/
2) Install xclip from e.g. Debian repository or start at
https://sourceforge.net/projects/xclip/
xclip is a nice tool that can read from or write to the X clipboard
3) create a shell script e.g. play-url-in-vlc.sh containing
Code:
#!/bin/sh
vlc "$(xclip -o)" --one-instance &
$(...) makes it so the output of the command contained therein can be used as argument for another
the quotes help avoiding special characters - GET variables in URLs are separated by '&'
Add any vlc arguments you might want, mine reads
Code:
vlc "$(xclip -o)" --no-qt-video-autoresize --preferred-resolution 480 --autoscale --video-on-top --one-instance &
4) create a second shell script e.g. add-url-in-vlc.sh containing
Code:
#!/bin/sh
vlc "$(xclip -o)" --one-instance --playlist-enqueue &
play-url-in-vlc.sh will immediately start playing the URL passed to it
add-url-in-vlc.sh will append the given URL to the playlist
Put those where you deem it proper, I shoved them in .scripts in my user's home folder
5) In e.g. XFCE Open Applications Menu -> Settings -> Keyboard -> Application Shortcuts -> Add
Enter the command
Code:
sh /PATH/TO/SCRIPT/play-url-in-vlc.sh
6) Repeat #5 for add-url-in-vlc.sh and assign another shortcut, e.g. Alt + Q
In order to watch, right-click any youtube video link and 'copy link location', hit your key combo and Bob's your uncle.
There is one downside - VLC will always start at the beginning of a playlist. That's probably due to how the playlist plugin works. Could be fixable. An option to this end would be removing the playlist plugin and using the second script to build your own list.
Figuring this out was an enjoyable experience. At the very least I'll be able to find this info again, maybe it even helps somebody else.
Update 2017-02-09
There are some videos that won't play, causing VLC to throw an error 'could not open your MRL'. This is fixed by copying the updated youtube plugin to your /usr/lib/vlc/lua/playlist folder. Grab the file and rename it to youtube.lua. Copy to playlist folder. The old youtube.luac can be deleted.
Attachments
Last edited: