VSIDO Community

VSIDO Controls => VSIDO Changes => Topic started by: VastOne on July 07, 2015, 04:27:24 PM

Title: Change to pmytd script/muz alias
Post by: VastOne on July 07, 2015, 04:27:24 PM
VSIDO already comes with and the alias muz is setup for a directory on home called music

The following pmtyd script reflects these changes and will be added to the next ISO release

#!/bin/bash

function Bye (){
printf "%s\n" "" "Thanks.. Bye Bye.." ""
sleep 3
clear
exit 0
}

function Update (){
youtube-dl --simulate -U | less
}

function Apls(){
printf "%s\n" "" "Enter the youtube playlist link" ""
read link
youtube-dl --continue --yes-playlist --ignore-errors --extract-audio --audio-format "mp3" --audio-quality 0 --output "/home/$USER/music/%(title)s.%(ext)s" "$link"
exit 0
}

function Vpls(){
printf "%s\n" "" "Enter the youtube playlist link" ""
read link
youtube-dl --continue --yes-playlist --ignore-errors --output "/home/$USER/music/%(title)s.%(ext)s" "$link"
exit 0
}

function Audio(){
printf "%s\n" "" "Enter the youtube video link" ""
read link
youtube-dl --continue --extract-audio --audio-format "mp3" --audio-quality 0 --output "/home/$USER/music/%(title)s.%(ext)s" "$link"
exit 0
}

function Format(){
printf "%s\n" "" "Enter the youtube video link" ""
read link
youtube-dl --list-formats "$link"
printf "%s\n" "" "Enter your desired video format code from the above list" ""
read list
youtube-dl --continue --format "$list" --output "/home/$USER/music/%(title)s.%(ext)s" "$link"
exit 0
}

function Dependencies(){
printf "%s\n" "PMYTD needs to have following applications installed in order to function," "" "1. youtube-dl" "A small command-line program to download videos from youtube and other video sharing sites. It is available in repos of some distros but chances are that it is severly outdated. Here is the right way to install it," "Open terminal and run following commands," "'sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl'" "'sudo chmod a+x /usr/local/bin/youtube-dl'" "" "Youtube and other video sharing sites continually change their APIs." "So it is advised to keep youtube-dl updated to latest version." "You can check for youtube-dl updates via 'Check for update' option in PMYTD MENU." "If there is a newer version available then you can update youtube-dl by running following command in terminal," "'sudo youtube-dl -U'" "http://rg3.github.io/youtube-dl/" "" "2. Python" "Python should most likely be installed by default on your system. If not install it via your distro's package manager." "http://python.org" "" "3. FFmpeg" "Again ffmpeg should already be installed by default on most distros. If not install it via your distro's package manager." "In some distros it is called avconv. ffprobe or avprobe are also required." "https://www.ffmpeg.org/" "" "4. Downloads directory" "PMYTD is hard-wired to download video and audio to the music directory under user's home directory." "music  directory should already be there by default but just in case make sure you have music directory under your home folder." "" "Press 'q' to return to PMYTD MENU" | less
}

function About(){
printf "%s\n" "PMYTD is a simple script that can," "" "1. Download videos from youtube and other video sharing
websites." "" "2. Download and extract audio [mp3] from videos on youtube and other video sharing websites." "" "3. Download entire youtube playlists (video and audio)." "" "PMYTD is just a helper script for Ricardo Garcia's wonderful youtube-dl." "You can view the list of all supported websites here," "http://rg3.github.io/youtube-dl/supportedsites.html" "" "By the way PMYTD means Poor Man's YouTube Downloader. PMYTD is available under WTFPL licesense." "Got any question-suggestion? Please visit," "http://hakerdefo.blogspot.in/" "" "Press 'q' to return to PMYTD MENU" | less
}

while :
do
clear
cat << !
PMYTD MENU

1. About PMYTD
2. Dependencies of PMYTD
3. Download a video
4. Download & extract audio from video
5. Download entire youtube playlist
6. Download & extract audio from playlist
7. Check for update
8. Quit PMYTD

!
echo -n "Enter your choice "
read choice
case $choice in
1) About ;;
2) Dependencies ;;
3) Format ;;
4) Audio ;;
5) Vpls ;;
6) Apls ;;
7) Update ;;
8) Bye ;;
*) echo "\"$choice\" is invalid"; sleep 3;;
esac
done


Title: Re: Change to pmytd script/muz alias
Post by: Snap on July 07, 2015, 05:12:58 PM
Don't forget to edit the alias, folks. ~/.bash_aliases

alias muz='cd $HOME/music && pmytd'


or

alias muz='cd $HOME/downloads && pmytd'

I also added this line to the Menu>Multimedia section:

xfce4-terminal -T "pymtd" -x pmytd

You can tweak it for muz too. But I prefer to use downloads instead of music.
Title: Re: Change to pmytd script/muz alias
Post by: VastOne on July 07, 2015, 08:55:30 PM
^ thanks for that... I had made the change to the muz alias already
Title: Re: Change to pmytd script/muz alias
Post by: hakerdefo on July 07, 2015, 09:45:29 PM
I've made one important and some minor cosmetic changes to pmytd. Please update pmytd to this newer version. Here is the link,

Poor Man's Youtube Downloader (http://vsido.org/index.php?topic=984.msg11080#msg11080)

Cheers!!!