Compare commits
11
Commits
4351a7c0a4
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ceb6ed181f | ||
|
|
5be4a4dcf2 | ||
|
|
94d3c48e38 | ||
|
|
a61a753e0d | ||
|
|
f0a5fe75b3 | ||
|
|
31635d1f01 | ||
|
|
3bc98d2b2c | ||
|
|
cc2f43c945 | ||
|
|
1c8391d87e | ||
|
|
731865a102 | ||
|
|
f71062147f |
@@ -1,2 +1,7 @@
|
|||||||
# Stash
|
# Stash
|
||||||
|
|
||||||
|
usage :
|
||||||
|
|
||||||
|
./reddit_downloader.sh USERNAME LOCATION
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+75
@@ -0,0 +1,75 @@
|
|||||||
|
#!/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
|
||||||
|
|
||||||
|
#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"
|
||||||
|
PROXY_HTTP="http://gluetun-svc.gluetun.svc:8888"
|
||||||
|
|
||||||
|
#BASE_URL="https://www.pornpics.com/pornstars/eiby-shine/"
|
||||||
|
#pornstars="eiby-shine"
|
||||||
|
|
||||||
|
BASE_URL="https://www.pornpics.com/pornstars/chloe-camilla/"
|
||||||
|
pornstars="chloe-camilla"
|
||||||
|
|
||||||
|
#BASE_URL="https://www.pornpics.com/pornstars/becky-summer"
|
||||||
|
#pornstars="becky-summer"
|
||||||
|
|
||||||
|
|
||||||
|
#clear files beforehand
|
||||||
|
|
||||||
|
|
||||||
|
mkdir -p $DESTINATION_FOLDER/$pornstars
|
||||||
|
|
||||||
|
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_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_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_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
|
||||||
Executable
+32
@@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
apk add curl wget
|
||||||
|
|
||||||
|
#dowload from https://www.pornpics.com/pornstars/eiby-shine/
|
||||||
|
DESTINATION_FOLDER="/data"
|
||||||
|
BASE_URL="https://www.pornpics.com/pornstars/eiby-shine/"
|
||||||
|
pornstars="eiby-shine"
|
||||||
|
PROXY_HTTP="http://stashgluetun-svc:8888"
|
||||||
|
|
||||||
|
#BASE_URL="https://www.pornpics.com/pornstars/chloe-camilla/"
|
||||||
|
#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
|
||||||
|
|
||||||
|
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
|
||||||
|
echo $f
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
for g in $(cat $DESTINATION_FOLDER/$pornstars-image_to_download.txt ); do
|
||||||
|
wget -e use_proxy=yes -e http_proxy=$PROXY_HTTP $g -P $DESTINATION_FOLDER/$pornstars
|
||||||
|
echo $g
|
||||||
|
done
|
||||||
|
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: stash-pornpics-dowloader
|
||||||
|
namespace: stash
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: stash-pornpics-dowloader
|
||||||
|
image: bash
|
||||||
|
imagePullPolicy: Always
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /config
|
||||||
|
name: scripts
|
||||||
|
- mountPath: /data
|
||||||
|
mountPropagation: None
|
||||||
|
name: data-pvc
|
||||||
|
command:
|
||||||
|
- bash
|
||||||
|
- /config/download.sh
|
||||||
|
- --http_proxy
|
||||||
|
- "http://gluetun-svc.gluetun.svc:8888"
|
||||||
|
- --BASE_URL
|
||||||
|
- "{{ url }}"
|
||||||
|
- --pornstars
|
||||||
|
- "{{ name }}"
|
||||||
|
restartPolicy: Never
|
||||||
|
volumes:
|
||||||
|
- configMap:
|
||||||
|
defaultMode: 0744
|
||||||
|
name: pornpic-dowloader
|
||||||
|
name: scripts
|
||||||
|
- name: data-pvc
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: data-pvc
|
||||||
|
backoffLimit: 4
|
||||||
Reference in New Issue
Block a user