From 5be4a4dcf20975a01ae3643b36061113c7cd3da1 Mon Sep 17 00:00:00 2001 From: pi-ux-ce Date: Thu, 15 May 2025 19:12:58 +0000 Subject: [PATCH] check if we need http proxy or not --- download.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/download.sh b/download.sh index 575dc1d..f1aade0 100644 --- a/download.sh +++ b/download.sh @@ -16,6 +16,17 @@ while [ $# -gt 0 ]; do shift done +#check if we will use a HTTP proxy or not + +if [[ -z $http_proxy ]]; then + echo "not using proxy" + curl_command="curl" +else + echo "using proxy" + curl_command="curl -x $http_proxy" + +fi + #dowload from https://www.pornpics.com/pornstars/eiby-shine/ DESTINATION_FOLDER="/data" @@ -45,20 +56,20 @@ else echo "looping through galleries" #because we will re-generate this file, can be emptied echo "" > $DESTINATION_FOLDER/$pornstars-urls_of_galleries.txt - curl -x $PROXY_HTTP -s $BASE_URL | grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*" | grep "https://www.pornpics.com/galleries/" |sort -u >> $DESTINATION_FOLDER/$pornstars-urls_of_galleries.txt + $curl_command -s $BASE_URL | grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*" | grep "https://www.pornpics.com/galleries/" |sort -u >> $DESTINATION_FOLDER/$pornstars-urls_of_galleries.txt fi echo "" > $DESTINATION_FOLDER/$pornstars-image_to_download.txt for f in $(cat $DESTINATION_FOLDER/$pornstars-urls_of_galleries.txt ); do - curl -x $PROXY_HTTP $f | grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*" | grep "https://cdni.pornpics.com/" >> $DESTINATION_FOLDER/$pornstars-image_to_download.txt + $curl_command $f | grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*" | grep "https://cdni.pornpics.com/" >> $DESTINATION_FOLDER/$pornstars-image_to_download.txt echo $f done for g in $(cat $DESTINATION_FOLDER/$pornstars-image_to_download.txt ); do - curl -x $PROXY_HTTP -O --output-dir $DESTINATION_FOLDER/$pornstars $g + $curl_command -O --output-dir $DESTINATION_FOLDER/$pornstars $g # wget -e use_proxy=yes -e http_proxy=$PROXY_HTTP $g -P $DESTINATION_FOLDER/$pornstars echo $g done