示例#1
0
 def __init__(self):
     user = '******'
     token = 'ZjNlNzM0NzEtZWNkNC00MmI2LWJmNGUtZmJkNGQ4MzFmYjQx'
     self.__cove = coveapi.connect(base64.b64decode(user),
                                   base64.b64decode(token))
     self.__id = self.__cove_nova_id()
     self.__episodes = self.__cove_nova_episodes()
示例#2
0
from bs4 import BeautifulSoup, SoupStrainer

addon = xbmcaddon.Addon()
pluginHandle = int(sys.argv[1])

SITE = "pbs"
NAME = "PBS"
DESCRIPTION = "PBS and our member stations are America's largest classroom, the nation's largest stage for the arts and a trusted window to the world. In addition, PBS's educational media helps prepare children for success in school and opens up the world to them in an age-appropriate way."
SHOWS = "http://video.pbs.org/programs/list"
SWFURL = "http://www-tc.pbs.org/video/media/swf/PBSPlayer.swf?video=%s&player=viral"
CLOSEDCAPTION = "http://video.pbs.org/videoInfo/%s/?format=jsonp&callback=video_info"
KEY = "RnJlZUNhYmxlLTgxMzQyMmE5LTg0YWMtNDdjYy1iYzVhLTliMDZhY2NlM2I2YQ=="
SECRET = "MDEyYzcxMDgtNWJiNS00YmFlLWI1MWYtMDRkMTIzNGZjZWRk"
TYPES = ["Episode", "Segment", "Clip", "Promotion", "Interstitial", "Other"]

cove = coveapi.connect(base64.b64decode(KEY), base64.b64decode(SECRET))


def masterlist():
    master_start = 0
    master_count = 200
    master_db = []
    master_dict = {}
    master_check = []
    master_menu = simplejson.loads(
        connection.getURL(SHOWS, header={'X-Requested-With':
                                         'XMLHttpRequest'}))
    for master_item in master_menu.itervalues():
        for master_item in master_item:
            master_check.append(master_item['title'])
    while master_start < master_count:
示例#3
0
import xbmc, xbmcgui, xbmcplugin, urllib2, urllib, re, base64, string, sys, os, traceback, time, xbmcaddon, datetime, coveapi
from urllib2 import Request, urlopen, URLError, HTTPError 

__plugin__ = "PBS"
__author__ = 'stacked <*****@*****.**>'
__url__ = 'http://code.google.com/p/plugin/'
__date__ = '06-26-2012'
__version__ = '2.0.1'
__settings__ = xbmcaddon.Addon( id = 'plugin.video.pbs' )

programs_thumb = os.path.join( __settings__.getAddonInfo( 'path' ), 'resources', 'media', 'programs.png' )
topics_thumb = os.path.join( __settings__.getAddonInfo( 'path' ), 'resources', 'media', 'topics.png' )
search_thumb = os.path.join( __settings__.getAddonInfo( 'path' ), 'resources', 'media', 'search.png' )
next_thumb = os.path.join( __settings__.getAddonInfo( 'path' ), 'resources', 'media', 'next.png' )
fanart = os.path.join( __settings__.getAddonInfo( 'path' ), 'fanart.jpg' )
cove = coveapi.connect(base64.b64decode(__settings__.getLocalizedString( 30010 )), 
                       base64.b64decode(__settings__.getLocalizedString( 30011 )))
				
def open_url( url ):
	print 'PBS - URL: ' + url
	retries = 0
	while retries < 4:
		try:
			req = urllib2.Request( url )
			content = urllib2.urlopen( req )
			data = content.read()
			content.close()
			return data
		except HTTPError,e:
			print 'PBS - Error code: ', e.code
			if e.code == 404:
				dialog = xbmcgui.Dialog()
示例#4
0
文件: pbs.py 项目: MarkTV/MarkTV
from bs4 import BeautifulSoup, SoupStrainer

addon = xbmcaddon.Addon()
pluginHandle = int (sys.argv[1])

SITE = "pbs"
NAME = "PBS"
DESCRIPTION = "PBS and our member stations are America's largest classroom, the nation's largest stage for the arts and a trusted window to the world. In addition, PBS's educational media helps prepare children for success in school and opens up the world to them in an age-appropriate way."
SHOWS = "http://video.pbs.org/programs/list"
SWFURL = "http://www-tc.pbs.org/video/media/swf/PBSPlayer.swf?video=%s&player=viral"
CLOSEDCAPTION = "http://video.pbs.org/videoInfo/%s/?format=jsonp&callback=video_info"
KEY = "RnJlZUNhYmxlLTgxMzQyMmE5LTg0YWMtNDdjYy1iYzVhLTliMDZhY2NlM2I2YQ=="
SECRET = "MDEyYzcxMDgtNWJiNS00YmFlLWI1MWYtMDRkMTIzNGZjZWRk"
TYPES = ["Episode", "Segment", "Clip", "Promotion", "Interstitial", "Other"]

cove = coveapi.connect(base64.b64decode(KEY), base64.b64decode(SECRET))

def masterlist():
	master_start = 0
	master_count = 200
	master_db = []
	master_dict = {}
	master_check = []
	master_menu = simplejson.loads(connection.getURL(SHOWS, header = {'X-Requested-With' : 'XMLHttpRequest'}))
	for master_item in master_menu.itervalues():
		for master_item in master_item:
			master_check.append(master_item['title'])
	while master_start < master_count:
		master_data = cove.programs.filter(fields = 'mediafiles', order_by = 'title', limit_start = master_start)
		master_menu = master_data['results']
		master_count = master_data['count']
示例#5
0
文件: pbs.py 项目: lukewiersma/redcop
import re
import base64

from BeautifulSoup import BeautifulSoup
from BeautifulSoup import BeautifulStoneSoup
#import demjson
import resources.lib._common as common

import coveapi

pluginhandle = int(sys.argv[1])

key = 'RnJlZUNhYmxlLTgxMzQyMmE5LTg0YWMtNDdjYy1iYzVhLTliMDZhY2NlM2I2YQ=='
secret = 'MDEyYzcxMDgtNWJiNS00YmFlLWI1MWYtMDRkMTIzNGZjZWRk'

cove = coveapi.connect(base64.b64decode(key), base64.b64decode(secret))


def masterlist():
    return rootlist(db=True)


def rootlist(db=False):
    start = 0
    count = 200
    db_shows = []
    while start < count:
        data = cove.programs.filter(filter_producer__name='PBS',
                                    order_by='title',
                                    limit_start=start)
        results = data['results']
示例#6
0
import re
import base64

from BeautifulSoup import BeautifulSoup
from BeautifulSoup import BeautifulStoneSoup
#import demjson
import resources.lib._common as common

import coveapi

pluginhandle = int (sys.argv[1])

key='RnJlZUNhYmxlLTgxMzQyMmE5LTg0YWMtNDdjYy1iYzVhLTliMDZhY2NlM2I2YQ=='
secret='MDEyYzcxMDgtNWJiNS00YmFlLWI1MWYtMDRkMTIzNGZjZWRk'

cove = coveapi.connect( base64.b64decode(key), base64.b64decode(secret) )

def masterlist():
    return rootlist(db=True)

def rootlist(db=False):
    start = 0
    count = 200
    db_shows = []
    while start < count:
        data = cove.programs.filter(filter_producer__name='KIDS',order_by='title',limit_start=start)
        results = data['results']
        count = data['count']
        stop = data['stop']
        del data
        for result in results: