Created
July 12, 2014 17:24
-
-
Save jaseg/cce6a9d250c2d9a120bc to your computer and use it in GitHub Desktop.
Play music links on a subreddit using ipython
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [1]: %rehashx | |
In [2]: import praw | |
In [3]: urls = [e.url.replace('https', 'http') for e in praw.Reddit('ipython').get_subreddit('indie_rock').get_hot(limit=30) if 'youtu' in e.url or 'soundcloud' in e.url] | |
In [4]: for url in urls: | |
!mpv --no-video "$url" | |
....: | |
Playing: http://www.youtube.com/watch?v=sXfLPNv-Axs | |
[quvi] Checking URL... | |
[stream] Video --vid=1 (vp8) | |
[stream] Audio (+) --aid=1 (*) (vorbis) | |
Video: no video | |
AO: [pulse] 44100Hz stereo 2ch float | |
A: 00:00:00 / 00:06:53 (0%) Cache: 2% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment