From 5b4bcee3db6b938bc43129630fe9f6120791e772 Mon Sep 17 00:00:00 2001 From: Xerbo Date: Sun, 19 Jan 2020 12:01:06 +0000 Subject: [PATCH] Add flag for classic theme --- furaffinity-dl | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/furaffinity-dl b/furaffinity-dl index 2a5b0fa..763fc72 100755 --- a/furaffinity-dl +++ b/furaffinity-dl @@ -33,6 +33,7 @@ Arguments: -w Over(Write) files if they already exist -s (S)eperate metadata files, to make sure all metadata is downloaded regardless of file + -t Not using the \"beta\" (T)heme Examples: $0 gallery/mylafox @@ -59,8 +60,10 @@ rename=true maxsavefiles="0" overwrite=false textmeta=false -while getopts 'o:c:n:iphrws' flag; do +classic=false +while getopts 'o:c:n:iphrwst' flag; do case "${flag}" in + t) classic=true;; w) overwrite=true;; o) outdir=${OPTARG};; c) cookiefile=${OPTARG};; @@ -119,8 +122,12 @@ https://github.com/Xerbo/furaffinity-dl/issues" >&2 fi # Get URL for next page out of "Next" button. Required for favorites, pages of which are not numbered - next_page_url="$(grep -B 1 'type="submit">Next' "$tempfile" | grep form | cut -d '"' -f 2 | uniq)" - + if [ $classic = true ]; then + next_page_url="$(grep 'Next  ❯❯' | cut -d '"' -f 4 | sort -u)" + else + next_page_url="$(grep -B 1 'type="submit">Next' "$tempfile" | grep form | cut -d '"' -f 2 | uniq)" + fi + # Extract links to pages with individual artworks and iterate over them artwork_pages="$(grep '&2 # Get the full size image URL. # This will be a facdn.net link, we will default to HTTPS # but this can be disabled with -i or --http for specific reasons - image_url="$prefix$(grep --only-matching --max-count=1 ' href="//d.facdn.net/download/art/.\+">Download' "$tempfile" | cut -d '"' -f 2)" + if [ $classic = true ]; then + image_url="$prefix$(grep --only-matching --max-count=1 ' href="//d.facdn.net/art/.\+">Download' "$tempfile" | cut -d '"' -f 2)" + else + image_url="$prefix$(grep --only-matching --max-count=1 ' href="//d.facdn.net/download/art/.\+">Download' "$tempfile" | cut -d '"' -f 2)" + fi # Get metadata description="$(grep 'og:description" content="' "$tempfile" | cut -d '"' -f 4)"