I wrote a python Youtube search client with a curses interface. It's dramatically faster than the website and all it's missing is the thumbnails. It even has autocomplete!
Here's the Github. And here's a nifty little aur package.
Please let me know what you think. Feed back, as always, appreciated.
Last edited by herrflockig (2013-01-26 05:28:10)
Favorite band xD I just thought it would be a nice default.
Can I suggest an option to dl a clip to your hd, and perhaps a quality option or display.
line 84: ('J/K', 'prev/next'),
Looks like this should be updated to the new bindings (pgup/pgdn, brackets, or ^u/^d). Also, my preference would be to include ^f/^b (if indeed the bindings are inspired by vim).
Summarized the suggestions here:
diff -Naur yt~/yt.py yt/yt.py --- yt~/yt.py 2013-01-24 11:33:54.582183050 -0600 +++ yt/yt.py 2013-01-24 11:35:09.410006840 -0600 @@ -81,7 +81,7 @@ self._status = '' self._help = [ - ('J/K', 'prev/next'), + ('^u/^d', 'prev/next'), ('j', 'down'), ('k', 'up'), ('enter', 'select'), @@ -235,12 +235,12 @@ self.chosen = n_per_page - 1 elif c == ord('\n') or c == curses.KEY_RIGHT: # enter self._play_video(self.chosen) - elif c == ord(']') or c == curses.KEY_NPAGE or c == ord(curses.ascii.ctrl('d')): # next + elif c == ord(']') or c == curses.KEY_NPAGE or c == ord(curses.ascii.ctrl('d') or c == ord(curses.ascii.ctrl('f')): # next # have we had all the items? if not 'data' in self._last_feed or not 'totalItems' in self._last_feed['data'] or len(self._items) + idx < self._last_feed['data']['totalItems']: idx += n_per_page self.chosen = 0 - elif c == ord('[') or c == curses.KEY_PPAGE or c == ord(curses.ascii.ctrl('u')): # previous + elif c == ord('[') or c == curses.KEY_PPAGE or c == ord(curses.ascii.ctrl('u') or c == ord(curses.ascii.ctrl('b')): # previous if idx > n_per_page: idx -= n_per_page else: diff -Naur yt~/README yt/README --- yt~/README 2013-01-24 11:33:54.582183050 -0600 +++ yt/README 2013-01-24 11:39:14.300460672 -0600 @@ -24,14 +24,14 @@ *searches youtube for "black moth super rainbow" Key Bindings: - q - quit - j - go down one result - k - go up one result - ^d or pgdown - go down one page - ^u or pgup - go up one page - / - search - enter - play selected video - o - change ordering (relevance, view count, published date, rating) + q - quit + j - go down one result + k - go up one result + ^d or ^f or ] or pgdown - go down one page + ^u or ^b or [ or pgup - go up one page + / - search + enter - play selected video + o - change ordering (relevance, view count, published date, rating) ChangeLog ---------
ksira's suggestion for a download feature would make this very cool. You could add youtube-dl as an opt-depends and call it to download things.
All the best,
"All errors are ᴘᴇʙᴋᴀᴄ errors—It's just a matter of narrowing down which keyboard and chair." -Trilby
Very, very nice, enjoying it right now.
Is there a way to view a channel? Is there possibly a way to set a default resolution? I can't watch 1080 on my netbook, so I usually watch 720 or 480. Otherwise it's amazing.
Thanks a lot.
Figured out how to change the resolution. On line 396 where youtube-dl is being called. Change the
yt_dl = subprocess.Popen(['youtube-dl', '-g', url],
yt_dl = subprocess.Popen(['youtube-dl', '-g', '-f', '35', url]
To change the format just change the 35 to whatever youtude-dl code you want. To view the formats run youtube-dl -F http://linktoyoutubevideo
Still haven't figured out how to view channels.
Last edited by whitethorn (2013-01-27 19:30:54)
Thanks, I was looking for such a console app. Many Many thanks @herrflockig.
Using Openbox + Tint2 + Idesk
very nice!! maybe the quality option as suggested before would be a good idea.
i really like it, thank you!!
Very nice - thanks a lot for this cool idea.
Do you think it would be possible to integrate the sound into MPD? Would be really awesome to have a Youtubeplaylist in MPD.