Skip to content

Instantly share code, notes, and snippets.

@smallneo
Forked from LordH3lmchen/termux-url-opener
Created May 31, 2020 20:12
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save smallneo/17284cda9230309f8f846382594aa5e5 to your computer and use it in GitHub Desktop.
Save smallneo/17284cda9230309f8f846382594aa5e5 to your computer and use it in GitHub Desktop.
termux-url-opener
#!/data/data/com.termux/files/usr/bin/zsh
#
# This is a termux-url-opener script to do diffrent tasks on my Android phone
#
#
#
# How to use this script
#############################
# Create the bin directory
# ➜ ~ mkdir bin
# ➜ ~ cd bin
# Create the script (copy & paste) I use neovim. Use your prefered editor
# ➜ nvim termux-url-opener
#
# Make it executable
# ➜ chmod +x termux-url-opener
#
# Install zsh wget and ffmpeg
# ➜ pkg install zsh wget ffmpeg python
# https://wiki.termux.com/wiki/Shells
#
# Install youtube_dl and scdl with pip
# ➜ pip install youtube_dl
# ➜ pip install scdl mutagen
#
# run the following command to enable the termux storage features
# ➜ termux-setup-storage
# https://wiki.termux.com/wiki/Termux-setup-storage
url=$1
echo "What should I do with $url ?"
echo "y) download youtube video to movies-folder"
echo "u) download youtube video and convert it to mp3 (music-folder)"
echo "s) download with scdl (soundcloud)"
echo "w) wget file to download-folder"
echo "x) nothing"
read CHOICE
case $CHOICE in
y)
youtube-dl -o "/storage/emulated/0/Movies/%(title)s.%(ext)s" $url
;;
u)
echo "Artist"
read artist
echo "Title"
read title
echo "Album"
read album
youtube-dl --extract-audio --audio-format mp3 --output "/storage/emulated/0/Music/$artist-$title.%(ext)s" $url
mid3v2 -a $artist -t $title -A $album /storage/emulated/0/Music/$artist-$title.mp3
;;
s)
scdl -l $url --path /storage/emulated/0/Music
echo "s need some work"
;;
w)
cd ~/storage/downloads
wget $url
;;
x)
echo "bye"
;;
esac
@DevRiturajKumar
Copy link

it's still working??

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