# python HME web launcher



## moyekj

Attached to this post is a "weblauncher" module for python HME. The intent is to be able to launch web pages on internal TiVo Opera browser from the TiVo itself. i.e. This is an HME wrapper around launching web pages on TiVo internal browser. Obviously the web launching will only work for series 4 or later TiVos (and Minis).
This may become useful at some point if/when 3rd party html/html5 applications are developed for TiVo.

Once unzipped to top python HME folder all you need to do is edit weblauncher/config.ini to supply your 10 digit MAK, and also to enter 1 or more URLs that you want to be able to launch.


----------



## jgametest

Since we all were pushed OperaTVStore on 20.38 navigation our Opera Web Browser broke. We initiated the page with a "web" button found in remote of KMTTG. We briefly could navigate with arrow keys or the TiVo apps for mobile devices. If you were to send a command to bing.com right now it would quickly load allowing text to be typed in search box and move up & down the search query box for a name and once you pushed ENTER that's it. Search results load but have lost the ability to move around.

Sadly in my initial test I was signed into my own plex channel, but TiVo was unable to accept the codecs for playback. This was done by copying the login ip address from my browser. 

=( We were so close.


----------



## moyekj

There's some navigation capability on generic web pages (Q,A to jump between links, W,S to jump between text with Slide remote), but yes the arrow key functionality was taken away. But this is more intended for html applications specifically designed for TiVo in which case input capabilities such as responding to arrow keys would be taken care of by the App.


----------



## davidblackledge

Pretty cool looking. I'd love to incorporate this kind of thing into Enter Webz, but I get the impression that I couldn't establish the connection from a public server to a TiVo behind a firewall. Does that sound right to you? 
Seems to me, all I have is HME connection details which isn't enough to establish a new RPC connection through a firewall, even if the user provided their MAK (which they shouldn't be comfortable with, anyhow).


----------



## moyekj

Yes that's right, the firewall would get in your way if running from a public server, so this program would be useless in that mode as well. i.e. HME server needs to be on the LAN.

I do use RPC functionality outside my home via kmttg, but I've setup manual port forwarding in my router to enable that.


----------



## moyekj

Coffin - meet nail. After 20.4.1 software update when trying to launch a web page on internal Opera browser:
RPC error response:
{
"text": "Not allowed.",
"debug": "",
"code": "notAllowed",
"type": "error"
}

Thanks TiVo as always for doing your best to shut down any new 3rd party development...


----------



## gonzotek

moyekj said:


> Coffin - meet nail. After 20.4.1 software update when trying to launch a web page on internal Opera browser:
> RPC error response:
> {
> "text": "Not allowed.",
> "debug": "",
> "code": "notAllowed",
> "type": "error"
> }
> 
> Thanks TiVo as always for doing your best to shut down any new 3rd party development...




Banishing interested indie devs to the no-mans-land of the Opera store is so short-sighted. This is the third time TiVo started something indie developer-related and then dropped it almost immediately. There was HME, which had a fairly good level of support (at least it did for first few months). Who remembers the HME developer contest? Then there was the Flash SDK(which was completely DOA), and now the crippling of any potential web apps.

Opera has also been very unsupportive of TiVo development. I and Dan203 asked several TiVo-related questions over on their dev forums only to get responses days or weeks later with terse, basically unhelpful replies. And then they ported their forums to a new platform and we can't even access the content of the old forums, which at least had some pretty helpful threads about common, not-tivo-specific, issues people faced while developing for the Opera store.

Before I got a Roamio, I was excited about the Opera Store. I never developed strong Java or Python skills, but I can work fairly proficiently in javascript, and building powerful js/html/css apps is, well, fun for me. . But seeing how TiVo and Opera treat an indie (non-partner) developer...ugh. I had been working on a web app that would be a companion to pyTiVo. It would allow music playback and photo viewing on TiVo(using a modern-looking HD interface), as well as allow the user to access pyTivo served content from other devices like tablets and phones. Now it might still be a nice addition to pyTivo to let people access their content from a mobile browser, but the main reason I wrote it was to be on the big screen and TiVo just killed that option.

Compare TiVo's attitude to 3rd party devs to the amount of interaction indie Roku developers get with Roku employees: Almost every post in the Roku developer forum gets attention from a Roku employee and many times Roku has been willing to not only listen to developer concerns but to even put many improvements into the product as a result of the discussions that take place there.

I hope someone from TiVo sees this (as they seem to be aware enough of the web launcher to disable its functionality) and realizes how frustrated we are. Especially since we can't give them feedback at the 'official' developer site. I'm more than willing to jump through some hoops in order to work on TiVo as an indie dev. Want me to sign a developer agreement & give set up some security measures so you can be sure your platform isn't being compromised in ways you don't approve of? I'm down, just show me where to sign up. But why go through all the trouble to add something as flexible and powerful as the Opera browser to your platform and then not want to allow people to take full advantage of it? Amazon, Roku and Google all have healthy developer programs for their tv devices(amazon's being an extension of their already healthy tablet dev program). TiVo has had multiple chances to 'do it right' and somehow managed to screw up each one. Your platform needs apps and you can't partner your way to every last niche-y one that could appeal to a user. You are already so far behind the other major players (apple, google, amazon, Roku, Ms/Xbox Sony/PlayStation) in third-party content. Even the cable-cos you're partnering with are realizing that there's money to be made from opening up to app developers, since having them makes the users that much more likely to stick with the cable-co internet pipe, even if the cable content isn't as appealing to them.


----------



## ntlord

This is really disappointing. 

You can still sign up for an Opera Dev account though, which is what I've been using to test things out. Although, that is not exactly ideal for wider distribution of an application.

I was just about to start taking a second look at the MPEG-DASH stuff for a Plex app, but now I'm not sure its worth it.


----------



## davidblackledge

Ok, so in the next Enter Webz release it will convert TiVoConnect links into a page, and testing it out I see that a few entries for TiVo's server will actually result in launching the non-HME app (Youtube, Netflix)
... so there *IS* a way to transition from HME to one of those, we just have to figure out what they're doing (hopefully it's not something hardcoded in an update for just those apps).

Those apps are Flash, as I recall, but that makes me think of two things: 
1) if you can do this transition, you should be able to do an HTML5 transition, too, and 
2) you might be able to do a transition from Flash to HTML5 if nothing else.

If we can get those transitions figured out, EnterWebz.tv can easily be a clearinghouse for links to those apps.

Also, I would love to kick off arbitrary flash apps from within EWz using this technique... even if it may result in some weirdness.


----------



## gonzotek

ntlord said:


> This is really disappointing.
> 
> You can still sign up for an Opera Dev account though, which is what I've been using to test things out. Although, that is not exactly ideal for wider distribution of an application.


Yep. For what I was working on, distribution via the Opera store won't work at all. It's served from an additional html page hosted by pytivo, particularly so that it can make xmlhttprequests of pytivo from the same origin. It's also generally only ever served from a local network. The Opera store doesn't expect things to work like that, they want a 'fixed' public url, not one that may change frequently like dhcp clients can.



> I was just about to start taking a second look at the MPEG-DASH stuff for a Plex app, but now I'm not sure its worth it.


I'm convinced it's possible to send the mp4 segments to the tivo's browser and play them back successfully. What I couldn't get working was a simple encoding process on the server. But I'm certain it's doable by someone, given enough time and effort, and encoding expertise.


----------



## bradleys

Did we notice any changes to the opera web browser following the latest update?


----------



## moyekj

bradleys said:


> Did we notice any changes to the opera web browser following the latest update?


?? As mentioned above 20.4.1 disabled arbitrary browser access completely.


----------



## bradleys

Ok, I wasn't following the dates in the thread closely enough.

Very disappointing.


----------



## ntlord

gonzotek said:


> I'm convinced it's possible to send the mp4 segments to the tivo's browser and play them back successfully.


Plex already does this. All that it really takes is modifying the Javascript MPEG-DASH player I posted in the other thread (https://dash-mse-test.appspot.com) to understand the more advanced SegmentTemplate elements going on in the Plex MPEG-DASH XML.

I did some further testing, and as it happens there are better MPEG-DASH javascript players (dash-if.org) out there that natively understand the Plex MPEG-DASH xml (i.e. SegmentTemplates), but for whatever reason, it doesn't work (even with the same videos played on the mse-test site) in Opera on the Tivo, but works fine in Chrome. Since debugging is non-existent on the TiVo, I didn't spend much time trying to figure out why it didn't work, but it should also be possible to get it working.


----------



## gonzotek

ntlord said:


> Plex already does this. All that it really takes is modifying the Javascript MPEG-DASH player I posted in the other thread (https://dash-mse-test.appspot.com) to understand the more advanced SegmentTemplate elements going on in the Plex MPEG-DASH XML.
> 
> I did some further testing, and as it happens there are better MPEG-DASH javascript players (dash-if.org) out there that natively understand the Plex MPEG-DASH xml (i.e. SegmentTemplates), but for whatever reason, it doesn't work (even with the same videos played on the mse-test site) in Opera on the Tivo, but works fine in Chrome. Since debugging is non-existent on the TiVo, I didn't spend much time trying to figure out why it didn't work, but it should also be possible to get it working.


Yeah, that's about as far as I was able to get before losing interest. Looks like we need to work out some kind of remote debugging framework. We can try trapping important functions in try/catch wrappers, then sending the error to a remote server.. OR...jsfiddle uses something called weinre to pull off debugging clients like phones remotely. Maybe that'd work on TiVo's Opera environment as well.


----------



## ntlord

Any change on this with the latest updates, or is the RPC app launch still dead?


----------



## moyekj

ntlord said:


> Any change on this with the latest updates, or is the RPC app launch still dead?


 Got 20.4.2 today on my Roamio Pro and unsurprisingly confirmed it's same "Not Allowed" message being returned.


----------



## moyekj

Reviving this old thread just to say I happened to try launching an arbitrary HTML page via RPC again and it now works again!


----------

