[ANN] The TivoHMO and TivoHME ruby libraries

Discussion in 'Developers Corner' started by wr0ngway, Oct 13, 2014.

  1. wr0ngway

    wr0ngway New Member

    23
    0
    Jan 4, 2014
    Hi all,

    I officially had too much time on my hands, and being a ruby fan decided to reimplement hmo/hme in ruby:

    https://github.com/wr0ngway/tivohmo
    https://github.com/wr0ngway/tivohme

    I'm a fan of plex for managing my library, and pytivo/hmeforpython for making my library available to my tivos, but was finding it too difficult to use plex as the metadata source for pytivo/hme. Thus I wrote these with a little more separation between components to make it easier to plug/play the bits extenders may care about. The original goal when I started was to have a single media library through plex, and have it exposed to the tivo with hmo, maybe hme, and possibly an opera app. Given the recent work by ntlord ( https://github.com/ntlord/PlexTivo ), I'm not sure if I'll do much with the hme implementation so it remains lacking a test suite, but thought I'd share in case others were interested.

    The tivohmo project is mostly complete and tested, but the transcoder is pretty basic. If anyone is more of an expert in all the ffmpeg magic involved in getting video to a form the tivo is looking for, and is looking to contribute, I'd be happy to accept :) A way to serve streams to tivo mini's would also be very cool, but have no idea where to start.

    This project wouldn't be possible without all the other groundbreaking work done in the other tivo projects (pyTivo, hmeforpython, videomanager, etc), so would like to thank everyone thats contributed to those projects for figuring out all the hard stuff to make my life easier :)
     
  2. davidblackledge

    davidblackledge Registered lÜser

    563
    36
    Sep 9, 2008
    NM
    Hah! fun! Thanks for sharing this!
     
  3. Mar 8, 2015 #3 of 27
    wr0ngway

    wr0ngway New Member

    23
    0
    Jan 4, 2014
    Just letting everyone know that I've been continuing to work on my tivohmo app, and its now my daily driver for getting video from my plex server to my tivo

    Some Noteworthy features:

    Full control of runtime from command line or config file
    Application for changing runtime settings of the server from the Tivo UI
    Application to serve video to the Tivo from the Filesystem
    Application to serve video to the Tivo from a Plex Media Server
    Can serve video with on-the-fly hardcoded subtitles from srt files (embedded subs, e.g. mkv, are also supported in plex app)
     
  4. Mar 8, 2015 #4 of 27
    Fofer

    Fofer Bo55man69

    92,818
    4,426
    Oct 29, 2000
    Sweet! I'm gonna have to give this a try. Thank you!
     
  5. wr0ngway

    wr0ngway New Member

    23
    0
    Jan 4, 2014
    Did you get a chance to try it yet? Any problems?
     
  6. joeblow8579

    joeblow8579 New Member

    14
    0
    Apr 2, 2014
    I'm getting a strange error when I try to install tivohmo via the instructions on the github site. Here's the error:

    Code:
    Fetching: i18n-0.7.0.gem (100%)
    Successfully installed i18n-0.7.0
    Fetching: json-1.8.2.gem (100%)
    Building native extensions.  This could take a while...
    ERROR:  Error installing tivohmo:
    	ERROR: Failed to build gem native extension.
    
        /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
    mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h
    
    
    Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/json-1.8.2 for inspection.
    Results logged to /Library/Ruby/Gems/2.0.0/gems/json-1.8.2/ext/json/ext/generator/gem_make.out
    
    Any ideas why it won't install?
     
  7. wr0ngway

    wr0ngway New Member

    23
    0
    Jan 4, 2014
    Looks like its using the ruby that comes preinstalled with OS X. I've never had much luck with that as its usually woefully out of date. In this case it just looks like the ruby development headers are missing, and thus some binary extensions that tivohmo depends on cannot be compiled. I'm not sure how to get headers for the system ruby, maybe by installing the xcode CLI tools - http://railsapps.github.io/xcode-command-line-tools.html ?

    It'll probably end up easier to use rvm to setup a more complete ruby instead:

    https://rvm.io/rvm/install

    This may help as well:
    https://www.ruby-lang.org/en/documentation/installation/
     
  8. joeblow8579

    joeblow8579 New Member

    14
    0
    Apr 2, 2014
    Thanks for getting back to me quickly. I installed the Xcode CLI tools and it got through the installation successfully.

    For future reference: it might be really helpful to put an example of the syntax of how to get apps running. I'm now trying to decipher the --help command and it's slow going (I've never done anything with plex on the command line, only set up pyTiVo that way, which was quite easy).

    edit: I meant an example in the settings file, by the way. That wasn't clear in my initial comments. The examples are there in the --help thingy, but it isn't immediately clear to the novice (which I am) how exactly to properly format them in the .plist file.
     
    Last edited: Apr 17, 2015
  9. davidblackledge

    davidblackledge Registered lÜser

    563
    36
    Sep 9, 2008
    NM
    I think you meant to say "you installed it the wr0ng way."
    :p
     
  10. wr0ngway

    wr0ngway New Member

    23
    0
    Jan 4, 2014
    Understood - I work in this stuff all day so I lose perspective on what makes sense for people that don't :) Were you able to get it working?

    Would be great if you could add something to the wiki https://github.com/wr0ngway/tivohmo/wiki or add to the comments in the config file (via fork + pull request) https://github.com/wr0ngway/tivohmo/blob/master/contrib/tivohmo.yml
     
  11. wr0ngway

    wr0ngway New Member

    23
    0
    Jan 4, 2014
    Heh, yeah, my nick usually applies more to what I'm doing than others :)
     
  12. joeblow8579

    joeblow8579 New Member

    14
    0
    Apr 2, 2014
    Actually no. I tried adding what I thought was the right stuff to the .plist file but ended up with an error saying:

    Code:
    [2015-04-17T20:32:11] INFO  TivoHMO::Config No primary config at file: ''
    [2015-04-17T20:32:11] INFO  TivoHMO::Config No secondary config at file: ''
    [2015-04-17T20:32:11] INFO  TivoHMO::CLI TivoHMO 0.3.1 starting up
    ERROR: at least one application is required
    
    See: 'tivohmo --help'
    
    In my settings file I added some commands like this: <string>-t "Movies"</string> with the names of my Plex channels. I'm still not entirely clear on what needs to be added to the .plist to tell it what to do.
     
  13. wr0ngway

    wr0ngway New Member

    23
    0
    Jan 4, 2014
    Ok, if you ran "tivohmo --install" it should have installed the plist for running tivohmo into "~/Library/LaunchAgents/tivohmo.plist" and the config file into "~/Library/Preferences/tivohmo.yml" If you run it again, it will overwrite any mods you have made.

    You shouldn't need to edit the plist as all it does is run tivohmo with the config file. You shouldn't need to edit the config file either as it should have working defaults.

    To run tivohmo using the plist:
    launchctl load ~/Library/LaunchAgents/tivohmo.plist

    To stop it:
    launchctl unload ~/Library/LaunchAgents/tivohmo.plist

    Note this tells OSX this program is a daemon, and it will keep it running after crashes/reboot/etc

    You can verify its running with a command like (or use Activity Monitor):
    ps ax | grep [t]ivohmo

    Note if the number on the left (the pid) keeps changing, it means that tivohmo keeps dying and restarted, so something is probably wrong, and you can debug with the logfile at:
    ~/Library/Logs/tivohmo.log
     
  14. joeblow8579

    joeblow8579 New Member

    14
    0
    Apr 2, 2014
    So I started over by installing again, and I didn't make any changes to either file. I loaded the launch agent and now it appears to be working. I am able to see the TiVoHMO shares in My Shows on the TiVo.

    However, when I browse to a show or movie, the various folders that contain the media show up on the tivo as empty, with no content.

    I briefly looked through the tivohmo.log file but didn't see any obvious errors kicked out by the program.
     
  15. wr0ngway

    wr0ngway New Member

    23
    0
    Jan 4, 2014
    By empty, do you mean they have a (0) beside them? Or do you mean that when you browse into them they have no contents? The reason I ask is that I made an optimization for slower systems so that the counts don't get updated till you browse down into them, so try to browse into them if you didn't already
     
  16. joeblow8579

    joeblow8579 New Member

    14
    0
    Apr 2, 2014
    They show a (0) but when I actually browse into them it gives me the "This Group is now empty. Press LEFT to return to the My Shows List." message.

    I've tried browsing into Movies by "All" as well as by several of the other criteria listed there. They all appear empty.
     
  17. wr0ngway

    wr0ngway New Member

    23
    0
    Jan 4, 2014
    Does it sit for a while before deciding its an empty group? How large a library do you have? It could just be timing out while loading the details for a really large library, but if you go back later it will be populated.

    You do have content in the plex library running on the same host as tivohmo, correct?

    Other than, I could take a look at the log and see if I see anything.
     
  18. joeblow8579

    joeblow8579 New Member

    14
    0
    Apr 2, 2014
    I have a fairly large library, but I've tried navigating to folders with just one or two things in them and seen no difference.

    It doesn't seem to take very long to decide that folders are empty. Maybe a few seconds at the most. Should I email you the log file?
     
  19. wr0ngway

    wr0ngway New Member

    23
    0
    Jan 4, 2014
    Email is fine, or a shard link to dropbox or create a github issue or gist to hold it
     
  20. joeblow8579

    joeblow8579 New Member

    14
    0
    Apr 2, 2014
    Apparently I need 10 posts to send PM's. This is my tenth (pointless) post.
     

Share This Page