2014-09-27, 00:40
myth2kodi
for viewing MythTV recordings in XBMC (Kodi)
Features
Download and Setup
myth2kodi is maintained on GitHub here:
For setup details, please see the myth2kodi wiki here:
Change Log
myth2kodi is written in Python 2.7.3 using PyCharm 3.4, tested in Ubuntu 12.04 running Mythbackend .27, and tested on the frontend with XBMC 13.2.
I hope someone will find this useful!
Please post with any comments/questions.
for viewing MythTV recordings in XBMC (Kodi)
Features
- List "Specials" and regular episodes under the same series in the "TV Shows" section of XBMC
- Pull "watched" flag from MythTV so that episodes are also checked as watched in XBMC
- Scrape TTVDB or TMDB info (whichever is stored in MythTV) to nfo files for each series and episode, and download poster, fanart, and banner images for each series
- Use Comskip for commercial detection
- Run as a MythTV user job when a recording is finished, or to clean myth2kodi files when a recording is deleted (WIP)
Download and Setup
myth2kodi is maintained on GitHub here:
For setup details, please see the myth2kodi wiki here:
Change Log
- 2014-12-11 (v0.1.36)
1. Fixed --comskip argument not able to run
2. Fixed hard coded log file location - log file now written adjacent to myth2kodi.py
3. Removed airdate from file name of specials which required new --clean argument below
4. Changed attribute value for "aired" in each nfo file from the Mythtv value of "StartTime" to "Airdate"
5. Added --clean argument: --clean traverses entire symlink directory updating file names while keeping all comskip files
6. Added auto-clean mechanism
7. Added --refresh-nfos: updates all existing nfos files with the correct "aired" value (see 4 above)
8. Added mechanism to continue searching for series info from either TTVDB or TMDB in case the first episode in the series happens to be a "special"
9. Updated log format
- 2014-11-13
- Implement Python logging
- Add --log-debug argument
- Fix comskip (fixed command to call comskip with wine)
- Add --comskip-status to show number of recordings not yet comskipped
- Fix logic when certain arguments are given
- 2014-11-3
- Write a separate log file with name corresponding to the recording only if an error was encountered and in conjunction with --add (which is used for a single recording after it completes - previously the log file was overwritten after every execution of myth2kodi.py which erased any needed error information)
- 2014-11-2
- Added argument --import-recording-list to test recording lists from any MythTV backend
- Added argument --add-match-programid to match only on program id
- Set default encoding to 'utf-8' to handle non-ascii characters
- Set MySQL connection to use utf-8 and unicode
- Set additional variables as unicode
- 2014-10-18
- Always write a log file (previously only wrote a log file if an error was encountered).
- Changed argument "--scan-all" to "--add-all"
- Added argument "--show-all" - use this to test the script without adding any new files
- Added argument "--comskip" - used to comskip just a single recording
- 2014-10-04
- Switched to using Comskip for commercial detection (Comskip ROCKS!) Run the script with --comskip-all on your current symlink directory (warning it may take many hours, it took 36 hours to scan my 670 recordings). Or use --add <full path to MythTV mpg> to Comskip just one recording for testing (this is the same command used for the MythTV user job BTW).
- Updated logging and error trapping... if any errors are encountered, you should get a myth2kodi.log file in your myth2kodi directory.
- Added argument --scan-all, and other arguments used mostly for testing
- Updated help output, use -h or --help for details
- More testing, working nicely here now.
- 2014-10-01
- Added MythTV database look-up of commercial flags that get written to adjacent comskip txt files
- Added logging mechanism, enable with argument --log
- Added error handling (upon error, full log file is written)
- 2014-09-30
- Added MythTV database look-up of watched flag, to be stored under 'playcount' in epidsode nfo files
- Updated wiki with step to add 'advancedsettings.xml' file to XBMC box (to show the playcount flag)
- Updated wiki with step to install PIL (Python Imagin Library) which is used to create a banner image for TMDB look-ups
- 2014-09-28
- Fixed issue with MythTV giving an error when running the script as a user job (MythTV needs an an exit code of 0)
- Update wiki with step to copy script to /usr/local/bin/myth2kodi/myth2kodi.py as root, and set execute permission (+x)
myth2kodi is written in Python 2.7.3 using PyCharm 3.4, tested in Ubuntu 12.04 running Mythbackend .27, and tested on the frontend with XBMC 13.2.
I hope someone will find this useful!
Please post with any comments/questions.