If you have not already, we suggest setting your Plex username to something else rather than email which is displayed on your posts in forum. You can change the username at https://app.plex.tv/desktop#!/account
Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

[REL] MythTV plug-in

2456720

Comments

  • aritafariaritafari Posts: 6Members

    $ uname -a

    Linux aritafari-tv 3.2.0-58-generic #88-Ubuntu SMP Tue Dec 3 17:40:43 UTC 2013 i686 i686 i386 GNU/Linux




    $ head /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Logs/Plex\ Media\ Server.log

    Dec 17, 2013 12:37:26 [0xb77a1700] INFO - Plex Media Server v0.9.8.14.263-139ddbc - ubuntu PC i686
    Dec 17, 2013 12:37:27 [0xb77a1700] DEBUG - Opening 10 database sessions to library, SQLite 3.8.0.2, threadsafe=1
    Dec 17, 2013 12:37:27 [0xb77a1700] INFO - SQLITE3:a, 283, recovered 50 frames from WAL file /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
    Dec 17, 2013 12:37:27 [0xb77a1700] DEBUG - Running migrations.
    Dec 17, 2013 12:37:27 [0xb77a1700] DEBUG - Listening on port 32400 with queue of 128 connections.
    Dec 17, 2013 12:37:27 [0xb77a1700] DEBUG - Listening on port 32443 with queue of 128 connections.
    Dec 17, 2013 12:37:27 [0xb77a1700] DEBUG - Setting up scheduled updates
    Dec 17, 2013 12:37:27 [0xb77a1700] INFO - LibraryUpdateManager path watching is disabled
    Dec 17, 2013 12:37:27 [0x3746b40] DEBUG - Starting scheduled updates, every 3600 seconds
    Dec 17, 2013 12:37:27 [0xb77a1700] DEBUG - Checking for blacklisted version for Framework.bundle (version bd749cb)
  • aritafariaritafari Posts: 6Members

    Additionally, I don't see MythtvRecordings mentioned anywhere in the server log.

    I really would like to get this working.

    Please let me know if you need to see more logs.

  • pabergeronpabergeron Posts: 4Members

    @schaumburg

    Permissions were wrong.  Fixing permissions just like my favorite 'Twit' Channel did not change anything.  Still no success!

    I'm trying to get more then two minutes access to the MythBox computer to get the log files... kids are always on and they do not like to see Dad playing around with the MythBox.  I will try to get the logs later tonight.

    Pierre

  • aritafariaritafari Posts: 6Members
    pabergeron wrote on December 17 2013, 10:47 PM: »

    @schaumburg

    Permissions were wrong.  Fixing permissions just like my favorite 'Twit' Channel did not change anything.  Still no success!

    I'm trying to get more then two minutes access to the MythBox computer to get the log files... kids are always on and they do not like to see Dad playing around with the MythBox.  I will try to get the logs later tonight.

    Pierre

    Were you able to at least make the plugin show in your channel? If so, what did you do?

  • schaumburg01schaumburg01 Posts: 136Members, Plex Pass Plex Pass
    edited December 2013

    @pabergeron,

    Apologies for repeating myself, but I forget this myself every single time:

    Remember to restart the plex service (/usr/sbin/service plexmediaserver restart, if I remember correctly) to reload after making any changes to the plugin!

    /Thomas

    PS: how about the Plex logs, as detailed in my previous post to ari tafari?

  • schaumburg01schaumburg01 Posts: 136Members, Plex Pass Plex Pass

    @ari tafari

    Right, seems like your Plex server doesn't find the MythRecordings plug-in at all (you did remember /usr/sbin/service plexmediaserver restart, didn't you...?)

    Just to cover all the bases, try the following: 

    1. Find a plugin (let's call it X) in the same directory you've put MythRecordings.bundle in, install it in the client, restart the plex server, and test that X shows up OK. This will verify that Plex actually has access to the X.bundle directory
    2. Try removing the X.bundle directory, restart the plex server, and test that the X plugin now disappears from the client. This will verify that you don't have two X.bundle directories

    ​If this works as expected, you'll have verified that Plex is able to load the X plug-in from exactly where you've put MythRecordings.bundle.

    If so, next step is meticulously comparing the X.bundle and MythRecordings.bundle directories (structure, case-sensitive filenames, permissions, all that...)

    If you can't spot any differences, you'll need to go through the Plex Media Server.log file and look for anything suspicious.

    Last resort will be you emailing me a lot of files - but let's just try the above first ;-)

  • aritafariaritafari Posts: 6Members

    @schaumburg,

    Thank you for the suggestions.

    Yes, restarted PMS several times (from the terminal)

    As you instructed, I also tried installing/removing a different plug-in (TWit.Tv); this showed up in Channel and was gone when I deleted it.

    The only thing I noticed was that in the var/lib/Plex...... Plug-ins directory was that all the plugins except MythRecordings (MR) have Plex as owners.

    MR has root. I even changed MR's ownership to Plex to no avail.

    I have now completely purged PlexMediaServer from my system, hoping to try again at a later time.

    It is probably something quite simple that I am overlooking.

     
  • schaumburg01schaumburg01 Posts: 136Members, Plex Pass Plex Pass

    @ari tafari

    Sorry to hear it hasn't worked out yet - though, as you say, you're probably close.

    I tried upgrading my Plex server yesterday (to 0.9.8.14.263), just in case it was some incompatibility in the new version - but it still works for me!

    My hunch is that it's probably down to ownership & permissions on the MythRecordings.bundle directory (and its contents, recursively down to the pits of Python code!).

    Though it puzzles me that there's no error messages to that effect ("cannot open directory MythRecordings.bundle", or something) in the Plex Media Server.log

    /Thomas

    PS: If you do work out what's wrong, let me know, so I can update the installation instructions (or feel free to update them yourself, if github will let you...)

  • schaumburg01schaumburg01 Posts: 136Members, Plex Pass Plex Pass
    edited December 2013

    @ari tafari

    @pabergeron

    A bit late, but I thought I'd post the permissions and ownership of my (working) MythRecordings bundle.

    You'll notice that the owner is user 'thomas', which is just an ordinary user account (the one the Ubuntu install makes for you) - it has no special privileges (the Plex server has its own plex account, and the MythTV backend has its own mythtv account too).

    (Come to think of it, I probably should chown the whole lot to plex.plex. And the permissions are a bit...promiscuous. But it works - and if it ain't broke...;-)

    Anyway, here it is, warts and all:

    thomas@mythbackend:~$ ls -lR /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Plug-ins/MythRecordings.bundle
    /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/MythRecordings.bundle:
    total 8
    drwxrwxr-x 5 thomas thomas 4096 Nov  9 11:06 Contents
    -rw-rw-r-- 1 thomas thomas  102 Nov  9 10:59 README.md
    
    /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/MythRecordings.bundle/Contents:
    total 20
    drwxrwxr-x 2 thomas thomas 4096 Nov 18 08:18 Code
    -rwxr-xr-x 1 thomas thomas  386 Nov  3 15:35 DefaultPrefs.json
    -rwxr-xr-x 1 thomas thomas  504 Nov  3 15:35 Info.plist
    drwxrwxr-x 2 thomas thomas 4096 Nov  9 11:06 Resources
    drwxrwxr-x 2 thomas thomas 4096 Nov  9 11:06 Strings
    
    /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/MythRecordings.bundle/Contents/Code:
    total 24
    -rwxr-xr-x 1 thomas thomas 9121 Nov 18 08:18 __init__.py
    -rwxr-xr-x 1 thomas thomas 9120 Nov 17 15:48 __init__.py~
    
    /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/MythRecordings.bundle/Contents/Resources:
    total 432
    -rwxr-xr-x 1 thomas thomas  62674 Nov  3 15:35 icon-default.png
    -rwxr-xr-x 1 thomas thomas 171857 Nov  3 15:35 icon-prefs.png
    -rwxr-xr-x 1 thomas thomas  62674 Nov  3 15:35 item-default.png
    -rwxr-xr-x 1 thomas thomas 137728 Nov  3 15:35 Thumbs.db.org
    
    /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/MythRecordings.bundle/Contents/Strings:
    total 4
    -rwxr-xr-x 1 thomas thomas 2782 Nov  3 15:35 en.json
    
    
  • aritafariaritafari Posts: 6Members
    edited December 2013

    @schaumburg,

    Told you it was something simple I was overlooking.

    The MythRecordings.bundle-master.zip file was extracted and copied to the plug-ins directory as MythRecordings.bundle-master.

    Once I removed (-master) from the file, Mythtv appeared in my channel. I had also tried the .tar.gz which was extracted as .bundle-0.2  (also didn't work). I am truly sorry for taking up so much of your time.

    Regards,

    Ari Tafari

  • txvoodootxvoodoo Posts: 5Members ✭✭

    @schaumburg

    I want to thank you for this plugin. We've been using mythtv for a decade in this house, but our frontend boxes would die, and it's been a real pain to fix them and expensive to replace them, and despite my husband's desire to keep the "WAF" (Wife Acceptance Factor) high, he hasn't had as much time to work on the myth system. He does keep the backend going, recording our shows. 

    I got a Roku 3 for my bedroom, and love it with Plex, but today my office mythbox frontend died. I've been trying to find a way to hook either roku or plex into myth, and found this today, and voila! It works like a charm! So I'm getting another Roku for my office, and will not need the mythbox frontend in there, either. :D 

    Now I just have an awful lot of myth recordings to catch up on! :D 

  • schaumburg01schaumburg01 Posts: 136Members, Plex Pass Plex Pass

    @aritafari

    good to hear you got it working - I was almost getting spooked...:-) And don't worry about it - glad to help getting my "baby" out into the world.

    @txwoodoo

    thanks for the kind words.

    @pabergeron

    if you get time to tinker over Christmas, let us know how you're progressing.

    @all

    Please feel free to report any issues (I think the github site might be best for that?)

  • themoreythemorey Posts: 22Members, Plex Pass Plex Pass

    Is this version specific wrt MythTV backend?  I had it working with the following:

    MythTV 0.25 (mythbuntu)

    PMS 0.9.8.14

    I upgraded Myth backend to 0.27 and the Plex plugin no longer works.  Myth works and I created a "home movies" section for my Myth recordings and can view the recordings that way.  Unfortunately, although the plugin shows up in PMS, it errors out.  The plugin log shows the following:

    2013-12-24 18:45:21,588 (7f209affd700) :  INFO (__init__:66) - GetRecordingList(filterKeyName="None", filterKeyValue="None", sortKeyName="StartTime"): Loading URL http://192.168.2.211:6544/Dvr/GetRecordedList
    2013-12-24 18:45:41,610 (7f209affd700) :  CRITICAL (runtime:880) - Exception (most recent call last):
      File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/runtime.py", line 840, in handle_request
        result = f(**d)
      File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/MythRecordings.bundle/Contents/Code/__init__.py", line 68, in GetRecordingList
        u = urllib2.urlopen(request)
      File "/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/urllib2.py", line 127, in urlopen
        return _opener.open(url, data, timeout)
      File "/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/urllib2.py", line 404, in open
        response = self._open(req, data)
      File "/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/urllib2.py", line 422, in _open
        '_open', req)
      File "/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/urllib2.py", line 382, in _call_chain
        result = func(*args)
      File "/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/urllib2.py", line 1214, in http_open
        return self.do_open(httplib.HTTPConnection, req)
      File "/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/urllib2.py", line 1187, in do_open
        r = h.getresponse(buffering=True)
      File "/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/httplib.py", line 1045, in getresponse
        response.begin()
      File "/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/httplib.py", line 409, in begin
        version, status, reason = self._read_status()
      File "/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/httplib.py", line 365, in _read_status
        line = self.fp.readline(_MAXLINE + 1)
      File "/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/socket.py", line 476, in readline
        data = self._sock.recv(self._rbufsize)
    timeout: timed out
    
  • schaumburg01schaumburg01 Posts: 136Members, Plex Pass Plex Pass
    edited December 2013

    @themorey

    I'm on 0.26 myself, but I've heard rumours that 0.27 has introduced breaking changes to the MythTv services API. I'm not sure if that's just malicious gossip, but I'd look that way first.

    This being Christmas and all (just finished clearing the kitchen after the family christmas dinner:-), I probably won't have time for the next few days, but I hope I can look into this by Friday/Saturday- Feel free to poke me if I forget :-)

    If you find some solution before then, let me know!

    o<|:-)>

  • txvoodootxvoodoo Posts: 5Members ✭✭
    aritafari wrote on December 20 2013, 6:31 PM: »

    I had also tried the .tar.gz which was extracted as .bundle-0.2  (also didn't work). 

    When I originally put this in as MythRecordings.bundle-0.2 it didn't work. Then it dawned on me - rename the folder to MythRecordings.bundle and voila! Success. All plugin folders have to end in .bundle, nothing else.

  • pabergeronpabergeron Posts: 4Members

    @schaumburg

    Victory!  The MythTv plugin is showing....

    The only thing I did is to change the folder name to something ending with .bundle.

    It also casts to the ChromeCast and that is very cool.  The only big problem is that is buffers quite a lot.  Cannot watch more then about 1 minute of HD 1080p vidéo.  There must be someway to tell the Plex server to buffer a bit more to prevent pauses.  I'm checking write now for solutions.

    Again @schaumburg, thanks for your time!

    Pablhomme

  • schaumburg01schaumburg01 Posts: 136Members, Plex Pass Plex Pass
    @pabergeron
    Yay! Happy xmas:-)

    @txvoodoo
    Thanks for assisting
  • sean3522sean3522 Posts: 2Members, Plex Pass
    edited December 2013

    Good morning!

    I have been working on getting the mythtv plugin working and have had some success.

    1.  Mythtv shows in channels

    2.  Can access my recordings listings from the plex server / plugin

    - (had to rename the bundle, and change permissions recursively through the directory structure, restarted server)

    3.  When trying to access a list of recordings (example, recordings by title, select show), I get "the media server responded with an error".

    In looking through the plugin logs, this is where things seem to be going wrong.

    2013-12-27 09:33:07,686 (7f472bfff700) :  DEBUG (runtime:49) - Received packed state data (80 bytes)

    2013-12-27 09:33:07,688 (7f472bfff700) :  DEBUG (runtime:814) - Found route matching /video/mythrecordings/GetRecordingList

    2013-12-27 09:33:07,689 (7f472bfff700) :  INFO (__init__:66) - GetRecordingList(filterKeyName="Title", filterKeyValue="Fast N

    ' Loud", sortKeyName="StartTime"): Loading URL http://172.16.10.6:6544/Dvr/GetRecordedList

    2013-12-27 09:33:12,952 (7f472bfff700) :  CRITICAL (runtime:880) - Exception (most recent call last):

      File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/V

    ersions/2/Python/Framework/components/runtime.py", line 840, in handle_request

        result = f(**d)

      File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/MythRecordings.bundle/Contents/Code/_

    _init__.py", line 84, in GetRecordingList

        oc.add(Recording(recording))

      File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/MythRecordings.bundle/Contents/Code/_

    _init__.py", line 100, in Recording

        shouldStart = datetime.datetime.strptime(programStart,"%Y-%m-%dT%H:%M:%SZ")

      File "/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/_strptime.py", line 325, in _strptime

        (data_string, format))

    ValueError: time data '2013-12-27T02:00:00' does not match format '%Y-%m-%dT%H:%M:%SZ'

    2013-12-27 09:33:12,955 (7f472bfff700) :  DEBUG (runtime:106) - Sending packed state data (120 bytes)

    2013-12-27 09:33:12,969 (7f472bfff700) :  DEBUG (runtime:915) - Response: [500] 1112 bytes

    Any ideas?

    Just installed ubuntu and plex on the server yesterday.  Mythtv is 0.25 and has been running / stable for over a year.

    Any help greatly appreciated!

    Sean...

    PS.  Plex version 0.9.8.18

    Linux:  Ubuntu 64 bit 13.10

    MythTV Version : v0.25.2-9-ga72e341

    MythTV Branch : fixes/0.25

    Network Protocol : 72

  • schaumburg01schaumburg01 Posts: 136Members, Plex Pass Plex Pass
    @sean3522 - a very quick reply:

    This is a known error (reported here just before christmas), related to timezones. In some timezones, myth reports timestamps as "2013-12-27T11:00:00Z", in others as "2013-12-27T11:00:00". The code expects the "...Z" version.

    Quick fix: in line 100 of __ini__.py, change the string %Y-%m-%dT%H:%M:%SZ to %Y-%m-%dT%H:%M:%S

    The real fix obviously is to make the code try both patterns.

    Can I get back to you when I have a shot at a fix?

    Apologies for the terseness - I'll have some more time in a few days.

    /thomas
  • sean3522sean3522 Posts: 2Members, Plex Pass

    Thanks Thomas.  That did the trick.  Thanks for the quick reply!

Sign In or Register to comment.