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

  Thread Rating:
  • 3 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
divingmule Offline
Posting Freak
Posts: 1,278
Joined: Oct 2008
Reputation: 54
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: 82
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
Posting Freak
Posts: 1,278
Joined: Oct 2008
Reputation: 54
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
theophile Offline
Fan
Posts: 569
Joined: Jan 2009
Reputation: 30
Post: #16
divingmule Wrote:Yeah, from what bartsidee posted earlier, under the 'class Listmc'. I'm guessing something like this.
http://paste.ubuntu.com/584109/

divingmule, have you gotten this to work?
find quote
divingmule Offline
Posting Freak
Posts: 1,278
Joined: Oct 2008
Reputation: 54
Post: #17
Hi, I just installed the plugin ,was under the impression that I would haft to have a MLB account. Looks like I had some tabs mixed with spaces in setContentUrl. Fixed that and added the import beautifulsoup. The plugin starts but the buttons don't seem to work. From my log:
Code:
15:09:34 T:3556 M:2629337088   ERROR: ADDON::CSkinInfo::TranslateResolution invalid resolution specified for
15:09:34 T:3464 M:2629066752 WARNING: Skin has invalid include: Window_Fade_Animation
15:15:09 T:3464 M:2605064192 WARNING: Previous line repeats 1 times.
15:15:09 T:3464 M:2605064192 WARNING: XFILE::CVideoDatabaseDirectory::GetLabel - Unknown nodetype requested 0
15:15:09 T:3556 M:2604826624   ERROR: Error Type: exceptions.AttributeError
15:15:09 T:3556 M:2604826624   ERROR: Error Contents: onFocus
15:15:09 T:3556 M:2604826624   ERROR: AttributeError: onFocus

Here is the fixed mc.py - http://ubuntuone.com/p/jIk/
find quote
Luds Offline
Junior Member
Posts: 11
Joined: Mar 2011
Reputation: 0
Post: #18
It would be fantastic to get this for the upcoming season!
find quote
groty Offline
Junior Member
Posts: 8
Joined: Jan 2010
Reputation: 0
Post: #19
Please keep this alive. I've been waiting for a working MLB.tv plugin for my XBMC XBox. I have no experience developing for XBMC though.
find quote
theophile Offline
Fan
Posts: 569
Joined: Jan 2009
Reputation: 30
Post: #20
Updated the repo with the new mc.py from divingmule. I'm not sure whether the update is supposed to be noticeable, but there it is.

Divingmule, you'll probably need an MLB.TV account once we start working on the actual streams, but I don't think you need one for basic functionality of the schedule, calendar, and standings.

Does your mc.py get content to load for you?
find quote
Post Reply