📄 bashpodder.sh
字号:
#!/bin/bash# bashpodder.sh:# By Linc 10/1/2004# Find the latest script at http://linc.homeunix.org:8080/scripts/bashpodder# Last revision 12/14/2004 - Many Contributors!# If you use this and have made improvements or have comments# drop me an email at linc dot fessenden at gmail dot com# I'd appreciate it!# ==> ABS Guide extra comments.# ==> Author of this script has kindly granted permission# ==>+ for inclusion in ABS Guide.# ==> ################################################################# # ==> What is "podcasting"?# ==> It's broadcasting "radio shows" over the Internet.# ==> These shows can be played on iPods and other music file players.# ==> This script makes it possible.# ==> See documentation at the script author's site, above.# ==> ################################################################# Make script crontab friendly:cd $(dirname $0)# ==> Change to directory where this script lives.# datadir is the directory you want podcasts saved to:datadir=$(date +%Y-%m-%d)# ==> Will create a directory with the name: YYYY-MM-DD# Check for and create datadir if necessary:if test ! -d $datadir then mkdir $datadirfi# Delete any temp file:rm -f temp.log# Read the bp.conf file and wget any url not already in the podcast.log file:while read podcast do # ==> Main action follows. file=$(wget -q $podcast -O - | tr '\r' '\n' | tr \' \" | sed -n 's/.*url="\([^"]*\)".*/\1/p') for url in $file do echo $url >> temp.log if ! grep "$url" podcast.log > /dev/null then wget -q -P $datadir "$url" fi done done < bp.conf# Move dynamically created log file to permanent log file:cat podcast.log >> temp.logsort temp.log | uniq > podcast.logrm temp.log# Create an m3u playlist:ls $datadir | grep -v m3u > $datadir/podcast.m3uexit 0#################################################For a different scripting approach to Podcasting,see Phil Salkie's article, "Internet Radio to Podcast with Shell Tools"in the September, 2005 issue of LINUX JOURNAL,http://www.linuxjournal.com/article/8171#################################################
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -