Skip to content

Instantly share code, notes, and snippets.

@n3h3m
Forked from LordH3lmchen/termux-url-opener
Created June 25, 2019 08:02
Show Gist options
  • Save n3h3m/796ed9826c87a5bf7202da1cd34c7ac2 to your computer and use it in GitHub Desktop.
Save n3h3m/796ed9826c87a5bf7202da1cd34c7ac2 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
#
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 /data/data/com.termux/files/home/storage/shared/Movies/%(title)s.%(ext)s $url
;;
u)
echo "Artist"
read artist
echo "Title"
read title
echo "Album"
read album
youtube-dl -o ~/storage/music/music.flv $url
ffmpeg -i ~/storage/music/music.flv ~/storage/music/$artist-$title.mp3
mid3v2 -a $artist -t $title -A $album ~/storage/music/$artist-$title.mp3
rm ~/storage/music/music.flv
;;
s)
scdl -l $url --path ~/storage/music
echo "s need some work"
;;
w)
cd ~/storage/downloads
wget $url
;;
x)
echo "bye"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment