Skip to content

Instantly share code, notes, and snippets.

@mmpx12
Created May 3, 2021 01:28
Show Gist options
  • Save mmpx12/f0741d40909ed3f182fd6f9b33b580d7 to your computer and use it in GitHub Desktop.
Save mmpx12/f0741d40909ed3f182fd6f9b33b580d7 to your computer and use it in GitHub Desktop.
#!/data/data/com.termux/files/usr/bin/bash
echo -e "\e[32m"
cd ~/storage/downloads
if grep youtu <<< "$1" >/dev/null; then
youtube-dl -i --embed-thumbnail --extract-audio --audio-format mp3 -o "%(title)s.%(ext)s" "$1"
elif grep twitter <<< "$1" >/dev/null; then
if [[ $(tr -cd '/' <<<"$1" | wc -c) -eq 3 ]]; then
userid=$(cut -d '/' -f 4 <<< "$1" | cut -d '?' -f 1)
echo "$userid"
twmd -u "$userid" -o twitter -i -v -n 3000
else
postid=$(cut -d '/' -f 6 <<< "$1" | cut -d '?' -f 1)
twmd -t "$postid" -o twitter
fi
else
read -ep "[v] video
[i] ig post
[u] ig user
[g] img gallery
[*] music
Choice: " choice
case ${choice::1} in
v|V)
youtube-dl "$1"
;;
i|I)
instalooter post "$1" ~/storage/insta -T {datetime}
;;
u|U)
instalooter user "$1" ~/storage/insta -T {datetime}
;;
g|G)
termux-chroot java -jar ~/jar/ripme.jar -a ripme -w -u "$1"
;;
*)
youtube-dl -i --embed-thumbnail --extract-audio --audio-format mp3 -o "%(title)s.%(ext)s" "$1"
;;
esac
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment