[WIP] MLB.TV Boxee App port (developers needed!)

  Thread Rating:
  • 3 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
theophile Offline
Fan
Posts: 569
Joined: Jan 2009
Reputation: 30
Post: #1
6/28 UPDATE
This project started as an attempt to port the Boxee app, but evolved into a new, native addon by divingmule based on mlbviewer. If you've come here because you want to watch baseball on XBMC, visit the MLBMC addon release thread here:

http://forum.xbmc.org/showthread.php?tid=104391

The rest of this post remains for historical purposes, or in case anyone feels like continuing the task of porting the Boxee app. The discussion in this thread shifts to divingmule's addon beginning just before page 5.



OUTDATED INFO BELOW
========================================================

Going out on a limb, here. Thanks to the excellent work of bartsidee, XBMC now has an mc module that greatly facilitates running Boxee apps in XBMC. So I've started trying to port the MLB.TV app to XBMC.

The result is a video plugin that loads, but doesn't actually work (yet). I need some experienced plugin developers to take a look at this and tell me whether this project has any hope of success. I'm not a developer, just a fan, so I may already be in over my head. If you could take a look and reply with your thoughts, I'd really appreciate it. Thanks!

Now on GitHub:
https://github.com/theophile/plugin.video.mlbtv/

What Works:
  • Plugin loads
  • Aesthetic elements all appear to be visible, buttons mostly work

What Doesn't:
  • Everything else

TODO:
  • Get schedule, calendar, and standings to populate with content (see this post for details)
  • Move settings (i.e. username/password) to XBMC database instead of Boxee servers
(This post was last modified: 2011-06-28 20:48 by theophile.)
find quote
theophile Offline
Fan
Posts: 569
Joined: Jan 2009
Reputation: 30
Post: #2
Screenshots

Development Version 0.2
[Image: 0_screenshot000.png]
main.py

[Image: b_screenshot001.png]
calendar.py

[Image: 5_screenshot002.png]
standings.py
(This post was last modified: 2011-03-20 16:18 by theophile.)
find quote
rbrohman Offline
Senior Member
Posts: 293
Joined: Jan 2010
Reputation: 1
Location: Kitchener, ON
Post: #3
Great start - thanks for taking this on!

I can't help with the coding, but if you setup a donation account I'll help with the beer. Smile
find quote
theophile Offline
Fan
Posts: 569
Joined: Jan 2009
Reputation: 30
Post: #4
Some code changes by bartsidee resulted in working buttons, for the most part. He has also shed some light on what must be done to get content to appear:
bartsidee Wrote:Now the app hangs on this function:
Code:
mc.GetActiveWindow().GetList(121).SetContentURL(url)

The last part SetContentURL is not supported in my API yet. What it does is retreive a rss file and convert it into a Boxee list. To get the correct errors you sometimes have to remove the try/except functions in mlb.py

You can try to build it yourself, you have to convert the rss file to a python object using xmltree or something. And then systematically convert the items to an XBMC list. You can get some inspiration from within the mc file.

Is anyone willing to give this a shot? Alternately, if it's easier, it might be possible to avoid using the Boxee RSS entirely and use portions of mlbviewer to get schedule information.
find quote
divingmule Offline
Skilled Python Coder
Posts: 1,297
Joined: Oct 2008
Reputation: 61
Post: #5
Hi, can you post a link or example of said rss file.
find quote
bartsidee Offline
Junior Member
Posts: 27
Joined: Sep 2010
Reputation: 0
Post: #6
Infact the rss shouldn't be that hard to implent I think, unfortuatly i do not have that much time.

You can find the specs here:
http://developer.boxee.tv/RSS_Specification

And have a look at a example here:
http://developer.boxee.tv/LibraryExample

The 'SetContentURL' functions should be added to the class Listmc in mc.py. See also:
https://github.com/bartsidee/Bartsidee-R...mc.py#L281
(This post was last modified: 2011-03-20 17:22 by bartsidee.)
find quote
theophile Offline
Fan
Posts: 569
Joined: Jan 2009
Reputation: 30
Post: #7
divingmule Wrote:Hi, can you post a link or example of said rss file.

In addition to the examples posted above, the two referenced in mlb.py are these:

rss://dir.boxee.tv/apps/mlb/feed/calendar
rss://dir.boxee.tv/apps/mlb/feed/%Y/%m (where %Y is the 4-digit year and %m is the 2-digit month)

As a side note, would it be easier/better if I set this project up on Google Code or Github?
find quote
divingmule Offline
Skilled Python Coder
Posts: 1,297
Joined: Oct 2008
Reputation: 61
Post: #8
As I expected, this is mostly above my skill level.

Usually for a plugin I would do something like this for the calendar rss.xml.
Code:
import urllib2,urllib
from BeautifulSoup import BeautifulStoneSoup

url='http://dir.boxee.tv/apps/mlb/feed/2011/07'
req = urllib2.Request(url)
response = urllib2.urlopen(req)
link=response.read()
response.close()
soup = BeautifulStoneSoup(link, convertEntities=BeautifulStoneSoup.XML_ENTITIES)
items = soup('item')
for item in items:
    try:
        title = item.title.string
    except:
        title = ''
    try:
        link = item.link.string
    except:
        link = ''
    try:
        description = item.description.string
    except:
        description = ''
    try:
        print(title,link,description)
    except:
        pass

Do we need to define all the elements from the Boxee RSS Specification?

I may be more trouble than helpSmile
find quote
bartsidee Offline
Junior Member
Posts: 27
Joined: Sep 2010
Reputation: 0
Post: #9
Correct should be something like that. For completion of the api , it would be nice if most of the specification is supported. But to get the app working you can probably do less.


Code:
<title>29</title>
<link>2011:03:29</link>
<description>18 Games</description>
<boxee:property name="custom:display">1</boxee:property>

Title, link and discripton can be tackled with:
Code:
try:
        link = item.link.string
    except:
        link = ''

But the custom property tag is different. You have to get the value and the custom id tag.
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 26,221
Joined: Oct 2003
Reputation: 178
Post: #10
I believe there may be some code in our rss directory reader to handle boxee rss feeds - possibly no help to you at the moment given that the vfs module isn't hooked up though.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
divingmule Offline
Skilled Python Coder
Posts: 1,297
Joined: Oct 2008
Reputation: 61
Post: #11
I'm not really sure about adding this to the api or the names I've chosen. Here is what I've done so far.
Code:
import urllib2,urllib
from BeautifulSoup import BeautifulStoneSoup

#file = 'C://boxee-library.xml'
url='http://dir.boxee.tv/apps/mlb/feed/2011/07'
req = urllib2.Request(url)
#response = open(file, 'rb')
response = urllib2.urlopen(req)
link=response.read()
response.close()
soup = BeautifulStoneSoup(link, convertEntities=BeautifulStoneSoup.XML_ENTITIES)
channel = soup.channel.title.string
channel_link = soup.channel.link.string
channel_description = soup.channel.description.string
try:
    channel_image = soup.channel.image.string
except:
    channel_image = ''
channel_language = soup.channel.language.string
try:
    channel_expiry = soup.channel('boxee:expiry')[0].string
except:
    channel_expiry = ''
items = soup('item')
for item in items:
    try:
        title = item.title.string
    except:
        title = ''
    try:
        link = item.link.string
    except:
        link = ''
    try:
        guid = item.guid.string
    except:
        guid = ''
    try:
        description = item.description.string
    except:
        description = ''
    try:
        custom_display = item('boxee:property',attrs={'name' : "custom:display"})[0].string
    except:
        custom_display = ''
    try:
        custom_myteam = item('boxee:property', attrs={'name' : "custom:myteam"})[0].string
    except:
        custom_myteam = ''
    try:
        thumbnail = item('media:thumbnail')[0]['url']
    except:
        thumbnail = ''
    try:
        genre = item('media:category', attrs={'scheme' : 'urn:boxee:genre'})[0].string
    except:
        genre = ''
    try:
        media_type = item('boxee:media-type')[0]['type']
    except:
        media_type = ''
    try:
        release_date = item('boxee:release-date')[0].string
    except:
        release_date = ''
    try:
        episode = item('media:category', attrs={'scheme' : "urn:boxee:episode"})[0].string
    except:
        episode = ''
    try:
        season = item('media:category', attrs={'scheme' : "urn:boxee:season"})[0].string
    except:
        season = ''
    try:
        media_url = item('media:content')[0]['url']
    except:
        media_url = ''
    try:
        media_duration = item('media:content')[0]['duration']
    except:
        media_duration = ''
    try:
        media_type = item('media:content')[0]['type']
    except:
        media_type = ''
    try:
        media_height = item('media:content')[0]['height']
    except:
        media_height = ''
    try:
        media_width = item('media:content')[0]['width']
    except:
        media_width = ''
    try:
        media_lang = item('media:content')[0]['lang']
    except:
        media_lang = ''

Hope this helps.
find quote
luger Offline
Member
Posts: 95
Joined: Apr 2010
Reputation: 0
Post: #12
While I can't lend any expertise to this project, I'd definitely donate some money for coffee/beer as well to those who are working on it.
find quote
theophile Offline
Fan
Posts: 569
Joined: Jan 2009
Reputation: 30
Post: #13
divingmule, that would be added to mc.py, correct?

And I've now set up this project on GitHub. I've used 'git pull' countless times, but never 'git push,' so hopefully I'll be able to learn as we go. Looking forward to seeing some commit requests!
find quote
divingmule Offline
Skilled Python Coder
Posts: 1,297
Joined: Oct 2008
Reputation: 61
Post: #14
Yeah, from what bartsidee posted earlier, under the 'class Listmc'. I'm guessing something like this.
http://paste.ubuntu.com/584109/
find quote
bartsidee Offline
Junior Member
Posts: 27
Joined: Sep 2010
Reputation: 0
Post: #15
you have to make sure to pass the 'url' variable:

Code:
SetContentURL(url):
find quote
Post Reply