View Full Version : [release] bxsh (BoXee SHell) ...Python implementation of Remote API.
agentlame
April 17th, 2010, 04:17 PM
So, based on this thread: http://forum.boxee.tv/showthread.php?t=17614, I thought it would be fun to build a shell for Boxee.
Few reasons for my motivation:
1. I have never used Boxee's Remote API, and wanted to learn it.
2. I'm a geek and a terminal freak, so I thought it would be neat to have this.
3. I thought it would be nice for everyone to have a reference implementation of the Remote API in Python.
This is a VERY basic first go. I wrote most of it this afternoon. This is quick and dirty, some commands are not supported (sending ASCII keys and getKeyboardText)
Most of the code is documented, and you can set debug = True to print each step in detail.
You can get it here: http://dl.dropbox.com/u/169651/.share/bxsh.py
Enjoy,
Neil
gregms
April 17th, 2010, 07:59 PM
Very interesting concept.
Unsure I like typing "SendKey(270)" for only going up once, but again, could have good potential. I prefer "Up"
I'll be interested to see where this goes.
Yay for Shell!
agentlame
April 17th, 2010, 08:07 PM
Of course, I plan to alias up, down, left, right and back. This was just about a working concept. :)
One AWESOME advantage I found was that you can type SeekPercentage(<some percent of 100>) and it will skip to that percent in the playing media. This also works on streaming media. So, you can resume a video from TWiT, to say the middle, by: SeekPercentage(50). Handy.
The other thing I plan to add is that you can place the command parameter after a space. (IE: SeekPercentage(50) becomes SeekPercentage 50.)
EDIT:
Just to be clear, this is more of a thought experiment and a Python demo of the Remote API. It is not something I really expect people to use. If I thought it would have taken more than a Saturday afternoon to write, I wouldn't have bothered. Luckily, it was as simple as I had hoped.
DPK
April 18th, 2010, 09:01 AM
sharedKey = 'b0xeeRem0tE!' # Really?
lol, nice commenting Neil. :D
Overall very well done and thanks for doing this. You can bet it will come in handy at some point for someone who is curious about the remote api since it really isn't all that utilized yet.
agentlame
April 18th, 2010, 11:20 AM
sharedKey = 'b0xeeRem0tE!' # Really?
lol, nice commenting Neil. :D
:D I knew someone would enjoy that.
There is a similar one in MF:
'''
This is not used anywhere in the code,
but I'm leaving it because it is Boxee Box in 1337 speak;
and, that is just awesome.
# Mediafly shared secret. #
sharedSecret = 'b0x33b0x'
'''
It serves the same purpose (salting an MD5 hash) but their API doesn't even use it.
cuve
April 19th, 2010, 06:59 AM
Nice!
I'm probably not gonna use it right away, but it's good the know it exists ;)
Little remark on your code, you often do this:
if debug:
print 'shizzle ma knizzle'
I'd rather do something like this:
debug('debug shizzle')
def debug(stuff):
if debug:
print stuff
return
Ofcourse it's really up to you, but that's what I would do :)
agentlame
April 22nd, 2010, 10:48 AM
...Ofcourse it's really up to you, but that's what I would do :)
You're 100% right. I normally wrap debugging in a method in my Boxee apps, I don't know why I didn't. I think it was a product of how the code grew, trying to get everything to work.
Good catch, thanks.
Powered by vBulletin® Version 4.1.12 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.