http://forum.xbmc.org/showthread.php?p=453344
This is something I've been working on tonight. I hope to have it operational soon. It will eventually rename episodes to Showname-SxxExx-(show title).XXX with only the showname and episode name from MythTv.
Usage: /user/home/Desktop/tv.sh "showname"
currently it will generate a file called "show name".txt which is the entire TVDB on the show and "show name".reduced.txt which contains only the pertinant information
Code:
#/bin/sh
#usage is as follows- tv.sh "show name" "episode name" eg. tv.sh "family guy"
apikey="3B81A89C73E4EE95"
#make series name friendly for URL usage
showname=`echo $1|replace " " "%20"`
#note the show for the log
echo "checking for show named" $1 "on TVDB.com" > output.log
echo "the episode name is" $2 >> output.log
#get seriesid from showname from TVDB
seriesid=`curl www.thetvdb.com/api/GetSeries.php?seriesname=$showname|grep "<seriesid>"`
#I was parsing the XML, i realized I didn't need to save the file.
#seriesid=`echo $seriesid|replace "> <" ">Ḃ<"`
#seriesid=`echo $seriesid|tr -s "Ḃ" "\n"|grep "<seriesid>"`
#remove XML tags
seriesid=`echo $seriesid|tr -d "<seriesid>"|tr -d "</seriesid>"`
echo "got series ID for $1 it is $seriesid" >>output.log
echo "now downloading show information for $1" >>output.log
#download series info for show
curl http://www.thetvdb.com/api/$apikey/series/$seriesid/all/en.xml > $showname.txt
cat $showname.txt|egrep "<EpisodeName>|<SeasonNumber>|<EpisodeNumber>">>$showname.reduced.txtwould anyone like to give me input? I'm learning bash

![[Image: newsig-1.png]](http://i236.photobucket.com/albums/ff111/DrivingTibNaked/newsig-1.png)
Search
Help