myth2kodi - view your MythTV recordings in XBMC(Kodi) as TV Shows
#16
Having an issue getting the list to run. I get a 0Byte xml file and the following message in the log:

Code:
20141020_202831.211     INFO: Writing recording list.


'ascii' codec can't encode character u'\u2192' in position 23576: ordinal not in range(128)


Now, as an alternative I've used MySQL workbench and made some MySQL format XMl files which is what I think we're trying to get here. (I just noticed it has an export option.) I'll e-mail them to you, let me know if that'll help.
Reply
#17
I'm trying your latest version for the first time (committed 6 days ago) and cannot get it to work. When I run myth2kodi.py --add-all I get the following back:
Code:
Traceback (most recent call last):
  File "./myth2kodi.py", line 1016, in <module>
    log.error('Exception at line number: ' + str(sys.exc_traceback.tb_lineno))
AttributeError: 'NoneType' object has no attribute 'error'

My config.py is as follows:
Code:
# IP or hostname of your MythTV backend
hostname = "127.0.0.1"

# Port number of your MythTV backend (this is the default, can probably leave as-is)
host_port = "6544"

# A list of MythTV recording directories, full paths in quotes, separated by commas
mythtv_recording_dirs = ["/media/bigdisk/video/RecordedTV/"]

# Path to write symlinks
symlinks_dir = "/media/bigdisk/video/myth2kodi/recordings/"

# API key for TheTVDB
ttvdb_key = "****Numbers here*****"

# Path to store TheTVDB series zips
ttvdb_zips_dir = "/media/bigdisk/video/myth2kodi/ttvdb/"

# API key for TheMovieDB
tmdb_key = "****Numbers here*****"

# MythTV database username, password, and database name
db_user = "mythtv"
db_passwd = ***Password here****"
db_name = "mythconverg"

# Comskip location
comskip_exe = "/opt/comskip/comskip.exe"
Reply
#18
Just a general update. There's been some great work done in the background that fixed the issues I was having with Ascii characters so thought I should post that those issues are resolved. With the latest build to tweak commercial detection I am however having the same issue as ebolam.
Reply
#19
Hey there ebolam, thanks for trying this out! I'm sorry you ran into an error. I just committed an update (v0.1.34 here) that should prevent that error (probably due to a coding error on my part that I didn't catch during my testing, which was I couldn't put a reference to the global log object in the exception block is my guess). Please let me know how that works out. I really appreciate you guys helping to iron things out with this!
Reply
#20
Update:

0.1.36 here has the fix that ebolam ran into (had a hard coded log file in there), plus several other updates.
Reply
#21
Hey all.

I've been doing some updates on jncl's great script. He's pulled in one of my requests (ability to specify a remote MySQL server), but hasn't posted an update here yet. You can get this update my pulling joncl's master branch.

I also have a few more fixes which he hasn't pulled yet, including a small bug that prevented TTVDB lookups for working properly at all with the inetref and a fix for an issue where some (but not all) artwork existed for a show on TTVDB. Now it will download whatever artwork is available (previously it seemed to be an all or nothing affair for downloaded artwork). As well, the option to specify a symlink or a hardlink for the destination. Note There is a configuration change that will affect you with this: the old symlinks_dir configuration item has been renamed to destination_dir. Note 2: This is not highly tested by me. It works for what I'm doing, but YMMV :-) This is all in my master branch:
https://github.com/TravellingGuy/myth2kodi

ALSO, as I was working on this stuff, I got to thinking that (for my purposes anyway), the myth2kodi script was trying to do too much. For me, I'm only using MythTV backend (not the front-end). I'll only ever watch recorded shows imported into the Kodi library. This started me down a road of gutting large bits of the script, and I'm calling it myth2kodi-simplified. If you want to track this, it's the simplified branch in my github.

What's different?
In short, I'm letting Kodi handle all the heavy lifting when it comes to downloaded metadata and artwork.

To this end, some of the changes:
  • write out Kodi compatible filenames. Format: <title> - S##E## - <subtitle>.ext
  • use the tv show title as it comes from TTVDB, not from MythTV. This allows Kodi to easily find a match and download everything it needs.
  • it requires that you're MythTV recordings have a ttvdb inetref.
  • it's not trying to create "safe" title names. This may break things (especially on Windows), but I don't use Windows, just Linux and so far so good.
  • a fix to ignore recordings in the "Deleted" recording group.
  • the clean() function is gone
  • option to use hardlinks or symlinks when linking the file to Kodi. For me, hardlinks are preferred, as once a file gets into the Kodi library, the recording can be deleted from MythTV.

Caveats:
  • the movie lookup stuff is not something I have used at all, it may be completely broken!
  • as mentioned above, I'm not trying to use "safe" title names for filenames...this may break things if a title has very strange characters, but if we can keep the original title as much as possible, it helps Kodi find a match when it's looking for metadata and artwork.
  • it "works for me", but most scenarios are not well tested (if tested at all), so things may break for you.
  • lots of extraneous code is still in place, lots of cleanup yet to be done.

Once again, I need to thank jncl for the original script, or this would not have happened. He did all the heavy lifting ahead of me!
Reply
#22
I just stumbled across this post and it seems very interesting. I have one quick question though about comskip. I already have mythtv flagging commercials. However, it just creates a cut-list and kodi (with mythtv addon), skips commercials based on the flagging. Therefore, I'm trying to understand why we need to use comskip. Won't kodi use the already flagged commercials from mythtv-backend?
Reply
#23
(2015-02-26, 23:27)peterman1002 Wrote: I just stumbled across this post and it seems very interesting. I have one quick question though about comskip. I already have mythtv flagging commercials. However, it just creates a cut-list and kodi (with mythtv addon), skips commercials based on the flagging. Therefore, I'm trying to understand why we need to use comskip. Won't kodi use the already flagged commercials from mythtv-backend?

This 'myth2kodi' script actually works completely separate from the mythtv addon, which places recordings from myth under the LIVE TV section in Kodi. I wanted myth recordings to go under the 'TV SHOWS' section in Kodi (I don't use Live TV anyway). So this script makes a library of symbolic links to myth recordings along with nfo files which Kodi uses to index the library. This works for all 'recognized' recordings, which are those that have series/episode info. However, recordings with no S/E info got placed under the 'VIDEOS' section Kodi, which wasn't ideal. So what this script does, is name each symbolic link (to a myth recording) in such a way that everything shows up under 'TV SHOWS' in Kodi.

The last challenge was commercial skipping. I attempted to pull existing commercial markers from the myth database, and put them in each nfo file, but I couldn't get it to work properly... some commercial skips worked, but others were way off, which of course sort of ruined the watching experience. I found comskip to be much more accurate. Comskip markers are stored in a sidecar file alongside each recording symlink, which Kodi uses to faithfully skip commercials (so far).

Hope this helps!
Reply
#24
Myth comm markers are on frame numbers, edl's are time based. If you get variable frame rates in your stream*, it will obviously screw up.

Coupled with this, all comm skipping is guess work, and sometimes fails.

I prefer the skip button on my remote.

* EDIT or if the frame rate is wrongly detected by whatever is doing your conversion.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#25
Pulling recordings into the TV Shows section in Kodi would be great. I think it looks much nicer than the mythtv recordings section. However, running commercial skipping twice isn't ideal (once for myth-frontend and once for kodi with comskip). The current mythtv add-on for Kodi is able to use the skip markers and skip the commercials just fine, so maybe you can see what they are doing to use them. Unfortunately, I never learned Python so I probably can't help much. Although, I may still poke around a bit.
Reply
#26
I too stumbled upon this thread and thought I would give it a go since it sounds like exactly what I was looking for.
As I am just testing out Kodi and MythTV before installing it on my media pc I have no series set to record on a weekly basis, but have run a number of individual recordings of shows.
I therefore figured I would try myth2kodi.py --show-status --comskip-off first but I am getting a "Error: unable to fetch data" for all the recordings
I have tried changing "localhost" to the IP of the machine in the DB section in case that was the problem but still gets the error.
Any idea what could be wrong?

Thanks
Reply

Logout Mark Read Team Forum Stats Members Help
myth2kodi - view your MythTV recordings in XBMC(Kodi) as TV Shows0