Recover from API change
This commit is contained in:
parent
11fb849458
commit
87c794bb70
|
@ -1,5 +1,7 @@
|
||||||
Simple Subreddit Image Downloader
|
Simple Subreddit Image Downloader
|
||||||
==========================
|
==========================
|
||||||
|
Tired of all of those reddit downloaders which want you to install tons of dependencies and then don't work anyway? Me too.
|
||||||
|
|
||||||
*Simple Subreddit Image Downloader* is bash script which:
|
*Simple Subreddit Image Downloader* is bash script which:
|
||||||
- has minimal external dependencies
|
- has minimal external dependencies
|
||||||
- downloads full-size images from subreddits
|
- downloads full-size images from subreddits
|
||||||
|
|
3
rdit.sh
3
rdit.sh
|
@ -9,13 +9,12 @@ url="https://www.reddit.com/r/$subreddit/.json"
|
||||||
content=`wget -U "$useragent" --no-check-certificate -q -O - $url`
|
content=`wget -U "$useragent" --no-check-certificate -q -O - $url`
|
||||||
mkdir -p $output
|
mkdir -p $output
|
||||||
while : ; do
|
while : ; do
|
||||||
urls=$(echo -e "$content"|grep -Po '"url":.*?[^\\]",'|cut -f 4 -d '"')
|
urls=$(echo -e "$content"|grep -Po '"source": {"url":.*?[^\\]",'|cut -f 6 -d '"')
|
||||||
names=$(echo -e "$content"|grep -Po '"title":.*?[^\\]",'|cut -f 4 -d '"')
|
names=$(echo -e "$content"|grep -Po '"title":.*?[^\\]",'|cut -f 4 -d '"')
|
||||||
ids=$(echo -e "$content"|grep -Po '"id":.*?[^\\]",'|cut -f 4 -d '"')
|
ids=$(echo -e "$content"|grep -Po '"id":.*?[^\\]",'|cut -f 4 -d '"')
|
||||||
a=1
|
a=1
|
||||||
for url in $(echo -e "$urls"); do
|
for url in $(echo -e "$urls"); do
|
||||||
if [ -n "`echo "$url"|egrep \".gif|.jpg\"`" ]; then
|
if [ -n "`echo "$url"|egrep \".gif|.jpg\"`" ]; then
|
||||||
#echo -n "$url: "
|
|
||||||
name=`echo -e "$names"|sed -n "$a"p`
|
name=`echo -e "$names"|sed -n "$a"p`
|
||||||
id=`echo -e "$ids"|sed -n "$a"p`
|
id=`echo -e "$ids"|sed -n "$a"p`
|
||||||
echo $name
|
echo $name
|
||||||
|
|
Loading…
Reference in New Issue