Last active
April 1, 2017 19:12
-
-
Save HummusSamurai/88eec97c4d525ce3c3800c76132523fb to your computer and use it in GitHub Desktop.
Downloads video/audio content in a subreddit, and takes as parameters the subreddit title, date (optional), and limit (optional). Dependency: xargs, curl, youtube-dl, jq, at
This file contains hidden or 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
| #!/bin/bash | |
| curl -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.112 Safari/534.30" \ | |
| https://www.reddit.com/r/$1/top/.json?sort=top\&t=${2:-all}\&limit=${3:-25} \ | |
| | jq -r '.data.children[].data.url' | xargs \ | |
| youtube-dl -o "~/youtube-dl/r_$1/r_$1 -- %(title)s.%(ext)s" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment