From 6f116ca59eef1fac8e16535cce3fad6c3b63ff69 Mon Sep 17 00:00:00 2001 From: Nick White Date: Sat, 7 Aug 2010 12:45:13 +0100 Subject: Reorganise software section --- scripts/fetchdnow.sh | 93 ---------------------------------------------------- 1 file changed, 93 deletions(-) delete mode 100644 scripts/fetchdnow.sh (limited to 'scripts/fetchdnow.sh') diff --git a/scripts/fetchdnow.sh b/scripts/fetchdnow.sh deleted file mode 100644 index 990a2dc..0000000 --- a/scripts/fetchdnow.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/bash -# Copyright 2008 Nick White -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# See for a copy of the GNU General -# Public License. - -function usage -{ - echo "Usage: dnow [-c codec] [-f outfile]" - echo " codec may be ogg, flac or mp3" -} - -# Get Dates # -year=$(date +%Y) -month=$(date +%m) -monthname=$(date +%B) -day=$(date +%d) -dayunpadded=$(date +%-e) - -# Set Defaults # -title="Democracy Now!" -titleshort="Democracy_Now" -codec="ogg" -podcastdir=~/feeds - -while [ "$1" != "" ]; do - case $1 in - -c | --codec ) shift - codec=$1 - ;; - -f | --file ) shift - outfile=$1 - ;; - -h | --help ) usage - exit - ;; - * ) usage - exit - ;; - esac - shift -done - -downfile=dn$year-$month$day-1.$codec - -url=http://www.archive.org/download/dn$year-$month$day/$downfile - -downdir=$podcastdir/$year-$month-$dayunpadded - -# if the file already exists, exit -if [ -f "$downdir/$downfile" ]; then - echo "download file already exists" - exit 1 -fi - -echo "url is $url" - -mkdir -p "$downdir" -wget --quiet --directory-prefix="$downdir" $url - -# check that it's audio data, not a 404, & if necessary delete -if [ -f "$downdir/404.php" ]; then - find "$downdir" -iname "404.php*" -type f -exec rm -f {} \; - echo "404, sorry" - exit 1 -elif [ -z "$(file $downdir/$downfile|grep audio)" ]; then - rm "$downdir/$downfile" - echo "download wasn't audio" - exit 1 -fi - -# tag the newly downloaded file -vorbiscomment -w "$downdir/$downfile" -t "ARTIST=$title" -t "TITLE=$day $monthname $year" -t "GENRE=News" -t "DATE=$year" - -# create directories and links to integrate with GoldenPod's directory structure -catdir=$podcastdir/catalogue/$titleshort - -mkdir -p "$catdir" - -ln -s "$downdir/$downfile" "$podcastdir/catalogue/All/" -ln -s $downdir/$downfile "$catdir/" -ln -sf $downdir/$downfile "$catdir/latest.$codec" -ln -sfn $downdir "$podcastdir/latest" -- cgit v1.2.3