add the option to exclude first search
This commit is contained in:
+31
-3
@@ -1,7 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
#install required packages
|
||||
apk add curl wget
|
||||
|
||||
#named argument generation
|
||||
skip_searching_gallery="${skip_searching_gallery:-false}"
|
||||
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
if [[ $1 == "--"* ]]; then
|
||||
v="${1/--/}"
|
||||
declare "$v"="$2"
|
||||
shift
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
|
||||
#dowload from https://www.pornpics.com/pornstars/eiby-shine/
|
||||
DESTINATION_FOLDER="/data"
|
||||
PROXY_HTTP="http://gluetun-svc.gluetun.svc:8888"
|
||||
@@ -17,11 +32,24 @@ pornstars="chloe-camilla"
|
||||
|
||||
|
||||
#clear files beforehand
|
||||
echo "" > $DESTINATION_FOLDER/$pornstars-urls_of_galleries.txt
|
||||
echo "" > $DESTINATION_FOLDER/$pornstars-image_to_download.txt
|
||||
|
||||
|
||||
mkdir -p $DESTINATION_FOLDER/$pornstars
|
||||
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
|
||||
|
||||
if [[ $skip_searching_gallery == true ]]; then
|
||||
echo "not looping through galleries"
|
||||
echo "using existing file instead"
|
||||
#because we need to keep the file $DESTINATION_FOLDER/$pornstars-urls_of_galleries.txt with the existing URL , in this condition,
|
||||
#no deletion of this file
|
||||
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
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user