Skip to content

Instantly share code, notes, and snippets.

@mmpx12
Created August 21, 2023 04:20
Show Gist options
  • Save mmpx12/9364f8f9665efade3661a4cf07ae39df to your computer and use it in GitHub Desktop.
Save mmpx12/9364f8f9665efade3661a4cf07ae39df to your computer and use it in GitHub Desktop.
leakedzone downloader
#!/usr/bin/bash
function GetVideos(){
username="$1"
page=0
while true; do
a=($(curl -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
while true; do
a=($(curl -s "https://leakedzone.com/$username?page=$page&type=photos&order=0" \
-H 'X-Requested-With: XMLHttpRequest' | jq -r '.[].image'))
[[ "${#a[@]}" -eq 0 ]] && return
n=0
for i in "${a[@]}"; do
wget -qP photos "https://leakedzone.com/storage/$i"
echo -ne "\rpage: $page, image: $n/${#a[@]} "
((n++))
done
((page++))
done
}
GetPhotos "$1"
GetVideos "$1"
@mmpx12
Copy link
Author

mmpx12 commented Jul 28, 2025

@FransUrbo Every videos are now in m3u8 format?

@FransUrbo
Copy link

No idea actually.. As far as I can tell anyway. At least anything newer?

That was the only part of my changes that was a bit .. sketchy. The ffmpeg part. Don't know of a way to get the format of the finished file..
The actual videos downloaded is a .ts (whatever that is, file just say "data").

@FransUrbo
Copy link

I just stumbled across a user, where they've separated the URI and the path in the json.

In the ones we've been using so far, it looks like this:

    "slug": "80364414eaf2b05636b6b5656a618e69",
    "stream_url_play": "mcEwQsg0QCKvuv5ZVpXdTZzSlRGN5FFNNRWaX1jMnl2cmQDM4kzMiRjN1EWO0MmYjFzMyITYjZzNjBzMiNTZhVTMlJGOlVDNxgDZzUDOmNTMhNjMzE2NwM2NxUDZiVzMiJTPnl2cmAjMwUDN3MTN3ETPl1Wa09DO1NTbugjNzkjM3QzL4U3Mt9SbvNmLl52b6RWZrFWZs9yL6MHc0RHapfJuAvE3cIqOnBN7",

There, stream_url_play is URI and PATH combined. But the user I just tried on, there it looks like this:

    "slug": "eb05693a691592f53786b6cf96ff99a0",
    "stream_url_play": "1w5u6xI8O9t2EYRu==gbh1kbTd0QZNURkVUOxUTY9IzZpNnJ1MWM5YjY5M2YjFWYjV2NiZmZjVDO4AzYyMGMxMjYidDM5IWM2UDZzgDMjZTMyAjMkFGM4EzNxQWNihTMwYmNh1zZpNnJ5kTOzQzNzUzNx0TZtlGd/gTdz0mLxETO5cTNxEzL4U3Mt9SbvNmLl52b6RWZrFWZs9yL6MHc0RHatp77xrJcd97NPKE8",

Took a while to figure out what happened there, but fixed in my "revision 4".

There's a / in the stream_url_play new (?) format. So the whole string is <slug>/<stream_url_play> (hence the second slash, which is in the new stream_url_play string). We just look for that, and then do things differently.. It's not pretty, but.. :)

@FransUrbo
Copy link

FransUrbo commented Jul 28, 2025

Oh, also tried to remove the hard-coded .mp4, but then ffmpeg got nuts! Just copied the parts into the videos directory, without creating an actual concatenated video!

Using a .mp4 suffix seems to be working, I have no problem viewing it either with Preview or VLC on my (old) MacBook..

@goldenfreddynecro-boop
Copy link

@FransUrbo can you please explain to me how u got videos to download from leaked zone? I have been trying for a while now but it hasnt worked for me

@FransUrbo
Copy link

@goldenfreddynecro-boop you'll need my fork of the script - https://gist.github.com/FransUrbo/61033475c3409f8b2211c0d23daf8d90.

Basically, they're now streaming the videos in multiples. So you need to download all of them, then merge them into one. That's what my fork is doing. At least it worked a few weeks ago :).

@FransUrbo
Copy link

Oh, and they've also added a throttle on the stream, so if you try to download the parts to fast, they'll block you for a few minutes :( :(.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment