RIP ROXTerm! Yet another victim of GTK!
https://sourceforge.net/p/roxterm/discussion/422638/thread/60da6975/?limit=25#6f2d
Cheers!!!
https://sourceforge.net/p/roxterm/discussion/422638/thread/60da6975/?limit=25#6f2d
Cheers!!!
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
HOST_1='ftp-test.vsido.co.us'
HOST_1='ftp://ftp-test.vsido.co.us'
USER_1='your_ftp_user_name'
PASSWD='your_ftp_password'
LOCALPATH1='/path/to/directory/with/upload/files/*'
LOCALPATH2='/path/to/directory/with/upload/files'
RDIR="/ftp/directory/to/upload/files/to"
echo $PATH
PATH="$(echo $PATH | perl -e 'print join(":", grep { not $seen{$_}++ } split(/:/, scalar <>))')"
export PATH
sudo apt-get install mpg123
#!/usr/bin/env bash
###################
local_latitude=
local_longitude=
local_unit=
api_key=
local_rm=$(which rm)
printf "\033c"
wget --user-agent="Mozilla/5.0 Gecko/20100101" --quiet --timeout=30 "http://api.openweathermap.org/data/2.5/weather?lat=$local_latitude&lon=$local_longitude&units=$local_unit&mode=json&APPID=$api_key" --output-document "/tmp/current.json"
wget --user-agent="Mozilla/5.0 Gecko/20100101" --quiet --timeout=30 "http://api.openweathermap.org/data/2.5/forecast/daily?lat=$local_latitude&lon=$local_longitude&cnt=4&units=$local_unit&mode=json&APPID=$api_key" --output-document "/tmp/forecast.json"
printf "\033c"
if [[ ! -f "/tmp/current.json" ]]; then
echo ""
echo -e "Can not connect to openweathermap.org!"
echo -e "Please check your internet connection!"
echo ""
exit 1
else
place=$(jq -r '.city.name' "/tmp/forecast.json")
nation=$(jq -r '.city.country' "/tmp/forecast.json")
time2=$(jq -r '.list[1].dt' "/tmp/forecast.json")
time3=$(jq -r '.list[2].dt' "/tmp/forecast.json")
time4=$(jq -r '.list[3].dt' "/tmp/forecast.json")
time22=$(date -d @"$time2" +'%A, %d %B %Y')
time33=$(date -d @"$time3" +'%A, %d %B %Y')
time44=$(date -d @"$time4" +'%A, %d %B %Y')
tempcurrent=$(jq -r '.main.temp' "/tmp/current.json")
min2=$(jq -r '.list[1].temp.min' "/tmp/forecast.json")
min3=$(jq -r '.list[2].temp.min' "/tmp/forecast.json")
min4=$(jq -r '.list[3].temp.min' "/tmp/forecast.json")
max2=$(jq -r '.list[1].temp.max' "/tmp/forecast.json")
max3=$(jq -r '.list[2].temp.max' "/tmp/forecast.json")
max4=$(jq -r '.list[3].temp.max' "/tmp/forecast.json")
pressurecurrent=$(jq -r '.main.pressure' "/tmp/current.json")
pressure2=$(jq -r '.list[1].pressure' "/tmp/forecast.json")
pressure3=$(jq -r '.list[2].pressure' "/tmp/forecast.json")
pressure4=$(jq -r '.list[3].pressure' "/tmp/forecast.json")
humidcurrent=$(jq -r '.main.humidity' "/tmp/current.json")
humid2=$(jq -r '.list[1].humidity' "/tmp/forecast.json")
humid3=$(jq -r '.list[2].humidity' "/tmp/forecast.json")
humid4=$(jq -r '.list[3].humidity' "/tmp/forecast.json")
windcurrent=$(jq -r '.wind.speed' "/tmp/current.json")
wind2=$(jq -r '.list[1].speed' "/tmp/forecast.json")
wind3=$(jq -r '.list[2].speed' "/tmp/forecast.json")
wind4=$(jq -r '.list[3].speed' "/tmp/forecast.json")
direcurrent=$(jq -r '.wind.deg' "/tmp/current.json")
dire2=$(jq -r '.list[1].deg' "/tmp/forecast.json")
dire3=$(jq -r '.list[2].deg' "/tmp/forecast.json")
dire4=$(jq -r '.list[3].deg' "/tmp/forecast.json")
condicurrent=$(jq -r '.weather[].description' "/tmp/current.json")
condi2=$(jq -r '.list[1].weather[].description' "/tmp/forecast.json")
condi3=$(jq -r '.list[2].weather[].description' "/tmp/forecast.json")
condi4=$(jq -r '.list[3].weather[].description' "/tmp/forecast.json")
if [[ "$local_unit" == imperial ]]; then
windcurrent1="$windcurrent"
wind22="$wind2"
wind33="$wind3"
wind44="$wind4"
symb=$(echo -e "\u2109")
symb2="mph"
else
windcurrent1=$(awk "BEGIN {print $windcurrent * 3.6}")
wind22=$(awk "BEGIN {print $wind2 * 3.6}")
wind33=$(awk "BEGIN {print $wind3 * 3.6}")
wind44=$(awk "BEGIN {print $wind4 * 3.6}")
symb=$(echo -e "\u2103")
symb2="kph"
fi
printf "\033c"
echo -e '\e[01m'""
echo -e "Location - $place, $nation:"
echo ""
echo -e "Current weather conditions:"
echo -e '\e[0m'""
echo -e "Temperature - $tempcurrent $symb"
echo -e "Atmospheric Pressure - $pressurecurrent hPa"
echo -e "Humidity - $humidcurrent %"
echo -e "Wind speed - $windcurrent1 $symb2"
echo -e "Wind direction - $direcurrent°"
echo -e "Weather condition - $condicurrent"
echo -e '\e[01m'""
echo -e "Forecast for $time22:"
echo -e '\e[0m'""
echo -e "Minimum Temperature - $min2 $symb"
echo -e "Maximum Temperature - $max2 $symb"
echo -e "Atmospheric Pressure - $pressure2 hPa"
echo -e "Humidity - $humid2 %"
echo -e "Wind speed - $wind22 $symb2"
echo -e "Wind direction - $dire2°"
echo -e "Weather condition - $condi2"
echo -e '\e[01m'""
echo -e "Forecast for $time33:"
echo -e '\e[0m'""
echo -e "Minimum Temperature - $min3 $symb"
echo -e "Maximum Temperature - $max3 $symb"
echo -e "Atmospheric Pressure - $pressure3 hPa"
echo -e "Humidity - $humid3 %"
echo -e "Wind speed - $wind33 $symb2"
echo -e "Wind direction - $dire3°"
echo -e "Weather condition - $condi3"
echo -e '\e[01m'""
echo -e "Forecast for $time44:"
echo -e '\e[0m'""
echo -e "Minimum Temperature - $min4 $symb"
echo -e "Maximum Temperature - $max4 $symb"
echo -e "Atmospheric Pressure - $pressure4 hPa"
echo -e "Humidity - $humid4 %"
echo -e "Wind speed - $wind44 $symb2"
echo -e "Wind direction - $dire4°"
echo -e "Weather condition - $condi4"
echo -e ""
"$local_rm" -f "/tmp/forecast.json"
"$local_rm" -f "/tmp/current.json"
fi
exit 0
###################
#!/bin/bash
clear
latit=
longi=
uneet=
curl -s --connect-timeout 30 -o /tmp/current.json "http://api.openweathermap.org/data/2.5/weather?lat=$latit&lon=$longi&units=$uneet&mode=json"
curl -s --connect-timeout 30 -o /tmp/forecast.json "http://api.openweathermap.org/data/2.5/forecast/daily?lat=$latit&lon=$longi&cnt=4&units=$uneet&mode=json"
if [ ! -f /tmp/forecast.json ]; then
echo ""
echo -e "Unable to connect to openweathermap.org!"
echo -e "Check your internet connection!"
echo ""
exit 1
else
place=$(cat /tmp/forecast.json | jq -r '.city.name')
nation=$(cat /tmp/forecast.json | jq -r '.city.country')
time2=$(cat /tmp/forecast.json | jq -r '.list[1].dt')
time3=$(cat /tmp/forecast.json | jq -r '.list[2].dt')
time4=$(cat /tmp/forecast.json | jq -r '.list[3].dt')
time22=$(date -d @"$time2" +'%A, %d %B %Y')
time33=$(date -d @"$time3" +'%A, %d %B %Y')
time44=$(date -d @"$time4" +'%A, %d %B %Y')
tempcurrent=$(cat /tmp/current.json | jq -r '.main.temp')
min2=$(cat /tmp/forecast.json | jq -r '.list[1].temp.min')
min3=$(cat /tmp/forecast.json | jq -r '.list[2].temp.min')
min4=$(cat /tmp/forecast.json | jq -r '.list[3].temp.min')
max2=$(cat /tmp/forecast.json | jq -r '.list[1].temp.max')
max3=$(cat /tmp/forecast.json | jq -r '.list[2].temp.max')
max4=$(cat /tmp/forecast.json | jq -r '.list[3].temp.max')
pressurecurrent=$(cat /tmp/current.json | jq -r '.main.pressure')
pressure2=$(cat /tmp/forecast.json | jq -r '.list[1].pressure')
pressure3=$(cat /tmp/forecast.json | jq -r '.list[2].pressure')
pressure4=$(cat /tmp/forecast.json | jq -r '.list[3].pressure')
humidcurrent=$(cat /tmp/current.json | jq -r '.main.humidity')
humid2=$(cat /tmp/forecast.json | jq -r '.list[1].humidity')
humid3=$(cat /tmp/forecast.json | jq -r '.list[2].humidity')
humid4=$(cat /tmp/forecast.json | jq -r '.list[3].humidity')
windcurrent=$(cat /tmp/current.json | jq -r '.wind.speed')
wind2=$(cat /tmp/forecast.json | jq -r '.list[1].speed')
wind3=$(cat /tmp/forecast.json | jq -r '.list[2].speed')
wind4=$(cat /tmp/forecast.json | jq -r '.list[3].speed')
direcurrent=$(cat /tmp/current.json | jq -r '.wind.deg')
dire2=$(cat /tmp/forecast.json | jq -r '.list[1].deg')
dire3=$(cat /tmp/forecast.json | jq -r '.list[2].deg')
dire4=$(cat /tmp/forecast.json | jq -r '.list[3].deg')
condicurrent=$(cat /tmp/current.json | jq -r '.weather[].description')
condi2=$(cat /tmp/forecast.json | jq -r '.list[1].weather[].description')
condi3=$(cat /tmp/forecast.json | jq -r '.list[2].weather[].description')
condi4=$(cat /tmp/forecast.json | jq -r '.list[3].weather[].description')
if [ "$uneet" == imperial ]
then
windcurrent1="$windcurrent"
wind22="$wind2"
wind33="$wind3"
wind44="$wind4"
symb=°F
symb2=mph
else
windcurrent1=$(perl -le 'print $ARGV[0] * 3.6' "$windcurrent")
wind22=$(perl -le 'print $ARGV[0] * 3.6' "$wind2")
wind33=$(perl -le 'print $ARGV[0] * 3.6' "$wind3")
wind44=$(perl -le 'print $ARGV[0] * 3.6' "$wind4")
symb=°C
symb2=kph
fi
echo ""
echo -e "Location - $place, $nation:"
echo ""
echo -e "Current weather conditions:"
echo ""
echo -e "Temperature - $tempcurrent $symb"
echo -e "Atmospheric Pressure - $pressurecurrent hPa"
echo -e "Humidity - $humidcurrent %"
echo -e "Wind speed - $windcurrent1 $symb2"
echo -e "Wind direction - $direcurrent°"
echo -e "Weather condition - $condicurrent"
echo ""
echo ""
echo -e "Forecast for $time22:"
echo ""
echo -e "Minimum Temperature - $min2 $symb"
echo -e "Maximum Temperature - $max2 $symb"
echo -e "Atmospheric Pressure - $pressure2 hPa"
echo -e "Humidity - $humid2 %"
echo -e "Wind speed - $wind22 $symb2"
echo -e "Wind direction - $dire2°"
echo -e "Weather condition - $condi2"
echo ""
echo ""
echo -e "Forecast for $time33:"
echo ""
echo -e "Minimum Temperature - $min3 $symb"
echo -e "Maximum Temperature - $max3 $symb"
echo -e "Atmospheric Pressure - $pressure3 hPa"
echo -e "Humidity - $humid3 %"
echo -e "Wind speed - $wind33 $symb2"
echo -e "Wind direction - $dire3°"
echo -e "Weather condition - $condi3"
echo ""
echo ""
echo -e "Forecast for $time44:"
echo ""
echo -e "Minimum Temperature - $min4 $symb"
echo -e "Maximum Temperature - $max4 $symb"
echo -e "Atmospheric Pressure - $pressure4 hPa"
echo -e "Humidity - $humid4 %"
echo -e "Wind speed - $wind44 $symb2"
echo -e "Wind direction - $dire4°"
echo -e "Weather condition - $condi4"
echo ""
rm /tmp/forecast.json
rm /tmp/current.json
fi
exit 0
sudo apt-get install jq
latit=51.500
longi=-0.117
uneet=metric
latit=40.714
longi=-74.006
uneet=imperial
#!/bin/bash
RED='\e[41m'
BLUE='\e[44m'
NC='\e[0m'
PLAYER="mplayer -nolirc -really-quiet -cache 512 -cache-min 25"
while :
do
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo ""
echo -e "Station $BLUE List $NC :"
echo ""
echo -e "$BLUE 01 $NC 7 Inch Soul $BLUE 02 $NC BAGeL Radio"
echo -e "$BLUE 03 $NC Beat Blender $BLUE 04 $NC Boot Liquor"
echo -e "$BLUE 05 $NC Black Rock FM $BLUE 06 $NC cliqhop idm"
echo -e "$BLUE 07 $NC Covers $BLUE 08 $NC Deep Space One"
echo -e "$BLUE 09 $NC DEF CON Radio $BLUE 10 $NC Digitalis"
echo -e "$BLUE 11 $NC Doomed $BLUE 12 $NC Drone Zone"
echo -e "$BLUE 13 $NC Dub Step Beyond $BLUE 14 $NC Earwaves"
echo -e "$BLUE 15 $NC Folk Forward $BLUE 16 $NC Groove Salad"
echo -e "$BLUE 17 $NC Illinois Street Lounge $BLUE 18 $NC Indie Pop Rocks!"
echo -e "$BLUE 19 $NC Lush $BLUE 20 $NC Mission Control"
echo -e "$BLUE 21 $NC PopTron $BLUE 22 $NC Secret Agent"
echo -e "$BLUE 23 $NC SF 10–33 $BLUE 24 $NC Sonic Universe"
echo -e "$BLUE 25 $NC Space Station Soma $BLUE 26 $NC Suburbs of Goa"
echo -e "$BLUE 27 $NC The Trip $BLUE 28 $NC Underground 80s"
echo -e "$BLUE 29 $NC BBC Radio 1 $BLUE 30 $NC BBC Radio 2"
echo -e "$BLUE 31 $NC BBC Radio 3 $BLUE 32 $NC BBC Radio 4"
echo -e "$BLUE 33 $NC BBC Radio 4 Extra $BLUE 34 $NC BBC World Service"
echo -e "$BLUE 35 $NC All 60s All the Time $BLUE 36 $NC Beatles-A-Rama"
echo -e "$BLUE 37 $NC RADIO ENERGY $BLUE 38 $NC Radio Paradise"
echo -e "$BLUE 39 $NC Radio Record $BLUE 40 $NC RADIO ROCK"
echo -e "$BLUE 41 $NC Radio Swing Worldwide $BLUE 42 $NC Smooth Jazz"
echo -e "$BLUE 43 $NC True Oldies Channel $RED 44 $BLUE Exit RADIO VSIDO $NC"
echo ""
echo ""
echo -e "Select a $BLUE station $NC between 1 to 43 and hit $BLUE [Enter] $NC to $BLUE PLAY $NC :"
echo ""
echo -e "Select $RED 44 $NC to $BLUE Exit $NC :"
echo ""
read VSIDO
case $VSIDO in
1)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE 7 Inch Soul $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/7soul
continue
;;
2)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE BAGeL Radio $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/bagel
continue
;;
3)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Beat Blender $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/beatblender
continue
;;
4)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Boot Liquor $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/bootliquor
continue
;;
5)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Black Rock FM $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/brfm
continue
;;
6)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE cliqhop idm $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/cliqhop
continue
;;
7)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Covers $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/covers
continue
;;
8)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Deep Space One $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/deepspaceone
continue
;;
9)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE DEF CON Radio $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/defcon
continue
;;
10)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Digitalis $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/digitalis
continue
;;
11)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Doomed $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/doomed
continue
;;
12)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Drone Zone $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/dronezone
continue
;;
13)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Dub Step Beyond $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/dubstep
continue
;;
14)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Earwaves $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/earwaves
continue
;;
15)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Folk Forward $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/folkfwd
continue
;;
16)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Groove Salad $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/groovesalad
continue
;;
17)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Illinois Street Lounge $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/illstreet
continue
;;
18)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Indie Pop Rocks! $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/indiepop
continue
;;
19)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Lush $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/lush
continue
;;
20)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Mission Control $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/missioncontrol
continue
;;
21)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE PopTron $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/poptron
continue
;;
22)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Secret Agent $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/secretagent
continue
;;
23)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE SF 10–33 $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/sf1033
continue
;;
24)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Sonic Universe $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/sonicuniverse
continue
;;
25)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Space Station Soma $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/spacestation
continue
;;
26)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Suburbs of Goa $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/suburbsofgoa
continue
;;
27)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE The Trip $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/thetrip
continue
;;
28)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Underground 80s $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/u80s
continue
;;
29)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE BBC Radio 1 $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_q
continue
;;
30)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE BBC Radio 2 $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio2_mf_q
continue
;;
31)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE BBC Radio 3 $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/http-icy-aac-lc-a/format/pls/vpid/bbc_radio_three.pls
continue
;;
32)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE BBC Radio 4 $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4fm_mf_q
continue
;;
33)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE BBC Radio 4 Extra $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4extra_mf_q
continue
;;
34)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE BBC World Service $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://wsdownload.bbc.co.uk/worldservice/meta/live/shoutcast/mp3/eieuk.pls
continue
;;
35)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE All 60s All the Time $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://streaming303.radionomy.com:80/keepfree60s
continue
;;
36)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Beatles-A-Rama $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://streaming303.radionomy.com:80/beatlesarama
continue
;;
37)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE RADIO ENERGY $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://stream.radioreklama.bg:80/nrj.ogg
continue
;;
38)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Radio Paradise $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://stream-uk1.radioparadise.com:80/mp3-192
continue
;;
39)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Radio Record $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://air.radiorecord.ru:8101/rr_128
continue
;;
40)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE RADIO ROCK $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://stream.radioreklama.bg:80/radio1rock.ogg
continue
;;
41)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Radio Swing Worldwide $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://streaming303.radionomy.com:80/radioswingworldwide
continue
;;
42)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Smooth Jazz $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://hestia.cdnstream.com:80/1256_128
continue
;;
43)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE True Oldies Channel $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://streaming304.radionomy.com:80/trueoldies
continue
;;
44)
clear
echo ""
echo -e "$BLUE 'When I die, just keep playing the records' $RED Jimi Hendrix $NC"
echo ""
sleep 3
clear
break
exit 0
;;
*)
clear
echo ""
echo -e "$RED Wrong Choice!!! $NC"
echo ""
sleep 3
clear
continue
;;
esac
done
sudo apt-get install jq
#!/bin/bash
clear
echo ""
echo -e "pmdc calculates distance & travel time between two locations."
echo ""
echo -e "Distance & travel time are calculated using the road network."
echo ""
echo -e "Press Enter key to continue...."
echo ""
read EnterKey
clear
echo ""
echo -e "Location 1 - From:"
echo ""
echo ""
echo -e "Enter the name of city-town-village"
echo ""
read village
echo ""
echo -e "Enter the name of state-county-province"
echo ""
read province
echo ""
echo -e "Enter the name of country"
echo ""
read country
clear
echo ""
echo -e "Location 2 - To:"
echo ""
echo ""
echo -e "Enter the name of city-town-village"
echo ""
read city
echo ""
echo -e "Enter the name of state-county-province"
echo ""
read state
echo ""
echo -e "Enter the name of country"
echo ""
read name
clear
city_1=$(echo "$village" | sed 's/ \+/+/g')
state_1=$(echo "$province" | sed 's/ \+/+/g')
country_1=$(echo "$country" | sed 's/ \+/+/g')
city_2=$(echo "$city" | sed 's/ \+/+/g')
state_2=$(echo "$state" | sed 's/ \+/+/g')
country_2=$(echo "$name" | sed 's/ \+/+/g')
curl -s --connect-timeout 30 -o /tmp/pmdc.json "https://maps.googleapis.com/maps/api/distancematrix/json?origins=$city_1+$state_1+$country_1&destinations=$city_2+$state_2+$country_2&language=en"
if [ ! -f /tmp/pmdc.json ]; then
echo ""
echo -e "Unable to connect to Internet!"
echo -e "Check your Internet connection!"
echo ""
exit 1
else
addvalid=$(cat /tmp/pmdc.json | grep "NOT_FOUND")
if [[ -n "$addvalid" ]]; then
echo ""
echo -e "No results found!"
echo -e "May be you misspelled a name?!?"
echo ""
exit 1
else
resvalid=$(cat /tmp/pmdc.json | grep "ZERO_RESULTS")
if [[ -n "$resvalid" ]]; then
echo ""
echo -e "Sorry! No distance data is available!"
echo ""
exit 1
else
orgadd=$(cat /tmp/pmdc.json | jq -r '.origin_addresses' | sed -e 's/\"//g' -e 's/\[//g' -e 's/\]//g' -e 's/^[ \t]*//')
desadd=$(cat /tmp/pmdc.json | jq -r '.destination_addresses' | sed -e 's/\"//g' -e 's/\[//g' -e 's/\]//g' -e 's/^[ \t]*//')
distbet=$(cat /tmp/pmdc.json | jq -r '.rows[].elements[].distance.text')
durabet=$(cat /tmp/pmdc.json | jq -r '.rows[].elements[].duration.text')
echo ""
echo -e "From: $orgadd"
echo ""
echo -e "To: $desadd"
echo ""
echo -e "Distance -> $distbet"
echo ""
echo -e "Travel time -> $durabet"
echo ""
rm /tmp/pmdc.json
fi
fi
fi
exit 0
sudo apt-get install jq
#!/bin/bash
latit=
longi=
eleva=
curl -s --connect-timeout 30 -o /tmp/issn.json "http://api.open-notify.org/iss-now.json"
curl -s --connect-timeout 30 -o /tmp/issp.json "http://api.open-notify.org/iss-pass.json?lat=$latit&lon=$longi&alt=$eleva&n=10"
curl -s --connect-timeout 30 -o /tmp/astros.json "http://api.open-notify.org/astros.json"
issnowtu=$(cat /tmp/issn.json | jq -r '.timestamp')
issnowth=$(date -d @"$issnowtu" +'%H:%M:%S (%d-%m-%Y)')
latit=$(cat /tmp/issn.json | jq -r '.iss_position.latitude')
longi=$(cat /tmp/issn.json | jq -r '.iss_position.longitude')
isspd1=$(cat /tmp/issp.json | jq -r '.response[0].duration')
isspd11=$(printf '%d:%02d\n' $(($isspd1/60%60)) $(($isspd1%60)))
isspd2=$(cat /tmp/issp.json | jq -r '.response[1].duration')
isspd22=$(printf '%d:%02d\n' $(($isspd2/60%60)) $(($isspd2%60)))
isspd3=$(cat /tmp/issp.json | jq -r '.response[2].duration')
isspd33=$(printf '%d:%02d\n' $(($isspd3/60%60)) $(($isspd3%60)))
isspd4=$(cat /tmp/issp.json | jq -r '.response[3].duration')
isspd44=$(printf '%d:%02d\n' $(($isspd4/60%60)) $(($isspd4%60)))
isspd5=$(cat /tmp/issp.json | jq -r '.response[4].duration')
isspd55=$(printf '%d:%02d\n' $(($isspd5/60%60)) $(($isspd5%60)))
isspd6=$(cat /tmp/issp.json | jq -r '.response[5].duration')
isspd66=$(printf '%d:%02d\n' $(($isspd6/60%60)) $(($isspd6%60)))
isspd7=$(cat /tmp/issp.json | jq -r '.response[6].duration')
isspd77=$(printf '%d:%02d\n' $(($isspd7/60%60)) $(($isspd7%60)))
isspd8=$(cat /tmp/issp.json | jq -r '.response[7].duration')
isspd88=$(printf '%d:%02d\n' $(($isspd8/60%60)) $(($isspd8%60)))
isspd9=$(cat /tmp/issp.json | jq -r '.response[8].duration')
isspd99=$(printf '%d:%02d\n' $(($isspd9/60%60)) $(($isspd9%60)))
isspd10=$(cat /tmp/issp.json | jq -r '.response[9].duration')
isspd100=$(printf '%d:%02d\n' $(($isspd10/60%60)) $(($isspd10%60)))
isspt1=$(cat /tmp/issp.json | jq -r '.response[0].risetime')
isspt11=$(date -d @"$isspt1" +'%d-%m-%Y (%H:%M:%S)')
isspt2=$(cat /tmp/issp.json | jq -r '.response[1].risetime')
isspt22=$(date -d @"$isspt2" +'%d-%m-%Y (%H:%M:%S)')
isspt3=$(cat /tmp/issp.json | jq -r '.response[2].risetime')
isspt33=$(date -d @"$isspt3" +'%d-%m-%Y (%H:%M:%S)')
isspt4=$(cat /tmp/issp.json | jq -r '.response[3].risetime')
isspt44=$(date -d @"$isspt4" +'%d-%m-%Y (%H:%M:%S)')
isspt5=$(cat /tmp/issp.json | jq -r '.response[4].risetime')
isspt55=$(date -d @"$isspt5" +'%d-%m-%Y (%H:%M:%S)')
isspt6=$(cat /tmp/issp.json | jq -r '.response[5].risetime')
isspt66=$(date -d @"$isspt6" +'%d-%m-%Y (%H:%M:%S)')
isspt7=$(cat /tmp/issp.json | jq -r '.response[6].risetime')
isspt77=$(date -d @"$isspt7" +'%d-%m-%Y (%H:%M:%S)')
isspt8=$(cat /tmp/issp.json | jq -r '.response[7].risetime')
isspt88=$(date -d @"$isspt8" +'%d-%m-%Y (%H:%M:%S)')
isspt9=$(cat /tmp/issp.json | jq -r '.response[8].risetime')
isspt99=$(date -d @"$isspt9" +'%d-%m-%Y (%H:%M:%S)')
isspt10=$(cat /tmp/issp.json | jq -r '.response[9].risetime')
isspt100=$(date -d @"$isspt10" +'%d-%m-%Y (%H:%M:%S)')
astrock=$(cat /tmp/astros.json | grep "0,")
curl -s --connect-timeout 30 -o /tmp/gcd.json "https://maps.googleapis.com/maps/api/geocode/json?latlng=$latit,$longi&components=locality&language=en"
issnowl=$(cat /tmp/gcd.json | jq -r '.results[0].formatted_address')
issnowlc=$(cat /tmp/gcd.json | grep "ZERO_RESULTS")
echo ""
#echo -e "International Space Station (ISS) on $issnowth is over,"
echo -e "Current Time -> $issnowth"
echo ""
echo -e "Current Location of ISS :"
echo ""
echo -e "Latitude -> $latit"
echo -e "Longitude -> $longi"
echo ""
echo -e "In layman's term ISS is currently over the skies of,"
echo ""
if [[ -z "$issnowlc" ]]; then
echo -e "$issnowl"
else
echo -e "Some unmapped region of earth."
echo ""
fi
echo ""
echo -e "ISS will pass over your location at these times :"
echo ""
echo -e "Passing Date & Time -> $isspt11"
echo -e "Passing Duration (Minutes:Seconds) -> $isspd11"
echo ""
echo -e "Passing Date & Time -> $isspt22"
echo -e "Passing Duration (Minutes:Seconds) -> $isspd22"
echo ""
echo -e "Passing Date & Time -> $isspt33"
echo -e "Passing Duration (Minutes:Seconds) -> $isspd33"
echo ""
echo -e "Passing Date & Time -> $isspt44"
echo -e "Passing Duration (Minutes:Seconds) -> $isspd44"
echo ""
echo -e "Passing Date & Time -> $isspt55"
echo -e "Passing Duration (Minutes:Seconds) -> $isspd55"
echo ""
echo -e "Passing Date & Time -> $isspt66"
echo -e "Passing Duration (Minutes:Seconds) -> $isspd66"
echo ""
echo -e "Passing Date & Time -> $isspt77"
echo -e "Passing Duration (Minutes:Seconds) -> $isspd77"
echo ""
echo -e "Passing Date & Time -> $isspt88"
echo -e "Passing Duration (Minutes:Seconds) -> $isspd88"
echo ""
echo -e "Passing Date & Time -> $isspt99"
echo -e "Passing Duration (Minutes:Seconds) -> $isspd99"
echo ""
echo -e "Passing Date & Time -> $isspt100"
echo -e "Passing Duration (Minutes:Seconds) -> $isspd100"
echo ""
echo ""
if [[ -z "$astrock" ]]; then
astrop=$(cat /tmp/astros.json | jq -r '.people[] | .name')
astroc=$(cat /tmp/astros.json | jq -r '.people[] | .craft')
astropc=$(paste <(echo "$astrop") <(echo "$astroc"))
astropn=$(cat /tmp/astros.json | jq -r '.number')
echo -e "Do you know there are $astropn humans in space currently!"
echo -e "Here are the names of astronauts & spacecraft they are on,"
echo ""
echo -e "$astropc" | sed -e "s/[[:space:]]\+/ /g"
echo ""
else
echo ""
fi
rm /tmp/issn.json
rm /tmp/issp.json
rm /tmp/astros.json
rm /tmp/gcd.json
exit 0
#!/bin/sh
echo ""
echo "Expands a short url & displays the original url."
echo ""
echo "Enter a short url: "
read input_variable
if long=$(curl -s -o /dev/null --head -w "%{url_effective}\n" -L "$input_variable"); then
echo "Original url -> $long"
else
echo "Sorry! Invalid url!"
fi
#!/bin/sh
if [ -t 0 ]; then
if [ -z "$1" ]; then
echo ""
echo "Shortens url with tny.im url shortener."
echo ""
echo "It shortens email & Bitcoin-Dogecoin-Litecoin addresses too."
echo ""
echo "Usage: tny long_url_address keyword"
echo ""
echo "Second argument 'keyword' is optional. Use it to customize the short url."
echo ""
exit 1
fi
url=$1;
else
while read -r line; do
url=$line
done
fi
printf "%s" "Short url -> " && echo `wget -q -O - http://tny.im/yourls-api.php?action=shorturl\&format=simple\&url="$url"\&keyword="$2"`
#!/bin/bash
function ByE (){
clear
echo ""
echo -e '\E[1;31;40m'"It's "'\E[1;32;40m'"funny "'\E[1;33;40m'" how"'\E[1;35;40m'" the"'\E[1;36;40m'" colors"'\E[1;31;40m'" of"'\E[1;32;40m'" the"'\E[1;33;40m'" real"'\E[1;35;40m'" world"'\E[1;36;40m'" only"'\E[1;31;40m'" seem"'\E[1;32;40m'" really"'\E[1;33;40m'" real"
echo -e '\E[1;36;40m'"when "'\E[1;31;40m'"you "'\E[1;32;40m'"viddy "'\E[1;33;40m'"them "'\E[1;35;40m'"on "'\E[1;36;40m'"the "'\E[1;31;40m'"screen."
echo ""
echo -e '\e[0m'"Alex, A Clockwork Orange"
echo ""
sleep 4
clear
exit 0
}
function HelP (){
clear
printf "%s\n" "" "Having problems running PMYTD?" "" "First make sure you have all the required dependencies installed." "You can read more about it in 'Dependencies of PMYTD' option" "in PMYTD MENU." "" "Having problems downloading videos?" "" "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 updates' option" "in PMYTD MENU." "If there is a newer version available then please update youtube-dl." "" "For any other queries you can contact me at," "http://hakerdefo.blogspot.com" "" "Press 'q' to return to PMYTD MENU" "" | less
}
function UpdatE (){
clear
ping -q -c 2 yt-dl.org >/dev/null 2>&1 || { clear; echo -e "Can't connect to youtube-dl server! Please try later!" >&2; read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key; MenU; }
ytdllv=$(curl -sL -w "%{url_effective}\\n" "https://yt-dl.org/downloads/latest/" -o /dev/null | cut -c 29- | sed 's/[/]//g')
ytdlcv=$(youtube-dl --version)
if [ "$ytdllv" == "$ytdlcv" ]; then
echo ""
echo -e "Installed version of youtube-dl - $ytdlcv"
echo -e "Available version of youtube-dl - $ytdllv"
echo ""
echo -e "youtube-dl is up-to-date."
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
else
echo ""
echo -e "Installed version of youtube-dl - $ytdlcv"
echo -e "Available version of youtube-dl - $ytdllv"
echo ""
echo -e "youtube-dl update is available."
echo ""
echo -e "Would you like to update youtube-dl?"
echo ""
echo -e "01 Update youtube-dl"
echo -e "02 Return to PMYTD MENU"
echo ""
echo -e "Enter your choice: "
echo ""
read choice
case $choice in
1 | 01)
clear
ytdll=$(which youtube-dl)
if [ -w "$ytdll" ]; then
youtube-dl -U
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
else
resu=$(whoami)
echo ""
echo "Please enter password for user $resu"
echo ""
sudo youtube-dl -U
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
fi
;;
2 | 02)
clear
MenU
;;
*)
clear
echo ""
echo -e "$choice is an invalid option!"
echo ""
sleep 4
UpdatE
;;
esac
fi
}
function DiE(){
clear
echo ""
echo -e "OOPS!!! Something Went Wrong!!!"
echo -e "Please make sure '$link' exists."
echo -e "Also make sure video is available."
echo ""
exit 1
}
function AplS(){
clear
printf "%s\n" "" "Enter the youtube playlist link: " ""
read link
clear
youtube-dl --continue --yes-playlist --ignore-errors --extract-audio --audio-format "mp3" --audio-quality 0 --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
}
function VplS(){
clear
printf "%s\n" "" "Enter the youtube playlist link: " ""
read link
clear
youtube-dl --continue --yes-playlist --ignore-errors --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
}
function AudiO(){
clear
printf "%s\n" "" "Enter the youtube video link: " ""
read link
clear
youtube-dl --continue --extract-audio --audio-format "mp3" --audio-quality 0 --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
}
function FormaT(){
clear
printf "%s\n" "" "Enter the youtube video link: " ""
read link
clear
youtube-dl --list-formats "$link" || DiE
printf "%s\n" "" "Enter your desired video format code from the above list:" ""
read list
clear
youtube-dl --continue --format "$list" --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
}
function DependencieS(){
clear
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 it" "would most likely be 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-dl homepage -> https://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." "" "Python homepage -> 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." "" "FFmpeg homepage -> https://www.ffmpeg.org/" "" "4. cURL" "curl is an open source command line tool and library for transferring data" "with URL syntax, supporting DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP," "IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMTP, SMTPS," "Telnet and TFTP." "You can easily install it using your package manager." "" "cURL homepage -> http://curl.haxx.se/" "" "5. Ping" "ping uses the ICMP protocol's mandatory ECHO_REQUEST datagram to elicit an" "ICMP ECHO_RESPONSE from a host or gateway." "ping is part of iputils package. Install iputils via your package manager." "" "iputils homepage -> http://www.skbuff.net/iputils/" "" "6. Downloads directory" "PMYTD is hard-wired to download video and audio to the Downloads directory" "under user's home directory." "Downloads directory should already be there by default but just in case make" "sure you have Downloads directory under your home folder." "" "Press 'q' to return to PMYTD MENU" "" | less
}
function AbouT(){
clear
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 video sharing websites here," "http://rg3.github.io/youtube-dl/supportedsites.html" "" "By the way PMYTD means Poor Man's YouTube Downloader. PMYTD is" "available under CC0 1.0 Universal licesense." "Got any question-suggestion? Please visit," "http://hakerdefo.blogspot.in/" "" "Press 'q' to return to PMYTD MENU" "" | less
}
function MenU(){
clear
echo ""
echo -e "PMYTD MENU"
echo ""
echo -e "01 About PMYTD"
echo -e "02 Dependencies of PMYTD"
echo -e "03 Download a video"
echo -e "04 Download & extract audio from video"
echo -e "05 Download entire youtube playlist"
echo -e "06 Download & extract audio from playlist"
echo -e "07 Check for updates"
echo -e "08 Help"
echo -e "09 Quit PMYTD"
echo ""
echo -e "Enter your choice: "
echo ""
read choice
case $choice in
01 | 1)
AbouT
;;
02 | 2)
DependencieS
;;
03 | 3)
FormaT
;;
04 | 4)
AudiO
;;
05 | 5)
VplS
;;
06 | 6)
AplS
;;
07 | 7)
UpdatE
;;
08 | 8)
HelP
;;
09 | 9)
ByE
;;
*)
clear
echo ""
echo -e "$choice is an invalid option!"
echo ""
sleep 4
;;
esac
}
while :
do
MenU
done
#!/bin/bash
function ByE (){
clear
echo ""
echo -e '\E[1;31;40m'"It's "'\E[1;32;40m'"funny "'\E[1;33;40m'" how"'\E[1;35;40m'" the"'\E[1;36;40m'" colors"'\E[1;31;40m'" of"'\E[1;32;40m'" the"'\E[1;33;40m'" real"'\E[1;35;40m'" world"'\E[1;36;40m'" only"'\E[1;31;40m'" seem"'\E[1;32;40m'" really"'\E[1;33;40m'" real"
echo -e '\E[1;36;40m'"when "'\E[1;31;40m'"you "'\E[1;32;40m'"viddy "'\E[1;33;40m'"them "'\E[1;35;40m'"on "'\E[1;36;40m'"the "'\E[1;31;40m'"screen."
echo ""
echo -e '\e[0m'"Alex, A Clockwork Orange"
echo ""
sleep 4
clear
exit 0
}
function HelP (){
clear
printf "%s\n" "" "Having problems running PMYTD?" "" "First make sure you have all the required dependencies installed." "You can read more about it in 'Dependencies of PMYTD' option" "in PMYTD MENU." "" "Having problems downloading videos?" "" "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 updates' option" "in PMYTD MENU." "If there is a newer version available then please update youtube-dl." "" "For any other queries you can contact me at," "http://hakerdefo.blogspot.com" "" "Press 'q' to return to PMYTD MENU" "" | less
}
function UpdatE (){
clear
ping -q -c 2 yt-dl.org >/dev/null 2>&1 || { clear; echo -e "Can't connect to youtube-dl server! Please try later!" >&2; read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key; MenU; }
ytdllv=$(curl -sL -w "%{url_effective}\\n" "https://yt-dl.org/downloads/latest/" -o /dev/null | tail -c-12 | sed 's/[/]//g')
ytdlcv=$(youtube-dl --version)
if [ "$ytdllv" == "$ytdlcv" ]; then
echo ""
echo -e "Installed version of youtube-dl - $ytdlcv"
echo -e "Available version of youtube-dl - $ytdllv"
echo ""
echo -e "youtube-dl is up-to-date."
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
else
echo ""
echo -e "Installed version of youtube-dl - $ytdlcv"
echo -e "Available version of youtube-dl - $ytdllv"
echo ""
echo -e "youtube-dl update is available."
echo ""
echo -e "Would you like to update youtube-dl?"
echo ""
echo -e "01 Update youtube-dl"
echo -e "02 Return to PMYTD MENU"
echo ""
echo -e "Enter your choice: "
echo ""
read choice
case $choice in
1 | 01)
clear
ytdll=$(which youtube-dl)
if [ -w "$ytdll" ]; then
youtube-dl -U
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
else
resu=$(whoami)
resu_test=$(sudo -u "$resu" -n true >/dev/null 2>&1)
if [[ -z "$resu_test" ]]; then
echo ""
echo -e "Please enter root password"
echo ""
su -c 'youtube-dl -U'
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
else
echo ""
echo "Please enter password for user $resu"
echo ""
sudo youtube-dl -U
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
fi
fi
;;
2 | 02)
clear
MenU
;;
*)
clear
echo ""
echo -e "$choice is an invalid option!"
echo ""
sleep 4
UpdatE
;;
esac
fi
}
function DiE(){
clear
echo ""
echo -e "OOPS!!! Something Went Wrong!!!"
echo -e "Please make sure '$link' exists."
echo -e "Also make sure video is available."
echo ""
exit 1
}
function AplS(){
clear
printf "%s\n" "" "Enter the youtube playlist link: " ""
read link
clear
youtube-dl --continue --yes-playlist --ignore-errors --extract-audio --audio-format "mp3" --audio-quality 0 --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
}
function VplS(){
clear
printf "%s\n" "" "Enter the youtube playlist link: " ""
read link
clear
youtube-dl --continue --yes-playlist --ignore-errors --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
}
function AudiO(){
clear
printf "%s\n" "" "Enter the youtube video link: " ""
read link
clear
youtube-dl --continue --extract-audio --audio-format "mp3" --audio-quality 0 --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
}
function FormaT(){
clear
printf "%s\n" "" "Enter the youtube video link: " ""
read link
clear
youtube-dl --list-formats "$link" || DiE
printf "%s\n" "" "Enter your desired video format code from the above list:" ""
read list
clear
youtube-dl --continue --format "$list" --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
}
function DependencieS(){
clear
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 it" "would most likely be 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-dl homepage -> https://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." "" "Python homepage -> 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." "" "FFmpeg homepage -> https://www.ffmpeg.org/" "" "4. cURL" "curl is an open source command line tool and library for transferring data" "with URL syntax, supporting DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP," "IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMTP, SMTPS," "Telnet and TFTP." "You can easily install it using your package manager." "" "cURL homepage -> http://curl.haxx.se/" "" "5. Ping" "ping uses the ICMP protocol's mandatory ECHO_REQUEST datagram to elicit an" "ICMP ECHO_RESPONSE from a host or gateway." "ping is part of iputils package. Install iputils via your package manager." "" "iputils homepage -> http://www.skbuff.net/iputils/" "" "6. Downloads directory" "PMYTD is hard-wired to download video and audio to the Downloads directory" "under user's home directory." "Downloads directory should already be there by default but just in case make" "sure you have Downloads directory under your home folder." "" "Press 'q' to return to PMYTD MENU" "" | less
}
function AbouT(){
clear
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 video sharing websites here," "http://rg3.github.io/youtube-dl/supportedsites.html" "" "By the way PMYTD means Poor Man's YouTube Downloader. PMYTD is" "available under CC0 1.0 Universal licesense." "Got any question-suggestion? Please visit," "http://hakerdefo.blogspot.in/" "" "Press 'q' to return to PMYTD MENU" "" | less
}
function MenU(){
clear
echo ""
echo -e "PMYTD MENU"
echo ""
echo -e "01 About PMYTD"
echo -e "02 Dependencies of PMYTD"
echo -e "03 Download a video"
echo -e "04 Download & extract audio from video"
echo -e "05 Download entire youtube playlist"
echo -e "06 Download & extract audio from playlist"
echo -e "07 Check for updates"
echo -e "08 Help"
echo -e "09 Quit PMYTD"
echo ""
echo -e "Enter your choice: "
echo ""
read choice
case $choice in
01 | 1)
AbouT
;;
02 | 2)
DependencieS
;;
03 | 3)
FormaT
;;
04 | 4)
AudiO
;;
05 | 5)
VplS
;;
06 | 6)
AplS
;;
07 | 7)
UpdatE
;;
08 | 8)
HelP
;;
09 | 9)
ByE
;;
*)
clear
echo ""
echo -e "$choice is an invalid option!"
echo ""
sleep 4
;;
esac
}
while :
do
MenU
done
#!/bin/bash
function ByE (){
clear
echo ""
echo -e '\E[1;31;40m'"It's "'\E[1;32;40m'"funny "'\E[1;33;40m'" how"'\E[1;35;40m'" the"'\E[1;36;40m'" colors"'\E[1;31;40m'" of"'\E[1;32;40m'" the"'\E[1;33;40m'" real"'\E[1;35;40m'" world"'\E[1;36;40m'" only"'\E[1;31;40m'" seem"'\E[1;32;40m'" really"'\E[1;33;40m'" real"
echo -e '\E[1;36;40m'"when "'\E[1;31;40m'"you "'\E[1;32;40m'"viddy "'\E[1;33;40m'"them "'\E[1;35;40m'"on "'\E[1;36;40m'"the "'\E[1;31;40m'"screen."
echo ""
echo -e '\e[0m'"Alex, A Clockwork Orange"
echo ""
sleep 4
clear
exit 0
}
function HelP (){
clear
printf "%s\n" "" "Having problems running PMYTD?" "" "First make sure you have all the required dependencies installed." "You can read more about it in 'Dependencies of PMYTD' option" "in PMYTD MENU." "" "Having problems downloading videos?" "" "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 updates' option" "in PMYTD MENU." "If there is a newer version available then please update youtube-dl." "" "For any other queries you can contact me at," "http://hakerdefo.blogspot.com" "" "Press 'q' to return to PMYTD MENU" "" | less
}
function UpdatE (){
clear
ytdllv=$(curl -sL -w "%{url_effective}\\n" "https://yt-dl.org/downloads/latest/" -o /dev/null | tail -c-12 | sed 's/[/]//g')
ytdlcv=$(youtube-dl --version)
if [ "$ytdllv" == "$ytdlcv" ]; then
echo ""
echo -e "Installed version of youtube-dl - $ytdlcv"
echo -e "Available version of youtube-dl - $ytdllv"
echo ""
echo -e "youtube-dl is up-to-date."
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
else
echo ""
echo -e "Installed version of youtube-dl - $ytdlcv"
echo -e "Available version of youtube-dl - $ytdllv"
echo ""
echo -e "youtube-dl update is available."
echo ""
echo -e "Would you like to update youtube-dl?"
echo ""
echo -e "01 Update youtube-dl"
echo -e "02 Return to PMYTD MENU"
echo ""
echo -e "Enter your choice: "
echo ""
read choice
case $choice in
1 | 01)
clear
ytdll=$(which youtube-dl)
if [ -w "$ytdll" ]; then
youtube-dl -U
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
else
resu=$(whoami)
resu_test=$(sudo -u "$resu" -n true >/dev/null 2>&1)
if [[ -z "$resu_test" ]]; then
echo ""
echo -e "Please enter root password"
echo ""
su -c 'youtube-dl -U'
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
else
echo ""
echo "Please enter password for user $resu"
echo ""
sudo youtube-dl -U
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
fi
fi
;;
2 | 02)
clear
MenU
;;
*)
clear
echo ""
echo -e "$choice is an invalid option!"
echo ""
sleep 4
UpdatE
;;
esac
fi
}
function DiE(){
clear
echo ""
echo -e "OOPS!!! Something Went Wrong!!!"
echo -e "Please make sure '$link' exists."
echo -e "Also make sure video is available."
echo ""
exit 1
}
function AplS(){
clear
printf "%s\n" "" "Enter the youtube playlist link: " ""
read link
clear
youtube-dl --continue --yes-playlist --ignore-errors --extract-audio --audio-format "mp3" --audio-quality 0 --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
}
function VplS(){
clear
printf "%s\n" "" "Enter the youtube playlist link: " ""
read link
clear
youtube-dl --continue --yes-playlist --ignore-errors --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
}
function AudiO(){
clear
printf "%s\n" "" "Enter the youtube video link: " ""
read link
clear
youtube-dl --continue --extract-audio --audio-format "mp3" --audio-quality 0 --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
}
function FormaT(){
clear
printf "%s\n" "" "Enter the youtube video link: " ""
read link
clear
youtube-dl --list-formats "$link" || DiE
printf "%s\n" "" "Enter your desired video format code from the above list:" ""
read list
clear
youtube-dl --continue --newline --format "$list" --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
}
function DependencieS(){
clear
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 it" "would most likely be 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-dl homepage -> https://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." "" "Python homepage -> 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." "" "FFmpeg homepage -> https://www.ffmpeg.org/" "" "4. Downloads directory" "PMYTD is hard-wired to download video and audio to the Downloads directory" "under user's home directory." "Downloads directory should already be there by default but just in case make" "sure you have Downloads directory under your home folder." "" "Press 'q' to return to PMYTD MENU" "" | less
}
function AbouT(){
clear
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 video sharing websites here," "http://rg3.github.io/youtube-dl/supportedsites.html" "" "By the way PMYTD means Poor Man's YouTube Downloader. PMYTD is" "available under CC0 1.0 Universal licesense." "Got any question-suggestion? Please visit," "http://hakerdefo.blogspot.in/" "" "Press 'q' to return to PMYTD MENU" "" | less
}
function MenU(){
clear
echo ""
echo -e "PMYTD MENU"
echo ""
echo -e "01 About PMYTD"
echo -e "02 Dependencies of PMYTD"
echo -e "03 Download a video"
echo -e "04 Download & extract audio from video"
echo -e "05 Download entire youtube playlist"
echo -e "06 Download & extract audio from playlist"
echo -e "07 Check for updates"
echo -e "08 Help"
echo -e "09 Quit PMYTD"
echo ""
echo -e "Enter your choice: "
echo ""
read choice
case $choice in
01 | 1)
AbouT
;;
02 | 2)
DependencieS
;;
03 | 3)
FormaT
;;
04 | 4)
AudiO
;;
05 | 5)
VplS
;;
06 | 6)
AplS
;;
07 | 7)
UpdatE
;;
08 | 8)
HelP
;;
09 | 9)
ByE
;;
*)
clear
echo ""
echo -e "$choice is an invalid option!"
echo ""
sleep 4
;;
esac
}
while :
do
MenU
done
#!/bin/bash
function Bye (){
clear
printf "%s\n" "" "Thanks.. Bye Bye.." ""
sleep 2
clear
exit 0
}
function Update (){
ytdllv=$(curl -sL -w "%{url_effective}\\n" "https://yt-dl.org/downloads/latest/" -o /dev/null | tail -c-12 | sed 's/[/]//g')
ytdlcv=$(youtube-dl --version)
printf "%s\n" "" "Installed version of youtube-dl is - $ytdlcv" "" "Latest available version of youtube-dl is - $ytdllv" "" "Press 'q' to return to PMYTD MENU" "" | less
}
function Apls(){
clear
printf "%s\n" "" "Enter the youtube playlist link: " ""
read link
clear
youtube-dl --continue --yes-playlist --ignore-errors --extract-audio --audio-format "mp3" --audio-quality 0 --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
exit 0
}
function Vpls(){
clear
printf "%s\n" "" "Enter the youtube playlist link: " ""
read link
clear
youtube-dl --continue --yes-playlist --ignore-errors --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
exit 0
}
function Audio(){
clear
printf "%s\n" "" "Enter the youtube video link: " ""
read link
clear
youtube-dl --continue --extract-audio --audio-format "mp3" --audio-quality 0 --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
exit 0
}
function Format(){
clear
printf "%s\n" "" "Enter the youtube video link: " ""
read link
clear
youtube-dl --list-formats "$link"
printf "%s\n" "" "Enter your desired video format code from the above list:" ""
read list
clear
youtube-dl --continue --format "$list" --output "/home/$USER/Downloads/%(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 it" "would most likely be 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-dl homepage -> https://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." "" "Python homepage -> 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." "" "FFmpeg homepage -> https://www.ffmpeg.org/" "" "4. Downloads directory" "PMYTD is hard-wired to download video and audio to the Downloads directory" "under user's home directory." "Downloads directory should already be there by default but just in case make" "sure you have Downloads 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 video sharing websites here," "http://rg3.github.io/youtube-dl/supportedsites.html" "" "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 updates' 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'" "" "By the way PMYTD means Poor Man's YouTube Downloader. PMYTD is" "available under CC0 1.0 Universal 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 updates
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 ;;
*) clear; printf "%s\n" "\"$choice\" is an invalid option!"; sleep 3;;
esac
done
#!/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/Downloads/%(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/Downloads/%(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/Downloads/%(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/Downloads/%(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 Downloads directory under user's home directory." "Downloads directory should already be there by default but just in case make sure you have Downloads 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
Quote
Last year a friend of mine upgraded GirlFriend 1.0 to Wife 1.0 and found that it's a memory hog leaving very little system resources for other applications. He is only now noticing that Wife 1.0 also is spawning Child-Processes which are further consuming valuable resources. No mention of this particular phenomena was included in the product brochure or the documentation, though other users have informed him that this is to be expected due to the nature of the application.
Not only that, Wife 1.0 installs itself such that it is always launched at system initialization where it can monitor all other system activity. He's finding that some applications such as PokerNight 10.3, BeerBash 2.5, and PubNight 7.0 are no longer able to run in the system at all, crashing the system when selected (even though they always worked fine before). At installation, Wife 1.0 provides no option as to the installation of undesired Plug-Ins such as MotherInLaw 55.8 and BrotherInLaw Beta release. Also, system performance seems to diminish with each passing day.
Some features he'd like to see in the upcoming wife 2.0.
A "Don't remind me again" button
Minimize button
An install shield feature that allows Wife 2.0 be installed with the option to uninstall at anytime without the loss of cache and other system resources.
An option to run the network driver in promiscuous mode which would allow the systems hardware probe feature to be much more useful.
I myself decided to avoid all of the headaches associated with Wife 1.0 by sticking with Girlfriend 2.0. Even here, however, I found many problems. Apparently you cannot install Girlfriend 2.0 on top of Girlfriend 1.0. You must uninstall Girlfriend 1.0 first. Other users say this is a long standing bug which I should have been aware of. Apparently the versions of Girlfriend have conflicts over shared use of the I/O port. You think they would have fixed such a stupid bug by now. To make matters worse, The uninstall program for Girlfriend 1.0 doesn't work very well leaving undesirable traces of the application in the system.
Another irritating feature -- all versions of Girlfriend continually popup little annoying messages about the advantages of upgrading to Wife 2.0.
***** BUG WARNING *****
Wife 1.0 has an undocumented bug. If you try to install Mistress 1.1 before uninstalling Wife 1.0, Wife 1.0 will delete MSMoney files before doing the uninstall itself. Then Mistress 1.1 will refuse to install, claiming insufficient resources.
***** BUG WORK-AROUNDS *****
To avoid the above bug, try installing Mistress 1.1 on a different system and never run any file transfer applications such as Laplink 6.0.
Also, beware of similar shareware applications that have been known to carry viruses that may affect Wife 1.0. Another solution would be to run Mistress 1.0 via a UseNet provider under an anonymous name. Here again, beware of the viruses which can accidentally be downloaded from the UseNet.
export PS1='${debian_chroot:+($debian_chroot)}\[\e[01;32m\]\u \[\e[01;37m\]> \[\e[01;33m\]\w\n\[\e[$(((($?>0))*31))m\]\$\[\e[0m\] '
source .bashrc
apthistory install
apthistory remove
apthistory upgrade
apthistory rollback
#!/bin/bash
### Author: Benjamin York
### Date: 2011-01-08
###
### Based On:
### http://linuxcommando.blogspot.com/2008/08/how-to-show-apt-log-history.html
###
### Hosted At:
### https://github.com/blyork/apt-history
###
### Git Repository:
### git://github.com/blyork/apt-history.git
###
### Description:
### Parses dpkg log files to get package installation, removal, and rollback
### information.
###
### Ubuntu Server likes to split up the dpkg.log file and then compress the
### various pieces. After seeing LinuxCommando's function, I added functionality
### to pull the pieces back together. I also slightly adjusted the output to
### avoid false positives.
function echoHistory(){
if [[ $1 == *.gz ]] ; then
gzip -cd $1
else
if [[ $1 == *.log || $1 == *.log.1 ]] ; then
cat $1
else
echo "\*\*\* Invalid File: ${1} \*\*\*" 1>&2
fi
fi
}
FILES=( `ls -rt /var/log/dpkg.log*` ) || exit 1
for file in "${FILES[@]}"
do
case "$1" in
install)
echoHistory $file | grep " install "
;;
upgrade|remove)
echoHistory $file | grep " ${1} "
;;
rollback)
echoHistory $file | grep upgrade | \
grep "$2" -A10000000 | \
grep "$3" -B10000000 | \
awk '{print $4"="$5}'
;;
list)
echoHistory $file
;;
*)
echo "Parameters:"
echo " install - Lists all packages that have been installed."
echo " upgrade - Lists all packages that have been upgraded."
echo " remove - Lists all packages that have been removed."
echo " rollback - Lists rollback information."
echo " list - Lists all contents of dpkg logs."
break
;;
esac
done
exit 0