Skip to content

Instantly share code, notes, and snippets.

@szero
Last active December 25, 2021 22:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save szero/34980c5d9dc644ded93f13bfe6f05567 to your computer and use it in GitHub Desktop.
Save szero/34980c5d9dc644ded93f13bfe6f05567 to your computer and use it in GitHub Desktop.
Uploads your files to random pomf clones
#!/usr/bin/env bash
# shellcheck disable=SC1117
# Script that uploads files to random pomf-like sites
# It can take multiple files as arguments
#DED:
# https://mixtape.moe/upload.php
# https://citron.pw
# http://www.shanatan.moe/upload.php ??
# https://nyah.moe
# https://jazu.moe
# https://pomf.sinister.ly
# https://filebunker.pw
# https://lewd.es
# http://magnolia.moe/upload.php
# https://g.zxq.co/upload.php
# http://up.che.moe/upload.php
# https://lainfile.pw
# https://p.fuwafuwa.moe/upload.php
# https://null.vg/upload.php
# https://nya.is/upload.php
# https://yiff.moe/upload.php
# https://up.vidyagam.es/upload.php
# https://vidga.me/upload.php
# https://comfy.moe/upload.php
# https://pomfe.co/upload.php
# https://safe.moe/api/upload
# https://minifiles.net/upload.php
# https://jii.moe
# http://hauu.io
# http://glop.me/upload.php
# https://nup.pw
# http://rfl.pw
# https://chen.2hu.moe
# http://www.shatan.moe
# https://biyori.moe
# https://dbr.ee/upload.php
# https://a.pomf.cat/api.php API URL FOR https://pomf.cat, no idea how to set tokens
# https://api.anonymousfiles.io/
#PRIVATE ONLY:
# https://lewd.se/api.php?d=upload-tool
# https://konch.xyz/upload.php
# https://maro.xyz
#NO POMF API (or enlighten me about that):
# https://void.cat/upload.php
# https://up.asis.io/upload.php
#DISABLED UPLOADS
# https://aww.moe
# https://uchi.moe/upload.php # doko.moe is now uchi.moe
# https://pomf.pyonpyon.moe/upload.php
# https://cocaine.ninja/upload.php
# Would be nice to fetch list of those services from web and somehow validate which ones have API.
IFS=$''
set -o pipefail
serverus=(
"https://catbox.moe/user/api.php"
"https://0x0.st/"
"https://uguu.se/upload.php"
)
decode_json() {
if ! grep -oP "\"url\"\s*:\s*\"\K[a-zA-Z0-9\.\/\\\:\?&=\+\(\)\s-]+(?=\".+)" 2>/dev/null < \
<(echo "$1") | sed "s/\\\//g"; then
echo -e "\033[31m\nSome error during parsing occured. Full json dump:\n$1\033[0m" >&2
return 1
fi
return 0
}
set -- "$@"
until [[ -z "$1" ]]; do
rand="$(( (RANDOM + RANDOM) % ${#serverus[@]} ))"
if [[ ! -f "$1" ]]; then
echo -e "\033[31m\033[1m$1\033[22m: this wasn't a file my dude, skipperino!\033[0m"
shift; continue
fi
printf "\033[33muploading your stuff to \033[1m%s\033[22m\033[32m\n" \
"$(echo "${serverus[$rand]}" | grep -oP "https?\:\/\/.+?(?=\/)")"
if [[ "${serverus[$rand]}" == "https://catbox.moe/user/api.php" ]]; then
get=$(curl --connect-timeout 8 --progress-bar -fLF "fileToUpload=@\"$1\"" \
-F "reqtype=fileupload" "${serverus[$rand]}"); error="$?"; link_error=0
link="$get"
elif [[ "${serverus[$rand]}" == "https://uguu.se/upload.php" ]]; then
get=$(curl --connect-timeout 8 --progress-bar -fLF "files[]=@\"$1\"" \
"${serverus[$rand]}"); error="$?"; link_error=0
if [[ "$error" -eq 0 ]]; then
link="$(decode_json "$get")"; link_error="$?"
fi
else
get=$(curl --connect-timeout 8 --progress-bar -flF "file=@\"$1\"" \
"${serverus[$rand]}"); error="$?"; link_error=0
link="$get"
fi
if [[ "$error" -eq 0 ]] && [[ "$link_error" -eq 0 ]]; then
echo -e "\033[35m┌[Link to \033[1m$1\033[22m]"
echo -e "└>\033[0m\033[1m $link\033[0m"
shift
else
echo -e "\033[33mCouldn't upload to ${serverus[$rand]%*/upload.php}, retrying with anada one...\033[0m\n"
continue
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment