팟빵이 경제의 신과 함께를 호스팅하여 잘 듣고 있었다. 언젠가부터 rss로 표시되는 파일 경로를 숨겨버려 crontab으로 자동으로 받을 수 없었다. 한동안 듣지 못하다, 꼼수를 찾았다.
http://pod.ssenhosting.com/rss/geesik02
여기에 팟빵이 호스팅하는 모든 파일이 있다. 여기에서 해당하는 채널을 잘라 받으면 쉽다. 나중에 주소를 바꿀 수도 있지만, 귀찮아서 굳이 그렇게 하지 않을까 한다.
#!/bin/sh # # TEDTalks Downloader # # Copyright (C) 2009 Denver Gingerich # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. echo "TEDTalks Downloader v0.1" echo "by Denver Gingerich (http://ossguy.com/)" which wget if [ $? -eq 0 ]; then echo "Using wget..." GET_CMD="wget --quiet -O" else which curl if [ $? -eq 0 ]; then echo "Using curl..." GET_CMD="curl -L -o" else echo "Could not find wget or curl" exit 2 fi fi echo podcast_address=http://minicast.imbc.com/PodCast/pod.aspx?code=1000671100000100000 FEED=feed_podcast.xml URLS=urls_podcast echo "신과함께 다운로드" DIRNAME=신과함께 rm -f ${FEED} podcast_address=http://pod.ssenhosting.com/rss/geesik02 #lynx로 변경.. #wget은 파일을 받을 수 없음. #${GET_CMD} ${FEED} ${podcast_address} lynx -source ${podcast_address} > ${FEED} cat ${FEED} | sed -n '/^<title>.*page2/,/type="audio/p' | grep enclosure | cut -d'"' -f2 > ${URLS}; mkdir -p ${DIRNAME} cd ${DIRNAME} for line in `cat ../${URLS}`; do #SIZE=`echo ${line} | cut -d: -f1` #echo "출력분" #URL=`echo ${line} | cut -d'"' -f2-` echo $URL URL=`echo ${line}|tr -d '\r'` FILENAME=`basename ${URL}|tr -d '\r'` #echo ${URL} echo ${FILENAME} if [ ! -f "${FILENAME}" ]; then # || [ ${SIZE} -ne `ls -l "${FILENAME}" | awk '{print $5}'` ]; then rm -f "${FILENAME}" ${GET_CMD} "${FILENAME}" "${URL}" fi done cd ..