MythTV XBMC renamer.
#1
This development thread is obsolete please see this thread:
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.txt

would anyone like to give me input? I'm learning bash
Use mythicalLibrarian to make a library out of your MythTV files. Leave the recording to MythTV and use XBMC as your library.
Installation and Instructions:http://wiki.xbmc.org/index.php?title=MythicalLibrarian
Technical Support:http://forum.xbmc.org/showthread.php?tid=65644
[url=http://forum.xda-developers.com/showthread.php?tid=1081892][/url]
Reply


Messages In This Thread
MythTV XBMC renamer development thread - by outleradam - 2009-12-01, 06:27
[No subject] - by outleradam - 2009-12-01, 07:01
[No subject] - by outleradam - 2009-12-01, 07:14
[No subject] - by outleradam - 2009-12-01, 07:49
[No subject] - by theophile - 2009-12-01, 21:12
[No subject] - by outleradam - 2009-12-02, 07:11
[No subject] - by theophile - 2009-12-02, 22:43
[No subject] - by outleradam - 2009-12-03, 02:11
[No subject] - by outleradam - 2009-12-03, 03:08
[No subject] - by theophile - 2009-12-03, 06:28
[No subject] - by outleradam - 2009-12-03, 06:59
[No subject] - by outleradam - 2009-12-03, 06:59
[No subject] - by outleradam - 2009-12-03, 07:00
[No subject] - by theophile - 2009-12-03, 07:03
[No subject] - by theophile - 2009-12-03, 07:07
[No subject] - by outleradam - 2009-12-03, 07:17
[No subject] - by theophile - 2009-12-03, 17:15
[No subject] - by outleradam - 2009-12-03, 20:18
[No subject] - by theophile - 2009-12-03, 20:22
[No subject] - by outleradam - 2009-12-03, 20:34
[No subject] - by theophile - 2009-12-03, 21:46
[No subject] - by outleradam - 2009-12-03, 22:46
[No subject] - by theophile - 2009-12-03, 23:04
[No subject] - by outleradam - 2009-12-04, 01:58
[No subject] - by theophile - 2009-12-04, 02:05
[No subject] - by outleradam - 2009-12-04, 07:12
[No subject] - by outleradam - 2009-12-04, 17:44
[No subject] - by outleradam - 2009-12-05, 03:52
[No subject] - by outleradam - 2009-12-05, 20:23
[No subject] - by theophile - 2009-12-05, 21:53
[No subject] - by outleradam - 2009-12-06, 02:04
[No subject] - by outleradam - 2009-12-06, 06:37
development phase is over - by outleradam - 2009-12-07, 04:47
[No subject] - by outleradam - 2012-02-03, 21:31
Logout Mark Read Team Forum Stats Members Help
MythTV XBMC renamer.0