Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ARGPBS=" --playlist-end 77 -f 18 --dateafter now-2days --no-warnings --restrict-filenames --force-ipv4 "
- ARGSCI=' --playlist-end 15 -f 18 --dateafter now-4days --no-warnings --restrict-filenames --force-ipv4 '
- ARGNASA=" --simulate --get-title --get-id --get-duration --get-filename --get-format --ignore-errors "
- #--get-description
- #ARGNASB=" --playlist-end 177 -f 160 --dateafter now-9days --no-warnings --restrict-filenames --force-ipv4 "
- ARGNASB=" --playlist-end 977 -f 160 --dateafter now-9days --no-warnings --restrict-filenames --force-ipv4 "
- #VEPSEASON_FILE="/tmp/vepseason.tmp"
- EPSEASON_FILE="$HOME/epseason.txt"
- read -r voiceseason voiceepisode snlseason snlepisode agtseason agtepisode blkseason blkepisode < $EPSEASON_FILE
- echo $voiceseason $voiceepisode $snlseason $snlepisode $agtseason $agtepisode $blkseason $blkepisode
- # tmpwatch config. 5 days
- DATADIR="/data/tmp/tlk"
- #cd "/data/tmp/tlk"
- cd $DATADIR
- pwd
- delay=30
- func_quit ()
- {
- echo -e "\e[33m gone zo ! \e[39m "
- exit 1
- }
- func_getdate ()
- {
- # days to go back, set default yesterday
- if [ -z "$dayz" ]
- then
- now=$(date -d yesterday +"%Y%m%d")
- echo -e "\e[36m" $now " \e[34m Going back 1 day \e[33m "
- else
- now=$(date -d "$dayz days ago" +"%Y%m%d")
- echo -e "\e[36m" $now " \e[34m Going back \e[33m " $dayz "\e[36m days \e[33m "
- fi
- }
- func_vidget ()
- { # arg1 prepend file name, arg2 video res
- func_getdate
- read -p " Initializing.. $1$now ... Continuing in $delay Seconds...." -t $delay getz
- if [[ ! -z $getz ]]; then return ; fi
- case $1 in
- "msnbc"*)
- youtube-dl -f $2 -o $1$now'.%(ext)s' $URL
- ;;
- #"tlkKimml" old YTD no longer does ABC
- "tlkKimml")
- echo "kimml"
- # youtube-dl -f $2 -o $1$now'.%(ext)s' $URL
- $HOME/bin/youtube-dlc -f $2 -o $1$now'%(title)s.%(ext)s' $URL
- ;;
- "zzzzzzz"*)
- echo "zzzzzzzzz "
- ;;
- *)
- youtube-dl -f $2 -o $1$now'%(title)s.%(ext)s' $URL ;;
- esac
- echo -e "\e[36m Completed $1 $now \n "
- }
- func_writeseasons ()
- {
- echo -e "\e[32m writing season file "
- func_printshows
- echo $voiceseason $voiceepisode $snlseason $snlepisode $agtseason $agtepisode $blkseason $blkepisode > $EPSEASON_FILE
- echo -e "\e[32m finished writing season file"
- }
- func_printshows ()
- {
- echo -e "\e[31m Voice: \e[36m$voiceseason $voiceepisode\e[31m ... SNL: \e[36m$snlseason $snlepisode\e[31m ... AGT: \e[36m$agtseason $agtepisode ... BLK: $blkseason $blkepisode x: "
- }
- func_tmplate ()
- {
- echo "template"
- }
- func_doshows ()
- {
- echo -e "\e[32m Starting The show ..... -> \e[36m" $1
- func_printshows
- echo -e "\e[32m"
- read -p "Enter key, wait $delay seconds, epdata or QQ ...... " -t $delay intmp
- case $intmp in
- [e][p][d][a][t][a] )
- func_epdata
- return ;;
- [qQ] | [qQ][qQ] )
- echo "aborting " $1
- return ;;
- *)
- echo -e " \e[35m Starting ... .. -> \e[36m $1 ";;
- esac
- case $1 in
- "agt")
- echo -e "\e[34m Using AGT season $agtseason and episode $agtepisode "
- vetmp="agtS"$agtseason'E'$agtepisode
- echo $vetmp
- ((agtepisode++))
- ;;
- "snl")
- echo -e "\e[34m Using SNL season $snlseason and episode $snlepisode "
- vetmp="snlS"$snlseason'E'$snlepisode
- echo $vetmp
- ((snlepisode++))
- ;;
- "voice")
- echo -e "\e[34m Using Voice season $voiceseason and episode $voiceepisode "
- vetmp="voiceS"$voiceseason'E'$voiceepisode
- echo $vetmp
- ((voiceepisode++))
- ;;
- "blk")
- echo -e "\e[34m Using Blklist season $blkseason and episode $blkepisode "
- vetmp="blkS"$blkseason'E'$blkepisode
- echo $vetmp
- ((blkepisode++))
- ;;
- *)
- echo -e " \e[35m Error laq5 \e[39m ! .. ! ";;
- esac
- # youtube-dl -f $2 --write-sub --sub-lang en --embed-subs -o $vetmp'%(title)s.%(ext)s' $URL
- youtube-dl -f $2 -o $vetmp'%(title)s.%(ext)s' $URL
- echo -e "\e[34m Finished .. -> \e[36m $1 \e[34m .... updating seasons "
- func_writeseasons
- }
- func_epdata ()
- {
- echo "Update the Season Data File "
- func_printshows
- echo -e "\e[32m"
- read -p "Change Season Data... 1: Voice . 2: SNL . 3: AGT 4: BLK ... ... " choice
- case $choice in
- [1] | [vV][oO][iI][cC][eE] )
- echo -e "\e[36m voice season: $voiceseason Episode $voiceepisode \e[35m "
- read -p " Enter season number space then episode number " stmp etmp
- if [[ $stmp -gt 0 && $stmp -lt 95 && $etmp -gt 0 && $etmp -lt 95 ]]
- then echo " updating Voice data "
- voiceseason=$stmp
- voiceepisode=$etmp
- func_writeseasons
- else
- echo " no modifications "
- fi
- ;;
- [2] | [sS][nN][lL] )
- echo -e "\e[36m SNL season: $snlseason Episode $snlepisode \e[35m "
- read -p " Enter season number space then episode number " stmp etmp
- if [[ $stmp -gt 0 && $stmp -lt 95 && $etmp -gt 0 && $etmp -lt 95 ]]
- then echo " updating SNL data "
- snlseason=$stmp
- snlepisode=$etmp
- func_writeseasons
- else
- echo " no modifications "
- fi
- ;;
- [3] | [aA][gG][tT] )
- echo -e "\e[36m AGT season: $agtseason Episode $agtepisode \e[35m "
- read -p " Enter season number space then episode number " stmp etmp
- if [[ $stmp -gt 0 && $stmp -lt 95 && $etmp -gt 0 && $etmp -lt 95 ]]
- then echo " updating AGT data "
- agtseason=$stmp
- agtepisode=$etmp
- func_writeseasons
- else
- echo " no modifications "
- fi
- ;;
- [4] | [bB][lL][kK] )
- echo -e "\e[36m BLK season: $blkseason Episode $blkepisode \e[35m "
- read -p " Enter season number space then episode number " stmp etmp
- if [[ $stmp -gt 0 && $stmp -lt 95 && $etmp -gt 0 && $etmp -lt 95 ]]
- then echo " updating AGT data "
- blkseason=$stmp
- blkepisode=$etmp
- func_writeseasons
- else
- echo " no modifications "
- fi
- ;;
- *)
- echo -e " \e[35m No data written, exit. \e[39m ! .. ! ";;
- esac
- echo -e " \e[35m "
- }
- # Main loop begin, end if Q
- while true; do
- # get URL and days back, check quit
- echo -e "\e[32m Enter URL, trigger or Q to exit. \e[35m "
- read -p " Optional days back... default yesterday, 0 for today " URL dayz
- if [[ $URL = Q ]] || [[ $URL = qq ]] ; then
- func_quit
- fi
- if ! [ -s $EPSEASON_FILE ];then
- echo "Season file empty, use epdata to modify "
- fi
- # remove quotes
- temp="${URL%\"}"
- temp="${temp#\"}"
- URL=$temp
- #echo $URL
- #exit 88
- echo -e " \e[33m "
- #Start CASE statements
- case $URL in
- *"late-show"*)
- func_vidget "tlkColbert" "(mp4)[height<480]"
- ;;
- *"late-night"*)
- func_vidget "tlkSeth" "(mp4)[height<480]"
- ;;
- *"tonight-show"*)
- func_vidget "tlkFallon" "(mp4)[height<545]"
- ;;
- *"saturday-night-liv"*)
- func_doshows "snl" "(mp4)[height<545]"
- ;;
- *"daily-show"* | *"the-opposition"* | *"president-show"* )
- # func_vidget "cc" "(mp4)[height<545]"
- func_vidget "cc" "(mp4)[height<545]/best"
- ;;
- *"Deadline"*)
- func_vidget "msnbc1deadline" "(mp4)[height<480]"
- ;;
- *"MTP_D"*)
- func_vidget "msnbc2mtpdaily" "(mp4)[height<480]"
- ;;
- *"The_Beat"*)
- func_vidget "msnbc3Beat" "(mp4)[height<480]"
- ;;
- *"Hardball"*)
- func_vidget "msnbc4HardBall" "(mp4)[height<480]"
- ;;
- *"All_In"* | *"All_in"*)
- func_vidget "msnbc5allin" "(mp4)[height<480]"
- ;;
- *"chel_Mad"*)
- func_vidget "msnbc6maddow" "(mp4)[height<545]"
- ;;
- *"60minutes"*)
- func_vidget "60min" "(mp4)[height<545]"
- ;;
- *"Last_Word"*)
- func_vidget "msnbc7lstwrd" "(mp4)[height<480]"
- ;;
- *"11th_Hou"*)
- func_vidget "msnbc811hour" "(mp4)[height<480]"
- ;;
- *"AM_Joy"*)
- func_vidget "msnbc99amj" "(mp4)[height<480]"
- ;;
- *"video.foxnews"*)
- func_vidget "fox" "PDL_MED"
- ;;
- *"nightly-news"*)
- func_vidget "nbcnews" "(mp4)[height<480]"
- ;;
- *"the-voice"*)
- func_doshows "voice" "(mp4)[height<480]"
- # mv -v voice* /data/shared/TV/00Week/18Voice
- mv -v voice* /Data/Shared/TV/00Week/Assay/00Voice
- ;;
- *"blacklist"*)
- func_doshows "blk" "(mp4)[height<545]"
- mv -v blk* /Data/Shared/TV/00Week/Assay/00blklist
- ;;
- *"mericas-got-talen"*)
- func_doshows "agt" "(mp4)[height<545]"
- mv -v agt* /data/shared/TV/00Week/16AGT
- ;;
- *"ichard_Enge"*)
- func_vidget "msnbcEngle" "(mp4)[height<545]"
- ;;
- *"pbs.org"*)
- func_vidget "pbs" "(mp4)[height<545]"
- ;;
- *"kimmel-liv"*)
- func_vidget "tlkKimml" "(mp4)[height<545]"
- ;;
- *"cnn.com"*)
- if [ -z "$dayz" ]
- then
- echo " change default today"
- dayz=0
- fi
- func_vidget "cnn" "(mp4)[height<545]"
- ;;
- *"vimeo.co"*)
- func_vidget "vim" "http-540p"
- ;;
- *"listing"* | "ls" | "ll")
- ls -lta | more
- ;;
- "now")
- echo `date`
- func_getdate
- echo $now
- ;;
- *"disku"* | "df" | "du")
- du -h
- df -h
- ;;
- "pbs" | "ppp")
- echo -e "starting script"
- ~/bin/qpbsdl
- ;;
- "nbc" | "nnn")
- echo -e "starting script"
- ~/bin/nbcnewsytdl
- ;;
- *"vepisode"*)
- echo " use epdata "
- ;;
- *"zzzzzzzzz"*)
- read -p " zzzzzzzzzzz.. Continuing in $delay Seconds...." -t $delay
- youtube-dl --simulate -f '(mp4)[height<480]' -o zzzz$now'%(title)s.%(ext)s' $URL
- ;;
- *"outube.com"* | *"youtu.be"*)
- youtube-dl -f 18 --force-ipv4 $URL
- ;;
- *"twitter.com"*| *"t.co"* | *"dailymail"*|*"facebook.com"*)
- youtube-dl --id -f mp4 --force-ipv4 $URL
- ;;
- *"nasfull"*)
- youtube-dl $ARGNASA $ARGNASB --match-title "Full Race" https://www.youtube.com/user/TheOfficialNASCAR/videos
- ;;
- *"nasfuller"*)
- youtube-dl $ARGNASA $ARGNASB --match-title "Full" https://www.youtube.com/user/TheOfficialNASCAR/videos
- ;;
- *"nasmon"* | *"nascup"*)
- youtube-dl $ARGNASA $ARGNASB --get-description --match-title "Monster Energy|Cup Series" https://www.youtube.com/user/TheOfficialNASCAR
- ;;
- *"getid"*)
- if [ -z "$dayz" ]
- then
- echo " No id set "
- else
- echo " add check vid res "
- youtube-dl -f 'best' https://www.youtube.com/watch?v=$dayz
- fi
- ;;
- *"pbsnews"*)
- youtube-dl $ARGPBS --match-title "NewsHour" http://www.youtube.com/user/PBSNewsHour/
- ;;
- *"scishow"*)
- youtube-dl $ARGSCI https://www.youtube.com/user/scishow/videos
- ;;
- *"scispace"*)
- youtube-dl $ARGSCI https://www.youtube.com/user/scishowspace/videos
- ;;
- *"minphy"*)
- youtube-dl $ARGSCI https://www.youtube.com/user/minutephysics/videos
- ;;
- *"jplnews"*)
- youtube-dl $ARGSCI https://www.youtube.com/user/JPLnews/videos
- ;;
- *"misc")
- URL=$dayz
- dayz=0
- func_vidget "misc" "(mp4)[height<480]/best"
- ;;
- *"epdata"*)
- func_epdata
- ;;
- *"Stub for copy"*)
- echo "stub for copy ";;
- *)
- echo -e " \e[35m epdata disku nows listing pbsnews scishow scispace minphy jplnews nasfuller getid \e[39m ! .. ! ";;
- esac
- #End Case
- #while loop end
- done
- echo " Error zfa1 "
- #shopt -u nocasematch
- exit 99
Advertisement
Add Comment
Please, Sign In to add comment