2014-03-12, 23:27
I created a post processing script to automatically integrate my tvheadend recordings into the XBMC Library and thought it would be useful to others. It can be found at: http://jesshaas.com/software/xbmc/tvheadend_post.sh
It uses xmltv data from schedules direct(other sources may require tweaks) to rename recordings to include the original airdate in the filename. This allows xbmc to properly scrape them using thetvdb. If it can't find the original airdate or the show is in a list of shows not scrapeable by thetvdb(sports, news, etc...) then an nfo file is created so that it can still be imported into the library. If not an xml file is created containing all the data for later use(just rename to .nfo if xbmc isn't scraping something)
I don't really have the time to package it up any better or walk through every setup step at the moment but wanted to get it up here so others don't have to reinvent the wheel. Feel free to improve it or come up with a setup guide if you can.
The script requires schedule direct data downloaded before the recording started in /tmp/schedules_direct-past.xml
I recommend setting up a cron job to download and rotate files atleast once a day.
In order to setup a log file do the following(as root):
# touch /var/log/tvheadend_post.log
# chown tvheadend.video /var/log/tvheadend_post.log
put the script in /usr/local/bin and within tvheadened set it as a post processing script like so:
/usr/local/bin/tvheadend_post.sh "%f" "%b" "%c" "%t" "%d"
You can also edit the list of shows to create nfo files for within the script.
Hope this is helpful to someone. I find it so much better than the live tv recordings interface and it allows my downloaded shows and dvr shows to integrate seamlessly.
~Jess
It uses xmltv data from schedules direct(other sources may require tweaks) to rename recordings to include the original airdate in the filename. This allows xbmc to properly scrape them using thetvdb. If it can't find the original airdate or the show is in a list of shows not scrapeable by thetvdb(sports, news, etc...) then an nfo file is created so that it can still be imported into the library. If not an xml file is created containing all the data for later use(just rename to .nfo if xbmc isn't scraping something)
I don't really have the time to package it up any better or walk through every setup step at the moment but wanted to get it up here so others don't have to reinvent the wheel. Feel free to improve it or come up with a setup guide if you can.
The script requires schedule direct data downloaded before the recording started in /tmp/schedules_direct-past.xml
I recommend setting up a cron job to download and rotate files atleast once a day.
In order to setup a log file do the following(as root):
# touch /var/log/tvheadend_post.log
# chown tvheadend.video /var/log/tvheadend_post.log
put the script in /usr/local/bin and within tvheadened set it as a post processing script like so:
/usr/local/bin/tvheadend_post.sh "%f" "%b" "%c" "%t" "%d"
You can also edit the list of shows to create nfo files for within the script.
Hope this is helpful to someone. I find it so much better than the live tv recordings interface and it allows my downloaded shows and dvr shows to integrate seamlessly.
~Jess