lucasgonze
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2011
06:14 PM
Re: External Control of Netflix channel?
I have posted a version of the MOG Roku channel with support for ECP to the private channel for our betas. You can pick up the beta at https://owner.roku.com/add/mogbeta2 . This is a total hack job and I'm relying on the community to QA it.
app id="2049" version="1.82.0"
You must be logged in before using MOG via ECP. To do that use the app normally, in manual mode.
This takes up to 20 track IDs, plays them, and exits. Supply track IDs with the syntax trackID, trackID1, ..., trackID20
Given a Roku on 192.168.0.208, the playlist at http://mog.com/playlists/499366 will play on your Roku if you POST to
http://192.168.0.208:8060/launch/2049?t ... D10=302939
app id="2049" version="1.82.0"
You must be logged in before using MOG via ECP. To do that use the app normally, in manual mode.
This takes up to 20 track IDs, plays them, and exits. Supply track IDs with the syntax trackID, trackID1, ..., trackID20
Given a Roku on 192.168.0.208, the playlist at http://mog.com/playlists/499366 will play on your Roku if you POST to
http://192.168.0.208:8060/launch/2049?t ... D10=302939
lucasgonze
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2011
06:15 PM
Re: External Control of Netflix channel?
"whaleface" wrote:
lurking with interest over here. btw lucasgonze, since I'm assuming you are one of MOG's channel developers, thanks for tracking this forum post down. I'm excited to see if you manage to get something working.
You're welcome, whaleface.
I'm counting on you to actually put the thing to use!
whaleface
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2011
11:51 PM
Re: External Control of Netflix channel?
"lucasgonze" wrote:
I have posted a version of the MOG Roku channel with support for ECP to the private channel for our betas. You can pick up the beta at https://owner.roku.com/add/mogbeta2 . This is a total hack job and I'm relying on the community to QA it.
app id="2049" version="1.82.0"
You must be logged in before using MOG via ECP. To do that use the app normally, in manual mode.
This takes up to 20 track IDs, plays them, and exits. Supply track IDs with the syntax trackID, trackID1, ..., trackID20
Given a Roku on 192.168.0.208, the playlist at http://mog.com/playlists/499366 will play on your Roku if you POST to
http://192.168.0.208:8060/launch/2049?t ... D10=302939
wow, that was fast. it sounds totally cool, got the beta installed and I'm going to give it a shot this weekend and see what I can get going. thanks again!
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2011
11:56 PM
Re: External Control of Netflix channel?
"lucasgonze" wrote:
Is there an ECP controller I can use for testing? Anybody have a generic web form or precompiled OS X binary?
How about a Python snippet? I use this:
import httplib
def ecp_invoke(op, path):
conn = httplib.HTTPConnection(ROKU_IP, 8060)
conn.request(op, path)
r = conn.getresponse()
res = r.read() if r.status==200 else '%d %s' % (r.status, r.reason)
conn.close()
return res
launch = lambda appID, params='': ecp_invoke('POST', '/launch/%s?%s'%(appID,params))
get_app_list = lambda: ecp_invoke('GET', '/query/apps')
keypress = lambda key: ecp_invoke('POST', '/keypress/' + key)
keydown = lambda key: ecp_invoke('POST', '/keydown/' + key)
keyup = lambda key: ecp_invoke('POST', '/keyup/' + key)
Then you'd start an app with
launch('2049', 'trackID=5639969')
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2011
12:15 AM
Re: External Control of Netflix channel?
"lucasgonze" wrote:
This takes up to 20 track IDs, plays them, and exits. Supply track IDs with the syntax trackID, trackID1, ..., trackID20. Given a Roku on 192.168.0.208, the playlist at http://mog.com/playlists/499366 will play on your Roku if you POST to
http://192.168.0.208:8060/launch/2049?t ... D10=302939
May i recommend a simpler API? instead of having 20 parameters trackID#, have only one - and pass list of the track numbers to be played in order. This will shorten the URL (potentially providing for more #) and remove arbitrary limit of 20 (probably will simplify your code too). The track IDs can be seprated with spaces, which gets URLencoded to `+`, so it will look neat in the form of "?trackIDs=111+222+333+444". Inside the channel code you will receive string that needs to be split on spaces.
Here is illustration: instead of
http://192.168.0.208:8060/launch/2049?trackID=5639969&trackID1=13203815&trackID2=18362895&trackID3=10936097&trackID4=287941&trackID5=539503&trackID6=34731947&trackID7=9046631&trackID8=9925193&trackID9=302937&trackID10=302939
(224 chars) call like so (133 chars)
http://192.168.0.208:8060/launch/2049?trackIDs=5639969+13203815+18362895+10936097+287941+539503+34731947+9046631+9925193+302937+302939
lucasgonze
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2011
09:32 AM
Re: External Control of Netflix channel?
EnTerr, the way I got this done so quickly was that I happened to have a slice of free time right when this topic came up. But today I'm busy again. So if you can help get the code written for the new arg style I'm happy to make the change (or support both argument styles for the sake of "legacy" code).
My current source code is here: http://pastebin.com/n6v6VCPT
My current source code is here: http://pastebin.com/n6v6VCPT
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2011
03:05 PM
Re: External Control of Netflix channel?
"lucasgonze" wrote:
EnTerr, the way I got this done so quickly was that I happened to have a slice of free time right when this topic came up. But today I'm busy again. So if you can help get the code written for the new arg style I'm happy to make the change (or support both argument styles for the sake of "legacy" code).
My current source code is here: http://pastebin.com/n6v6VCPT
Ok, how about this (oops, i pasted it in pasta-bin too):
if( params["trackIDs"] <> invalid ) then
tidStr = params["trackIDs"] + " " 'extra space to simplify handling in loop
playlist = []
i = instr(1, tidStr, " ")
while i>0
digested = ecp_digest_trackID(left(tidStr, i-1))
if( digested <> invalid ) playlist.push(digested)
tidStr = mid(tidStr, i+1)
i = instr(1, tidStr, " ")
end while
end if

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2011
04:51 PM
Re: External Control of Netflix channel?
"EnTerr" wrote:"lucasgonze" wrote:
EnTerr, the way I got this done so quickly was that I happened to have a slice of free time right when this topic came up. But today I'm busy again. So if you can help get the code written for the new arg style I'm happy to make the change (or support both argument styles for the sake of "legacy" code).
My current source code is here: http://pastebin.com/n6v6VCPT
Ok, how about this (oops, i pasted it in pasta-bin too):
if( params["trackIDs"] <> invalid ) then
tidStr = params["trackIDs"] + " " 'extra space to simplify handling in loop
playlist = []
i = instr(1, tidStr, " ")
while i>0
digested = ecp_digest_trackID(left(tidStr, i-1))
if( digested <> invalid ) playlist.push(digested)
tidStr = mid(tidStr, i+1)
i = instr(1, tidStr, " ")
end while
end if
That can be simplified greatly...
if( params["trackIDs"] <> invalid ) then
playlist = params["trackIDs"].Tokenize(" ")
end if
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
lucasgonze
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2011
06:24 PM
Re: External Control of Netflix channel?
I have published a new version that supports a spaces-separated list sent to an argument named trackIDs.
This is not backwards compatible with the first version. The arguments trackID, trackID1, ..., trackID20 don't work any more.
This is not backwards compatible with the first version. The arguments trackID, trackID1, ..., trackID20 don't work any more.
lucasgonze
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2011
10:32 PM
Re: External Control of Netflix channel?
And thanks for the incantations, EnTerr and TheEndless.
gonzotek, reading the remoku source was a big help. I appreciate the learning. In the end I used hardcoded hack forms like this one, so that I could focus on just the brightscript: http://pastebin.com/8RryduUv
gonzotek, reading the remoku source was a big help. I appreciate the learning. In the end I used hardcoded hack forms like this one, so that I could focus on just the brightscript: http://pastebin.com/8RryduUv