-
-
Save john-peterson/37c630d097bf622b0de5a82ba9eeea6a to your computer and use it in GitHub Desktop.
leakedzone downloader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env bash | |
function cf() { | |
db=~/.mozilla/firefox/*.default-default/cookies.sqlite | |
echo "select * from moz_cookies"|sqlite3 $db|ack cf_clear| grep -o -P '(?<=cf_clearance\|).*(?=\|.leak)' | |
} | |
agent='Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0' | |
cookie="cf_clearance=$(cf)" | |
function GetVideos(){ | |
username="$1" | |
page=0 | |
while true; do | |
a=($(curl -A "$agent " -b "$cookie" -s "https://leakedzone.com/$username?page=$page&type=videos&order=0" \ | |
-H 'X-Requested-With: XMLHttpRequest' | \ | |
jq -r '.[]|(.slug + "/" + .stream_url_play)')) | |
n=0 | |
[[ "${#a[@]}" -eq 0 ]] && return | |
for i in "${a[@]}"; do | |
slug="$(cut -d "/" -f1 <<< "$i")" | |
path="$(cut -d "/" -f2 <<< "$i")" | |
url="$(echo -n "$path" | cut -c17- | rev | cut -c17- | base64 -d)" | |
yt-dlp "$url" -o "videos/$slug.%(ext)s" > /dev/null | |
echo -ne "\rpage: $page, video: $n/${#a[@]} " | |
((n++)) | |
done | |
((page++)) | |
done | |
} | |
function GetPhotos(){ | |
username="$1" | |
page=0 | |
# save pages before cookie expires | |
while true; do | |
if [ -f photos_$page ]; then | |
((page++)) | |
continue | |
fi | |
a=($(curl -A "$agent" -b "$cookie" -s "https://leakedzone.com/$username?page=$page&type=photos&order=0" \ | |
-H 'X-Requested-With: XMLHttpRequest' | jq -r '.[].image')) | |
[[ "${#a[@]}" -eq 0 ]] && break | |
printf "%s\n" "${a[@]}" > photos_$page | |
echo -ne "\rpage: $page" | |
sleep 10 | |
((page++)) | |
done | |
for page in photos_*; do | |
a=($(cat $page)) | |
n=0 | |
for i in "${a[@]}"; do | |
f=$(basename $i) | |
if [ -f $f ]; then | |
((n++)) | |
continue | |
fi | |
wget -nc --no-use-server-timestamps -q "https://image-cdn.leakedzone.com/storage/$i" | |
echo -ne "\r$page, image: $n/${#a[@]} " | |
((n++)) | |
sleep 10 | |
done | |
done | |
} | |
GetPhotos "$1" | |
# GetVideos "$1" |
Actually it seems like closing the browser saves it without any addon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had to install this to save the cookie automatically
https://addons.mozilla.org/en-US/firefox/addon/a-cookie-manager/