wintermutecx

tlkshow.v1

Jan 21st, 2021
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.45 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ARGPBS=" --playlist-end 77 -f 18 --dateafter now-2days --no-warnings --restrict-filenames --force-ipv4 "
  4. ARGSCI=' --playlist-end 15 -f 18 --dateafter now-4days --no-warnings --restrict-filenames --force-ipv4 '
  5. ARGNASA=" --simulate --get-title --get-id --get-duration --get-filename --get-format --ignore-errors "
  6. #--get-description
  7. #ARGNASB=" --playlist-end 177 -f 160 --dateafter now-9days --no-warnings --restrict-filenames --force-ipv4 "
  8. ARGNASB=" --playlist-end 977 -f 160 --dateafter now-9days --no-warnings --restrict-filenames --force-ipv4 "
  9.  
  10.  
  11.  
  12.  
  13. #VEPSEASON_FILE="/tmp/vepseason.tmp"
  14. EPSEASON_FILE="$HOME/epseason.txt"
  15. read -r voiceseason voiceepisode snlseason snlepisode agtseason agtepisode blkseason blkepisode < $EPSEASON_FILE
  16. echo $voiceseason $voiceepisode $snlseason $snlepisode $agtseason $agtepisode $blkseason $blkepisode
  17. # tmpwatch config. 5 days
  18. DATADIR="/data/tmp/tlk"
  19. #cd "/data/tmp/tlk"
  20. cd $DATADIR
  21. pwd
  22. delay=30
  23.  
  24. func_quit ()
  25. {
  26. echo -e "\e[33m gone zo ! \e[39m "
  27. exit 1
  28. }
  29. func_getdate ()
  30. {
  31. # days to go back, set default yesterday
  32. if [ -z "$dayz" ]
  33. then
  34. now=$(date -d yesterday +"%Y%m%d")
  35. echo -e "\e[36m" $now " \e[34m Going back 1 day \e[33m "
  36. else
  37. now=$(date -d "$dayz days ago" +"%Y%m%d")
  38. echo -e "\e[36m" $now " \e[34m Going back \e[33m " $dayz "\e[36m days \e[33m "
  39. fi
  40. }
  41. func_vidget ()
  42. { # arg1 prepend file name, arg2 video res
  43. func_getdate
  44. read -p " Initializing.. $1$now ... Continuing in $delay Seconds...." -t $delay getz
  45. if [[ ! -z $getz ]]; then return ; fi
  46. case $1 in
  47. "msnbc"*)
  48. youtube-dl -f $2 -o $1$now'.%(ext)s' $URL
  49. ;;
  50. #"tlkKimml" old YTD no longer does ABC
  51. "tlkKimml")
  52. echo "kimml"
  53. # youtube-dl -f $2 -o $1$now'.%(ext)s' $URL
  54. $HOME/bin/youtube-dlc -f $2 -o $1$now'%(title)s.%(ext)s' $URL
  55. ;;
  56. "zzzzzzz"*)
  57. echo "zzzzzzzzz "
  58. ;;
  59. *)
  60. youtube-dl -f $2 -o $1$now'%(title)s.%(ext)s' $URL ;;
  61. esac
  62. echo -e "\e[36m Completed $1 $now \n "
  63. }
  64.  
  65. func_writeseasons ()
  66. {
  67. echo -e "\e[32m writing season file "
  68. func_printshows
  69. echo $voiceseason $voiceepisode $snlseason $snlepisode $agtseason $agtepisode $blkseason $blkepisode > $EPSEASON_FILE
  70. echo -e "\e[32m finished writing season file"
  71. }
  72. func_printshows ()
  73. {
  74. 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: "
  75. }
  76.  
  77. func_tmplate ()
  78. {
  79. echo "template"
  80. }
  81.  
  82. func_doshows ()
  83. {
  84. echo -e "\e[32m Starting The show ..... -> \e[36m" $1
  85. func_printshows
  86. echo -e "\e[32m"
  87. read -p "Enter key, wait $delay seconds, epdata or QQ ...... " -t $delay intmp
  88. case $intmp in
  89. [e][p][d][a][t][a] )
  90. func_epdata
  91. return ;;
  92. [qQ] | [qQ][qQ] )
  93. echo "aborting " $1
  94. return ;;
  95. *)
  96. echo -e " \e[35m Starting ... .. -> \e[36m $1 ";;
  97. esac
  98.  
  99. case $1 in
  100. "agt")
  101. echo -e "\e[34m Using AGT season $agtseason and episode $agtepisode "
  102. vetmp="agtS"$agtseason'E'$agtepisode
  103. echo $vetmp
  104. ((agtepisode++))
  105. ;;
  106. "snl")
  107. echo -e "\e[34m Using SNL season $snlseason and episode $snlepisode "
  108. vetmp="snlS"$snlseason'E'$snlepisode
  109. echo $vetmp
  110. ((snlepisode++))
  111. ;;
  112. "voice")
  113. echo -e "\e[34m Using Voice season $voiceseason and episode $voiceepisode "
  114. vetmp="voiceS"$voiceseason'E'$voiceepisode
  115. echo $vetmp
  116. ((voiceepisode++))
  117. ;;
  118. "blk")
  119. echo -e "\e[34m Using Blklist season $blkseason and episode $blkepisode "
  120. vetmp="blkS"$blkseason'E'$blkepisode
  121. echo $vetmp
  122. ((blkepisode++))
  123. ;;
  124.  
  125.  
  126. *)
  127. echo -e " \e[35m Error laq5 \e[39m ! .. ! ";;
  128. esac
  129.  
  130. # youtube-dl -f $2 --write-sub --sub-lang en --embed-subs -o $vetmp'%(title)s.%(ext)s' $URL
  131. youtube-dl -f $2 -o $vetmp'%(title)s.%(ext)s' $URL
  132. echo -e "\e[34m Finished .. -> \e[36m $1 \e[34m .... updating seasons "
  133. func_writeseasons
  134. }
  135. func_epdata ()
  136. {
  137. echo "Update the Season Data File "
  138. func_printshows
  139. echo -e "\e[32m"
  140. read -p "Change Season Data... 1: Voice . 2: SNL . 3: AGT 4: BLK ... ... " choice
  141. case $choice in
  142. [1] | [vV][oO][iI][cC][eE] )
  143. echo -e "\e[36m voice season: $voiceseason Episode $voiceepisode \e[35m "
  144. read -p " Enter season number space then episode number " stmp etmp
  145. if [[ $stmp -gt 0 && $stmp -lt 95 && $etmp -gt 0 && $etmp -lt 95 ]]
  146. then echo " updating Voice data "
  147. voiceseason=$stmp
  148. voiceepisode=$etmp
  149. func_writeseasons
  150. else
  151. echo " no modifications "
  152. fi
  153. ;;
  154. [2] | [sS][nN][lL] )
  155. echo -e "\e[36m SNL season: $snlseason Episode $snlepisode \e[35m "
  156. read -p " Enter season number space then episode number " stmp etmp
  157. if [[ $stmp -gt 0 && $stmp -lt 95 && $etmp -gt 0 && $etmp -lt 95 ]]
  158. then echo " updating SNL data "
  159. snlseason=$stmp
  160. snlepisode=$etmp
  161. func_writeseasons
  162. else
  163. echo " no modifications "
  164. fi
  165. ;;
  166. [3] | [aA][gG][tT] )
  167. echo -e "\e[36m AGT season: $agtseason Episode $agtepisode \e[35m "
  168. read -p " Enter season number space then episode number " stmp etmp
  169. if [[ $stmp -gt 0 && $stmp -lt 95 && $etmp -gt 0 && $etmp -lt 95 ]]
  170. then echo " updating AGT data "
  171. agtseason=$stmp
  172. agtepisode=$etmp
  173. func_writeseasons
  174. else
  175. echo " no modifications "
  176. fi
  177. ;;
  178. [4] | [bB][lL][kK] )
  179. echo -e "\e[36m BLK season: $blkseason Episode $blkepisode \e[35m "
  180. read -p " Enter season number space then episode number " stmp etmp
  181. if [[ $stmp -gt 0 && $stmp -lt 95 && $etmp -gt 0 && $etmp -lt 95 ]]
  182. then echo " updating AGT data "
  183. blkseason=$stmp
  184. blkepisode=$etmp
  185. func_writeseasons
  186. else
  187. echo " no modifications "
  188. fi
  189. ;;
  190.  
  191.  
  192.  
  193. *)
  194. echo -e " \e[35m No data written, exit. \e[39m ! .. ! ";;
  195. esac
  196. echo -e " \e[35m "
  197. }
  198. # Main loop begin, end if Q
  199. while true; do
  200.  
  201. # get URL and days back, check quit
  202. echo -e "\e[32m Enter URL, trigger or Q to exit. \e[35m "
  203. read -p " Optional days back... default yesterday, 0 for today " URL dayz
  204. if [[ $URL = Q ]] || [[ $URL = qq ]] ; then
  205. func_quit
  206. fi
  207. if ! [ -s $EPSEASON_FILE ];then
  208. echo "Season file empty, use epdata to modify "
  209. fi
  210. # remove quotes
  211. temp="${URL%\"}"
  212. temp="${temp#\"}"
  213. URL=$temp
  214. #echo $URL
  215. #exit 88
  216.  
  217. echo -e " \e[33m "
  218. #Start CASE statements
  219. case $URL in
  220. *"late-show"*)
  221. func_vidget "tlkColbert" "(mp4)[height<480]"
  222. ;;
  223. *"late-night"*)
  224. func_vidget "tlkSeth" "(mp4)[height<480]"
  225. ;;
  226. *"tonight-show"*)
  227. func_vidget "tlkFallon" "(mp4)[height<545]"
  228. ;;
  229. *"saturday-night-liv"*)
  230. func_doshows "snl" "(mp4)[height<545]"
  231. ;;
  232. *"daily-show"* | *"the-opposition"* | *"president-show"* )
  233. # func_vidget "cc" "(mp4)[height<545]"
  234. func_vidget "cc" "(mp4)[height<545]/best"
  235. ;;
  236. *"Deadline"*)
  237. func_vidget "msnbc1deadline" "(mp4)[height<480]"
  238. ;;
  239. *"MTP_D"*)
  240. func_vidget "msnbc2mtpdaily" "(mp4)[height<480]"
  241. ;;
  242. *"The_Beat"*)
  243. func_vidget "msnbc3Beat" "(mp4)[height<480]"
  244. ;;
  245. *"Hardball"*)
  246. func_vidget "msnbc4HardBall" "(mp4)[height<480]"
  247. ;;
  248. *"All_In"* | *"All_in"*)
  249. func_vidget "msnbc5allin" "(mp4)[height<480]"
  250. ;;
  251. *"chel_Mad"*)
  252. func_vidget "msnbc6maddow" "(mp4)[height<545]"
  253. ;;
  254. *"60minutes"*)
  255. func_vidget "60min" "(mp4)[height<545]"
  256. ;;
  257. *"Last_Word"*)
  258. func_vidget "msnbc7lstwrd" "(mp4)[height<480]"
  259. ;;
  260. *"11th_Hou"*)
  261. func_vidget "msnbc811hour" "(mp4)[height<480]"
  262. ;;
  263. *"AM_Joy"*)
  264. func_vidget "msnbc99amj" "(mp4)[height<480]"
  265. ;;
  266. *"video.foxnews"*)
  267. func_vidget "fox" "PDL_MED"
  268. ;;
  269. *"nightly-news"*)
  270. func_vidget "nbcnews" "(mp4)[height<480]"
  271. ;;
  272. *"the-voice"*)
  273. func_doshows "voice" "(mp4)[height<480]"
  274. # mv -v voice* /data/shared/TV/00Week/18Voice
  275. mv -v voice* /Data/Shared/TV/00Week/Assay/00Voice
  276. ;;
  277. *"blacklist"*)
  278. func_doshows "blk" "(mp4)[height<545]"
  279. mv -v blk* /Data/Shared/TV/00Week/Assay/00blklist
  280.  
  281. ;;
  282.  
  283. *"mericas-got-talen"*)
  284. func_doshows "agt" "(mp4)[height<545]"
  285. mv -v agt* /data/shared/TV/00Week/16AGT
  286. ;;
  287. *"ichard_Enge"*)
  288. func_vidget "msnbcEngle" "(mp4)[height<545]"
  289. ;;
  290. *"pbs.org"*)
  291. func_vidget "pbs" "(mp4)[height<545]"
  292. ;;
  293. *"kimmel-liv"*)
  294. func_vidget "tlkKimml" "(mp4)[height<545]"
  295. ;;
  296. *"cnn.com"*)
  297. if [ -z "$dayz" ]
  298. then
  299. echo " change default today"
  300. dayz=0
  301. fi
  302. func_vidget "cnn" "(mp4)[height<545]"
  303. ;;
  304. *"vimeo.co"*)
  305. func_vidget "vim" "http-540p"
  306. ;;
  307. *"listing"* | "ls" | "ll")
  308. ls -lta | more
  309. ;;
  310. "now")
  311. echo `date`
  312. func_getdate
  313. echo $now
  314. ;;
  315. *"disku"* | "df" | "du")
  316. du -h
  317. df -h
  318. ;;
  319. "pbs" | "ppp")
  320. echo -e "starting script"
  321. ~/bin/qpbsdl
  322. ;;
  323. "nbc" | "nnn")
  324. echo -e "starting script"
  325. ~/bin/nbcnewsytdl
  326. ;;
  327. *"vepisode"*)
  328. echo " use epdata "
  329. ;;
  330. *"zzzzzzzzz"*)
  331. read -p " zzzzzzzzzzz.. Continuing in $delay Seconds...." -t $delay
  332. youtube-dl --simulate -f '(mp4)[height<480]' -o zzzz$now'%(title)s.%(ext)s' $URL
  333. ;;
  334. *"outube.com"* | *"youtu.be"*)
  335. youtube-dl -f 18 --force-ipv4 $URL
  336. ;;
  337. *"twitter.com"*| *"t.co"* | *"dailymail"*|*"facebook.com"*)
  338. youtube-dl --id -f mp4 --force-ipv4 $URL
  339. ;;
  340. *"nasfull"*)
  341. youtube-dl $ARGNASA $ARGNASB --match-title "Full Race" https://www.youtube.com/user/TheOfficialNASCAR/videos
  342. ;;
  343. *"nasfuller"*)
  344. youtube-dl $ARGNASA $ARGNASB --match-title "Full" https://www.youtube.com/user/TheOfficialNASCAR/videos
  345. ;;
  346. *"nasmon"* | *"nascup"*)
  347. youtube-dl $ARGNASA $ARGNASB --get-description --match-title "Monster Energy|Cup Series" https://www.youtube.com/user/TheOfficialNASCAR
  348. ;;
  349. *"getid"*)
  350. if [ -z "$dayz" ]
  351. then
  352. echo " No id set "
  353. else
  354. echo " add check vid res "
  355. youtube-dl -f 'best' https://www.youtube.com/watch?v=$dayz
  356. fi
  357. ;;
  358. *"pbsnews"*)
  359. youtube-dl $ARGPBS --match-title "NewsHour" http://www.youtube.com/user/PBSNewsHour/
  360. ;;
  361. *"scishow"*)
  362. youtube-dl $ARGSCI https://www.youtube.com/user/scishow/videos
  363. ;;
  364. *"scispace"*)
  365. youtube-dl $ARGSCI https://www.youtube.com/user/scishowspace/videos
  366. ;;
  367. *"minphy"*)
  368. youtube-dl $ARGSCI https://www.youtube.com/user/minutephysics/videos
  369. ;;
  370. *"jplnews"*)
  371. youtube-dl $ARGSCI https://www.youtube.com/user/JPLnews/videos
  372. ;;
  373. *"misc")
  374. URL=$dayz
  375. dayz=0
  376. func_vidget "misc" "(mp4)[height<480]/best"
  377. ;;
  378. *"epdata"*)
  379. func_epdata
  380. ;;
  381. *"Stub for copy"*)
  382. echo "stub for copy ";;
  383. *)
  384. echo -e " \e[35m epdata disku nows listing pbsnews scishow scispace minphy jplnews nasfuller getid \e[39m ! .. ! ";;
  385. esac
  386. #End Case
  387. #while loop end
  388. done
  389. echo " Error zfa1 "
  390. #shopt -u nocasematch
  391. exit 99
  392.  
  393.  
  394.  
  395.  
Advertisement
Add Comment
Please, Sign In to add comment