diff --git a/README.md b/README.md index 0dc89d4..76a25b1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ 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: - has minimal external dependencies - downloads full-size images from subreddits diff --git a/rdit.sh b/rdit.sh index 7eb64a0..136f9b8 100644 --- a/rdit.sh +++ b/rdit.sh @@ -9,13 +9,12 @@ url="https://www.reddit.com/r/$subreddit/.json" content=`wget -U "$useragent" --no-check-certificate -q -O - $url` mkdir -p $output 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 '"') ids=$(echo -e "$content"|grep -Po '"id":.*?[^\\]",'|cut -f 4 -d '"') a=1 for url in $(echo -e "$urls"); do if [ -n "`echo "$url"|egrep \".gif|.jpg\"`" ]; then - #echo -n "$url: " name=`echo -e "$names"|sed -n "$a"p` id=`echo -e "$ids"|sed -n "$a"p` echo $name