Skip to content

Ranoz.gg

Remote Upload

What can I say... ranoz.gg is the single greatest 'remote upload by URL' file host in history.

Proven time and time again since I wrote the original version of this script back in May. Back then a proxy was needed, but now they've loosened up a bit and that's not necessary.

No API key is required to use this service. The bucket is public.

See for yourself. The power of R2 storage and some relaxed API access policies... a match made in heaven

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# -------------------------------------
# Remote upload via URL to ranoz.gg
# ./st7_up.sh <url1> <url2> <url3> <url4> (or pass .txt file of links to upload)
# Need direct links (note: for some reason lain.la doesn't work)
# -------------------------------------
TorPort=${TorPort:-9050}
cpass=$RANDOM$RANDOM:$RANDOM
# -------------------------------------
output_links="${PWD}/rz_links.txt" 
# -------------------------------------
torcurl() {
  curl -x "socks5h://${cpass}@127.0.0.1:${TorPort}" \
  -A "Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0" \
  --connect-timeout 12 --max-time 20 --expect100-timeout 10 \
  "$@"
}
tor_check () {
  tor_status=$(jq -r '.IsTor' <(torcurl -s "https://check.torproject.org/api/ip"))
  [[ "$tor_status" == 'true' ]] || exit 1
}
# -------------------------------------
tor_check
mapfile -t remote_urls < <(printf '%s\n' "$@")
[[ -f "$1" ]] && mapfile -t remote_urls < "$1"

for r_url in "${remote_urls[@]}"; do
{
  echo -e "Remote uploading ${r_url}"
  response=$(torcurl \
  -H "Content-Type: application/json" \
  -d '{'\"url\"':'\""$r_url"\"'}' \
  "https://ranoz.gg/api/v1/files/remote/upload")
  success=$(jq -e '.[].key' > /dev/null <<< "$response")
  [[ $success -eq 0 ]] && {
    key=$(jq -r '.[].key' <<< "$response")
    if [[ -n "${key}" ]]; then
      downloadLink="https://st7.ranoz.gg/${key}"
      echo -e "\nsuccess: $downloadLink\n"
      echo -e "${r_url}\t[url]${downloadLink}[/url]" >> "$output_links"
    else
      echo -e "remote upload attempt failed"
    fi
  }
}
done