Esempio n. 1
0
def sp_seasons(url=common.args.url):
    for sn in range(1,17):
        sn = str(sn)
        name = 'Season '+sn
        url = sn
        common.addDirectory(name,'comedy','sp_episodes',url)
    common.setView('seasons')
Esempio n. 2
0
def showsubcats(url=common.args.url):
    #Add season options
    data = common.getURL(url)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    subs=tree.find(attrs={'class':'group-a'}).findAll('a')
    for sub in subs:
        name = sub.string
        url = sub['href']
        if BASE not in url:
            url = BASE + url
        if name == None:
            name = sub.contents[-1]
        if 'Episodes' in name or 'Clips' in name or 'Peeks' in name or 'Watch' in name or 'Video' in name:
            if 'id=' in url:
                u = sys.argv[0]
                u += '?url="'+urllib.quote_plus(url)+'"'
                u += '&mode="vh1"'
                u += '&sitemode="playurl"'
                item=xbmcgui.ListItem(name)
                item.setInfo( type="Video", infoLabels={ "Title":name })
                item.setProperty('IsPlayable', 'true')
                xbmcplugin.addDirectoryItem(pluginhandle,url=u,listitem=item,isFolder=False)
            else:
                common.addDirectory(name,'vh1','videos',url)
    common.setView('seasons')
Esempio n. 3
0
def show(url=common.args.url):
    data = common.getURL(url)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    sections=tree.find('ul',attrs={'class':'channel-list'})
    if sections:
        sections = sections.findAll('li',recursive=False)
        for section in sections:
            name = section.find('h4').contents[1].strip()
            if common.args.name in name and common.args.name <> name:
                name = name.replace(common.args.name,'').strip().strip('-').strip(',').strip()
            url = section.find('a')['href']
            if 'http://' not in url:
                url = BASE+url
            common.addDirectory(name, 'hgtv', 'videos', url)
        common.setView('seasons')
    else:
        xml_url=getShowXML_URL(data)
        if xml_url:
            videos(xml_url=xml_url)
        else:
            backup_url = tree.find('ul', attrs={'class' : "button-nav"})
            if backup_url:
                if len(backup_url) > 2:
                    show(backup_url.findAll('a')[1]['href'])
            else:
                backup2_url = tree.find('li', attrs={'class' : "tab-past-season"})
                if backup2_url:
                    show(backup2_url.a['href'])
Esempio n. 4
0
def shows(url=common.args.url,db=False):
    data = common.getURL(showlist)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    menu = tree.find('div',attrs={'id':'accordion','class':'view-content'}).findAll('h3')
    names = []
    for item in menu:
        name = item.find('a',attrs={'href':'#'}).string
        names.append(name)
    if db == False:
        marker = names.index(url)
    elif db == True:
        marker = names.index('Current Shows')
    menu = tree.find('div',attrs={'id':'accordion','class':'view-content'})
    shows = menu.findAll('div',recursive=False)[marker].findAll('li')
    dbshows = []
    for show in shows:
        showdata = show.findAll(attrs={'class':'field-content'})
        name = showdata[0].a.string
        showid = showdata[1].string
        if db == False:
            if 'Movies' in common.args.name:
                common.addDirectory(name, 'lifetime', 'showroot', showid)
            else:
                common.addShow(name, 'lifetime', 'showroot', showid)
        elif db == True:
            dbshows.append((name, 'lifetime', 'showroot', showid))
    if db == True:
        return dbshows
    else:
        common.setView('tvshows')
Esempio n. 5
0
def listCatType(url,db,showtype=True):
    data = common.getURL(url)
    db_shows=[]
    if data:
        items = demjson.decode(data)['Entries']
        for item in items:
            show_id=str(item['ID'])
            name=item['Name']
            if db==True:
                db_shows.append((name, 'crackle', 'showroot', show_id))
            else:
                if showtype:
                    common.addShow(name, 'crackle', 'showroot', show_id)
                else:
                    plot=item['Description']
                    genre=item['Genre'] 
                    thumb=item['ChannelArtTileLarge'] 
                    fanart=item['ChannelArtLandscape']
                    common.addDirectory(name, 'crackle', 'showroot', show_id, thumb, '', plot, '',genre)
    if db==True:
        return db_shows
    elif showtype:
        common.setView('tvshows')
    else:
        common.setView('seasons')
Esempio n. 6
0
def show(url=common.args.url):
    data = common.getURL(url)
    tree = BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    sections = tree.find('ul', attrs={'class': 'channel-list'})
    if sections:
        sections = sections.findAll('li', recursive=False)
        for section in sections:
            name = section.find('h4').contents[1].strip()
            if common.args.name in name and common.args.name <> name:
                name = name.replace(common.args.name,
                                    '').strip().strip('-').strip(',').strip()
            url = section.find('a')['href']
            if 'http://' not in url:
                url = BASE + url
            common.addDirectory(name, 'hgtv', 'videos', url)
        common.setView('seasons')
    else:
        xml_url = getShowXML_URL(data)
        if xml_url:
            videos(xml_url=xml_url)
        else:
            backup_url = tree.find('ul', attrs={'class': "button-nav"})
            if backup_url:
                if len(backup_url) > 2:
                    show(backup_url.findAll('a')[1]['href'])
            else:
                backup2_url = tree.find('li',
                                        attrs={'class': "tab-past-season"})
                if backup2_url:
                    show(backup2_url.a['href'])
Esempio n. 7
0
def shows(url=common.args.url,db=False):
    data = common.getURL(showlist)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    menu = tree.find('div',attrs={'id':'accordion','class':'view-content'}).findAll('h3')
    names = []
    for item in menu:
        name = item.find('a',attrs={'href':'#'}).string
        names.append(name)
    if db == False:
        marker = names.index(url)
    elif db == True:
        marker = names.index('Current Shows')
    menu = tree.find('div',attrs={'id':'accordion','class':'view-content'})
    shows = menu.findAll('div',recursive=False)[marker].findAll('li')
    dbshows = []
    for show in shows:
        showdata = show.findAll(attrs={'class':'field-content'})
        name = showdata[0].a.string
        showid = showdata[1].string
        if db == False:
            if 'Movies' in common.args.name:
                common.addDirectory(name, 'lifetime', 'showroot', showid)
            else:
                common.addShow(name, 'lifetime', 'showroot', showid)
        elif db == True:
            dbshows.append((name, 'lifetime', 'showroot', showid))
    if db == True:
        return dbshows
    else:
        common.setView('tvshows')
Esempio n. 8
0
def listCatType(url, db, showtype=True):
    data = common.getURL(url)
    db_shows = []
    if data:
        items = demjson.decode(data)['Entries']
        for item in items:
            show_id = str(item['ID'])
            name = item['Name']
            if db == True:
                db_shows.append((name, 'crackle', 'showroot', show_id))
            else:
                if showtype:
                    common.addShow(name, 'crackle', 'showroot', show_id)
                else:
                    plot = item['Description']
                    genre = item['Genre']
                    thumb = item['ChannelArtTileLarge']
                    fanart = item['ChannelArtLandscape']
                    common.addDirectory(name, 'crackle', 'showroot', show_id,
                                        thumb, '', plot, '', genre)
    if db == True:
        return db_shows
    elif showtype:
        common.setView('tvshows')
    else:
        common.setView('seasons')
Esempio n. 9
0
def show_cats(url=common.args.url):
    data = common.getURL(url.replace(' ','%20'))
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    homedir = tree.find('div',attrs={'id':'video_home_dir','style':'display : none'}).string
    series_base  = 'http://www.aetv.com/minisite/videoajx.jsp'
    series_base += '?homedir='+homedir
    #full_series_url = series_url+'&pfilter=FULL%20EPISODES'
    #clips_series_url = series_url+'&pfilter=CLIPS'
    if homedir == '/lifestyle/' or homedir == '/classic/':
        series = url.split('=')[-1].replace(' ','%20')
        series_url = series_base + '&seriesfilter='+series
    else:
        series_url = series_base
    data = common.getURL(series_url)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    seasons = tree.find('div',attrs={'id':'primary_filter'}).findAll('li',attrs={'class':None})
    if len(seasons) > 0:
        for season in seasons:
            link = season.find('a')
            if '?' in series_base:
                season_url = series_base + '&pfilter='+link.string.strip().replace(' ','%20')
            else:
                season_url = series_base + '?pfilter='+link.string.strip().replace(' ','%20')
            if homedir == '/lifestyle/' or homedir == '/classic/':
                series = url.split('=')[-1].replace(' ','%20')
                season_url += '&seriesfilter='+series
            common.addDirectory(link.string.title(), 'aetv', 'showseasonThePlatform', season_url)
        xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL)
        common.setView('seasons')
    else:
        showseasonThePlatform(url.replace(' ','%20'),tree=tree)
    common.setView('seasons')
Esempio n. 10
0
def sp_seasons(url=common.args.url):
    for sn in range(1, 17):
        sn = str(sn)
        name = 'Season ' + sn
        url = sn
        common.addDirectory(name, 'comedy', 'sp_episodes', url)
    common.setView('seasons')
Esempio n. 11
0
def seasonOptions(url=common.args.url):
    common.addDirectory('All Videos','vh1','videos',url)
    common.addDirectory('Full Episodes','vh1','videos',url+'fulleps')
    common.addDirectory('Bonus Clips','vh1','videos',url+'bonusclips')
    common.addDirectory('After Shows','vh1','videos',url+'aftershows')
    common.addDirectory('Sneak Peeks','vh1','videos',url+'sneakpeeks')
    common.setView('seasons')
Esempio n. 12
0
def showsubcats(url=common.args.url):
    #Add season options
    data = common.getURL(url)
    tree = BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    subs = tree.find(attrs={'class': 'group-a'}).findAll('a')
    for sub in subs:
        name = sub.string
        url = sub['href']
        if BASE not in url:
            url = BASE + url
        if name == None:
            name = sub.contents[-1]
        if 'Episodes' in name or 'Clips' in name or 'Peeks' in name or 'Watch' in name or 'Video' in name:
            if 'id=' in url:
                u = sys.argv[0]
                u += '?url="' + urllib.quote_plus(url) + '"'
                u += '&mode="vh1"'
                u += '&sitemode="playurl"'
                item = xbmcgui.ListItem(name)
                item.setInfo(type="Video", infoLabels={"Title": name})
                item.setProperty('IsPlayable', 'true')
                xbmcplugin.addDirectoryItem(pluginhandle,
                                            url=u,
                                            listitem=item,
                                            isFolder=False)
            else:
                common.addDirectory(name, 'vh1', 'videos', url)
    common.setView('seasons')
Esempio n. 13
0
def seasonOptions(url=common.args.url):
    common.addDirectory('All Videos', 'vh1', 'videos', url)
    common.addDirectory('Full Episodes', 'vh1', 'videos', url + 'fulleps')
    common.addDirectory('Bonus Clips', 'vh1', 'videos', url + 'bonusclips')
    common.addDirectory('After Shows', 'vh1', 'videos', url + 'aftershows')
    common.addDirectory('Sneak Peeks', 'vh1', 'videos', url + 'sneakpeeks')
    common.setView('seasons')
Esempio n. 14
0
def showcats():
    data = common.getURL(BASE_URL)
    tree = BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    video_types = tree.find('select',
                            attrs={
                                'id': 'rb-video-browser-content_type'
                            }).findAll('option')
    shows = tree.find('select', attrs={
        'id': 'rb-video-browser-show'
    }).findAll('option')  #,attrs={'title':True})
    db_shows = []
    for show in shows:
        if show['value'] == common.args.url:
            cats = show['title'].replace('[',
                                         '').replace(']',
                                                     '').replace('"',
                                                                 '').split(',')
            for type in video_types:
                if type['value'] in cats:
                    name = type.string
                    url = 'rb-video-browser-num_items=100'
                    url += '&module_id_base=rb-video-browser'
                    url += '&rb-video-browser-show=' + show['value']
                    url += '&rb-video-browser-content_type=' + type['value']
                    common.addDirectory(name, 'amc', 'videos', url)
    common.setView('seasons')
Esempio n. 15
0
def showcats(url=common.args.url):
    data = common.getURL(url)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    cats=tree.findAll(attrs={'class' : re.compile('(.+?)videoCollectionModule(.+?)')})
    for cat in cats:
        name = cat.find('div',attrs={'class' : 'twocolumnheader'}).find('h3').string.title()
        common.addDirectory(name, 'abcfamily', 'videos', url) 
    common.setView('seasons')
Esempio n. 16
0
def show(url=common.args.url):
    data = common.getURL(url)
    tree = BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    menu = tree.find('div', attrs={'id': 'videotabs'}).findAll('li')
    for item in menu:
        itemurl = url + '<videotab>' + item['id'].replace('videotab_', '')
        name = item.find('p').string.split('(')[0].title()
        common.addDirectory(name, 'thecw', 'episodes', itemurl)
    common.setView('seasons')
Esempio n. 17
0
def show(url=common.args.url):
    data = common.getURL(url)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    menu=tree.find('div',attrs={'id':'videotabs'}).findAll('li')
    for item in menu:
        itemurl = url +'<videotab>'+ item['id'].replace('videotab_','')
        name = item.find('p').string.split('(')[0].title()
        common.addDirectory(name, 'thecw', 'episodes', itemurl)
    common.setView('seasons')
Esempio n. 18
0
def rootlist():
    data = common.getURL(showlist)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    menu = tree.find('div',attrs={'id':'accordion','class':'view-content'}).findAll('h3')
    for item in menu:
        name = item.find('a',attrs={'href':'#'}).string
        common.addDirectory(name, 'lifetime', 'shows', name )
    common.addDirectory('Full Movies', 'lifetime', 'movies', '')
    common.setView('seasons')
Esempio n. 19
0
def rootlist():
    data = common.getURL(showlist)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    menu = tree.find('div',attrs={'id':'accordion','class':'view-content'}).findAll('h3')
    for item in menu:
        name = item.find('a',attrs={'href':'#'}).string
        common.addDirectory(name, 'lifetime', 'shows', name )
    common.addDirectory('Full Movies', 'lifetime', 'movies', '')
    common.setView('seasons')
Esempio n. 20
0
def rootlist():
    data = common.getURL(BASE_URL)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    menu=tree.find(attrs={'id' : 'daypart_nav'})
    categories=menu.findAll('a')
    for item in categories:
        catid = item['onclick'].replace("showDaypart('",'').replace("');",'')
        name = catid.title()
        common.addDirectory(name, 'cbs', 'shows', catid)
    common.setView('seasons')
Esempio n. 21
0
def seasons(url=common.args.url):
    data = common.getURL(url)
    tree = BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    seasonmenu = tree.find('select', attrs={'id': 'videolist_id'})
    if seasonmenu:
        seasons = seasonmenu.findAll('option')
        for season in seasons:
            url = BASE + season['value']
            name = season.string
            common.addDirectory(name, 'vh1', 'seasonOptions', url)
        common.setView('seasons')
Esempio n. 22
0
def stshowcats(url = common.args.url):
    stbase = 'http://www.startrek.com'
    data = common.getURL(url)
    remove = re.compile('<!.*?">')
    data = re.sub(remove, '', data)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    stcats=tree.find('div',attrs={'id' : 'content'}).findAll('div', attrs={'class' : 'box_news'})       
    for cat in stcats:
        name = cat.find('h4').contents[1].strip()
        common.addDirectory(name, 'cbs', 'stvideos', url+'<name>'+name)
    common.setView('seasons')
Esempio n. 23
0
def show():
    data = common.getURL(common.args.url)
    full = re.compile('f:"(.*?)",').findall(data)
    clip = re.compile('c:"(.*?)",').findall(data)
    if len(full) > 0:
        if full[0] <> '':
            common.addDirectory('Full Episodes', 'gsn', 'episodes', full[0])
    if len(clip) > 0:
        if clip[0] <> '':
            common.addDirectory('Clips', 'gsn', 'episodes', clip[0])
    common.setView('seasons')
Esempio n. 24
0
def seasons(url=common.args.url):
    data = common.getURL(url)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    seasonmenu=tree.find('select',attrs={'id':'videolist_id'})
    if seasonmenu:
        seasons = seasonmenu.findAll('option')
        for season in seasons:
            url = BASE + season['value']
            name = season.string
            common.addDirectory(name,'vh1','seasonOptions',url)
        common.setView('seasons')
Esempio n. 25
0
def show():
    data = common.getURL(common.args.url)
    full = re.compile('f:"(.*?)",').findall(data)
    clip = re.compile('c:"(.*?)",').findall(data)
    if len(full) > 0:
        if full[0] <> '':
            common.addDirectory('Full Episodes', 'gsn', 'episodes', full[0])
    if len(clip) > 0:
        if clip[0] <> '':
            common.addDirectory('Clips', 'gsn', 'episodes', clip[0])
    common.setView('seasons')
Esempio n. 26
0
def stshowcats(url = common.args.url):
    stbase = 'http://www.startrek.com'
    data = common.getURL(url)
    remove = re.compile('<!.*?">')
    data = re.sub(remove, '', data)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    stcats=tree.find('div',attrs={'id' : 'content'}).findAll('div', attrs={'class' : 'box_news'})       
    for cat in stcats:
        name = cat.find('h4').contents[1].strip()
        common.addDirectory(name, 'cbs', 'stvideos', url+'<name>'+name)
    common.setView('seasons')
Esempio n. 27
0
def rootlist():
    xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_NONE)
    data = common.getURL(CONFIGURATION_URL)
    tree=BeautifulStoneSoup(data, convertEntities=BeautifulStoneSoup.XML_ENTITIES)
    categories = tree.find('logiccategories').findAll('category')
    for category in categories:
        name = category['name']
        description = category['description']
        categoryid = category['categoryid']
        common.addDirectory(name, 'adultswim', 'showbycat', categoryid)
    common.setView('seasons')             
Esempio n. 28
0
def rootlist():
    print "DEBUG Entering rootlist function"
    data = common.getURL(BASE_URL)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    menu=tree.find(attrs={'id' : 'daypart_nav'})
    categories=menu.findAll('a')
    for item in categories:
        if item['href'].find('javascript') == 0:
            catid = item['onclick'].replace("showDaypart('",'').replace("');",'')
            name = re.compile('<a.*>(.+)</a>').findall(str(item))[0].title()
            common.addDirectory(name, 'cbs', 'shows', catid)
    common.setView('seasons')
Esempio n. 29
0
def rootlist(): # No mode - Root Listing
        url = getCollections + '?id=185669'
        html=common.getURL(url)
        tree=BeautifulStoneSoup(html, convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
        collections = tree.findAll('collection')
        for collection in collections:
                cid = collection['id']
                name = collection.find('name').string
                if name == 'feature - not show in nav':
                        continue
                common.addDirectory(name.title(), 'tbs', 'shows', cid)
        common.setView('seasons')
Esempio n. 30
0
def rootlist():
    xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_NONE)
    data = common.getURL(CONFIGURATION_URL)
    tree = BeautifulStoneSoup(data,
                              convertEntities=BeautifulStoneSoup.XML_ENTITIES)
    categories = tree.find('logiccategories').findAll('category')
    for category in categories:
        name = category['name']
        description = category['description']
        categoryid = category['categoryid']
        common.addDirectory(name, 'adultswim', 'showbycat', categoryid)
    common.setView('seasons')
Esempio n. 31
0
def rootlist():
        xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL)
        url = 'http://www.tnt.tv/content/services/getCollections.do?site=true&id=58127'
        html=common.getURL(BASE_URL)
        tree=BeautifulStoneSoup(html, convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
        collections = tree.findAll('collection')
        for collection in collections:
                cid = collection['id']
                name = collection.find('name').string
                if name == 'Featured':
                        continue
                common.addDirectory(name, 'tnt', 'shows', cid)
        common.setView('seasons')
Esempio n. 32
0
def rootlist():  # No mode - Root Listing
    url = getCollections + '?id=185669'
    html = common.getURL(url)
    tree = BeautifulStoneSoup(html,
                              convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
    collections = tree.findAll('collection')
    for collection in collections:
        cid = collection['id']
        name = collection.find('name').string
        if name == 'feature - not show in nav':
            continue
        common.addDirectory(name.title(), 'tbs', 'shows', cid)
    common.setView('seasons')
Esempio n. 33
0
def showcats(url = common.args.url):
    data = common.getURL(url)
    #try:
    #    var show  = new CBS.Show({id:111381});
    #    show_id = re.compile("new CBS\.Show\(id:(.*?)\);").findall(data)
    #    url = 'http://www.cbs.com/carousels/'+dir3+'/video/'+dir1+'/'+dir2+'/0/400/
    try:
        print 'CBS: Trying New Carousel'
        carousels = re.compile("loadUpCarousel\('(.*?)','(.*?)', '(.*?)', (.*?), true, stored").findall(data)
        carousels[0][0]
        for name,dir1,dir2,dir3 in carousels:
            url = 'http://www.cbs.com/carousels/'+dir3+'/video/'+dir1+'/'+dir2+'/0/400/'
            common.addDirectory(name, 'cbs', 'newvideos', url)
    except:
        print 'CBS: Carousel Failed'
        tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
        try:
            print 'CBS: trying secondary-show-nav-wrapper'
            options = tree.find(attrs={'id' : 'secondary-show-nav-wrapper'})
            options = options.findAll('a')
            for option in options:
                name = option.string.encode('utf-8')
                url = BASE + option['href']
                common.addDirectory(name, 'cbs', 'videos', url)
            print 'CBS: trying vid_module'
            options = tree.findAll(attrs={'class' : 'vid_module'})
            for option in options:
                moduleid = option['id']
                name = option.find(attrs={'class' : 'hdr'}).string
                common.addDirectory(name, 'cbs', 'showsubcats', url+'<moduleid>'+moduleid) 
        except:
            print 'CBS: secondary-show-nav-wrapper failed'
            print 'CBS: trying vid_module secondary'
            try:
                options = tree.findAll(attrs={'class' : 'vid_module'})
                print 'DEBUG: '+options
                for option in options:
                    moduleid = option['id']
                    name = option.find(attrs={'class' : 'hdr'}).string
                    common.addDirectory(name, 'cbs', 'showsubcats', url+'<moduleid>'+moduleid)
            except:
                print 'CBS: vid_module secondary failed'
                print 'CBS: trying 16.04.2013 id-carousel'
                categories = re.compile("id-carousel-(\d+)").findall(str(tree))
                for catid in categories:
                    thisUrl = 'http://www.cbs.com/carousels/videosBySection/'+catid+'/offset/0/limit/40/xs/{excludeShow}'
                    data = common.getURL(thisUrl)
                    name = demjson.decode(data)['result']['title']
                    common.addDirectory(name, 'cbs', 'newvideos2', thisUrl)
    common.setView('seasons')                                      
Esempio n. 34
0
def seasonsRSS(url=common.args.url):
    data = common.getURL(url)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    video_rss = menu=tree.find(attrs={'type' : 'application/rss+xml'})['href']
    showid=url.split('?')[0].split('/')[-1]
    url='http://abc.go.com/vp2/s/carousel?service=seasons&parser=VP2_Data_Parser_Seasons&showid='+showid+'&view=season&bust=07000001_3'
    data = common.getURL(url)
    tree=BeautifulStoneSoup(data, convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
    seasons=tree.findAll('a')
    for season in seasons:
        seasonid=season['seasonid']
        name=season.string.strip()
        url=video_rss.replace('-1/-1/-1',seasonid+'/-1/-1')
        common.addDirectory(name, 'abc', 'episodes', url )
    common.setView('seasons')
Esempio n. 35
0
def seasonOptions(url=common.args.url):
    #options=[]
    #vidmenu=tree.findAll('li',attrs={'class':re.compile('itemList-subItem')})
    #for item in menu:
    #    link = item.find('a')
    #    name = link.contents[2]
    #    url = BASE + link['href']
    #    if '?' in url:
    #        parameters = '?'+url.split('?')[1]
    #        options.append((name,parameters))
    common.addDirectory('All Videos','mtv','videos',url)
    common.addDirectory('Full Episodes','mtv','videos',url+'fulleps')
    common.addDirectory('Bonus Clips','mtv','videos',url+'bonusclips')
    common.addDirectory('After Shows','mtv','videos',url+'aftershows')
    common.addDirectory('Sneak Peeks','mtv','videos',url+'sneakpeeks')
    common.setView('seasons')
Esempio n. 36
0
def seasonsRSS(url=common.args.url):
    data = common.getURL(url)
    tree = BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    video_rss = menu = tree.find(attrs={'type': 'application/rss+xml'})['href']
    showid = url.split('?')[0].split('/')[-1]
    url = 'http://abc.go.com/vp2/s/carousel?service=seasons&parser=VP2_Data_Parser_Seasons&showid=' + showid + '&view=season&bust=07000001_3'
    data = common.getURL(url)
    tree = BeautifulStoneSoup(data,
                              convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
    seasons = tree.findAll('a')
    for season in seasons:
        seasonid = season['seasonid']
        name = season.string.strip()
        url = video_rss.replace('-1/-1/-1', seasonid + '/-1/-1')
        common.addDirectory(name, 'abc', 'episodes', url)
    common.setView('seasons')
Esempio n. 37
0
def showcats(url=common.args.url):
    data = common.getURL(url)
    tree = BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    colume1 = tree.find(attrs={'class':'col col-1'})
    try:
        cats = colume1.find(attrs={'class':'parent videos'}).findAll(attrs={'class':'clearfix'})
        for cat in cats:
            link = cat.find('a')
            url = link['href']
            if BASE not in url:
                url = BASE + url
            name = link.string
            common.addDirectory(name, 'history', 'videos', url)
        common.setView('seasons')
    except:
        videos()
Esempio n. 38
0
def seasonOptions(url=common.args.url):
    #options=[]
    #vidmenu=tree.findAll('li',attrs={'class':re.compile('itemList-subItem')})
    #for item in menu:
    #    link = item.find('a')
    #    name = link.contents[2]
    #    url = BASE + link['href']
    #    if '?' in url:
    #        parameters = '?'+url.split('?')[1]
    #        options.append((name,parameters))
    common.addDirectory('All Videos', 'mtv', 'videos', url)
    common.addDirectory('Full Episodes', 'mtv', 'videos', url + 'fulleps')
    common.addDirectory('Bonus Clips', 'mtv', 'videos', url + 'bonusclips')
    common.addDirectory('After Shows', 'mtv', 'videos', url + 'aftershows')
    common.addDirectory('Sneak Peeks', 'mtv', 'videos', url + 'sneakpeeks')
    common.setView('seasons')
Esempio n. 39
0
def show(cid = common.args.url): 
        xbmcplugin.setContent(pluginhandle, 'shows')
        xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_NONE)
        url = getCollections + '?id=' + cid
        html=common.getURL(url)
        if '<collections total_collections="0">' in html:
            episode(cid=cid)
            return
        tree=BeautifulStoneSoup(html, convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
        collections = tree.findAll('collection')
        for collection in collections:
                cid = collection['id']
                name = collection.find('name').string
                mode = episode
                common.addDirectory(name, 'tbs', 'episode', cid)
        common.setView('seasons')
Esempio n. 40
0
def showseasonThePlatform(url=common.args.url,tree=False):
    if not tree:
        data = common.getURL(url)
        tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    seasons = tree.find('div',attrs={'id':'secondary_filter'}).findAll('li')
    if len(seasons) > 1:
        for season in seasons:
            link = season.find('a')
            if link.string == 'All Categories':
                season_url = url
            else:
                season_url = url+'&sfilter='+link.string.strip().replace(' ','%20')
            common.addDirectory(link.string, 'aetv', 'showsubThePlatform', season_url)
        xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL)
        common.setView('seasons')
    else:
        showsubThePlatform(url.replace(' ','%20'),tree=tree)
Esempio n. 41
0
def show_primary_filter(url=common.args.url):
    data = common.getURL(url)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    primary_filter = tree.find('div',attrs={'id':'primary_filter'})
    if primary_filter:
        filters = primary_filter.findAll('li',attrs={'class':None})
        if len(filters) > 1:
            for filter in filters:
                link = filter.find('a')
                item_url = url + '&pfilter='+link.string.strip().replace(' ','%20')
                common.addDirectory(link.string.title(), 'aetv', 'show_secondary_filter', item_url)
        else:
            showsubThePlatform(url.replace(' ','%20'),tree=tree)
    else:
        showsubThePlatform(url.replace(' ','%20'),tree=tree)
    xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL)
    common.setView('seasons')
Esempio n. 42
0
def videos(url = common.args.url):
    xbmcplugin.setContent(int(sys.argv[1]), 'episodes')
    data = common.getURL(url)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    print 'CBS: trying vid_module'
    try:
        options = tree.findAll(attrs={'class' : 'vid_module'})
        if len(options) == 1:
            PAGES(tree)
        else:
            for option in options:
                moduleid = option['id']
                name = option.find(attrs={'class' : 'hdr'}).string
                common.addDirectory(name, 'cbs', 'showsubcats', url+'<moduleid>'+moduleid)                                        
    except:
        PAGES(tree)
    common.setView('episodes')
Esempio n. 43
0
def videos(url = common.args.url):
    xbmcplugin.setContent(int(sys.argv[1]), 'episodes')
    data = common.getURL(url)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    print 'CBS: trying vid_module'
    try:
        options = tree.findAll(attrs={'class' : 'vid_module'})
        if len(options) == 1:
            PAGES(tree)
        else:
            for option in options:
                moduleid = option['id']
                name = option.find(attrs={'class' : 'hdr'}).string
                common.addDirectory(name, 'cbs', 'showsubcats', url+'<moduleid>'+moduleid)                                        
    except:
        PAGES(tree)
    common.setView('episodes')
Esempio n. 44
0
def rootlist(db=False):
    #div id="showContainer_SH55170916" class="showContainer"
    data = common.getURL(showlist)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    shows=tree.findAll('div',attrs={'class':'showContainer'})
    db_shows = []
    for show in shows:
        name = show.find('a')['title']
        url = show.find('a')['page']
        if db==True:
            db_shows.append((name,'disneyxd','seasons',url))
        else:
            common.addDirectory(name, 'disneyxd', 'seasons', url )
    if db==True:
        return db_shows
    else:
        common.setView('tvshows')
Esempio n. 45
0
def show():
        scid = common.args.url
        xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_NONE)
        url = 'http://www.tnt.tv/content/services/getCollections.do?site=true&id=58127'
        html=common.getURL(BASE_URL)
        tree=BeautifulStoneSoup(html, convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
        collections = tree.findAll('collection')
        for collection in collections:
                subcollections = collection.findAll('subcollection')
                for subcollection in subcollections:
                        if subcollection['id'] == scid:
                                subsubcollections = subcollection.findAll('subsubcollection')
                                for subsubcollection in subsubcollections:
                                        sscid = subsubcollection['id']
                                        name = subsubcollection.find('name').string
                                        common.addDirectory(name, 'tnt', 'episode', sscid)
        common.setView('seasons')
Esempio n. 46
0
def show(cid=common.args.url):
    xbmcplugin.setContent(pluginhandle, 'shows')
    xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_NONE)
    url = getCollections + '?id=' + cid
    html = common.getURL(url)
    if '<collections total_collections="0">' in html:
        episode(cid=cid)
        return
    tree = BeautifulStoneSoup(html,
                              convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
    collections = tree.findAll('collection')
    for collection in collections:
        cid = collection['id']
        name = collection.find('name').string
        mode = episode
        common.addDirectory(name, 'tbs', 'episode', cid)
    common.setView('seasons')
Esempio n. 47
0
def showcats():
    data = common.getURL(BASE_URL)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    video_types=tree.find('select',attrs={'id':'rb-video-browser-content_type'}).findAll('option')
    shows=tree.find('select',attrs={'id':'rb-video-browser-show'}).findAll('option')#,attrs={'title':True})
    db_shows = []
    for show in shows:
        if show['value'] == common.args.url:
            cats = show['title'].replace('[','').replace(']','').replace('"','').split(',')
            for type in video_types:
                if type['value'] in cats:
                    name = type.string
                    url = 'rb-video-browser-num_items=100'
                    url += '&module_id_base=rb-video-browser'
                    url += '&rb-video-browser-show='+show['value']
                    url += '&rb-video-browser-content_type='+type['value']
                    common.addDirectory(name, 'amc', 'videos', url)
    common.setView('seasons')
Esempio n. 48
0
def showroot(url = common.args.url):
    xbmcplugin.setContent(int(sys.argv[1]), 'shows')
    data = common.getURL(url)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    sets=tree.find('div',attrs={'id' : 'scet-categories'}).findAll('div',attrs={'class' : 'scet-cat-group'})
    for set in sets:
        set_title = set.find('h5').string.lower()
        if set_title == 'all videos':
            continue
        elif set_title == 'full episodes' or set_title == 'webisodes':
            mode = 'showsubFullEpisode'
        else:
            mode = 'showsubClips'
        for link in set.findAll('a'):
            name = link.string.strip()
            url = BASE+link['href'].split('?')[0]+'?view=detail'
            common.addDirectory(name, 'nbc', mode, url)
    common.setView('seasons')
Esempio n. 49
0
def rootlist(db=False):
    data = common.getURL(BASE_URL)
    tree = BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    items = tree.find('ul',
                      attrs={
                          'class': 'left-col-menu video-landing clearfix'
                      }).findAll('li', attrs={'class': True})
    db_shows = []
    common.addShow('Full Biographies', 'bio', 'full_bios', '/videos/full-bios')
    for item in items:
        if item['class'] == 'mainItem expanded' or item['class'] == 'mainItem ':
            if item.find('span').string == 'Shows':
                sub = item.find('ul')
                if sub <> None:
                    subcats = sub.findAll('li')
                    for cat in subcats:
                        link = cat.find('a')
                        name = link.find('span').string
                        url = link['href']
                        if db == True:
                            db_shows.append((name, 'bio', 'videos', url))
                        else:
                            common.addShow(name, 'bio', 'videos', url)
            else:
                link = item.find('a')
                name = link.find('span').string
                url = link['href']
                common.addDirectory(name, 'bio', 'videos', url)
                sub = item.find('ul')
                if sub <> None:
                    subcats = sub.findAll('li')
                    for cat in subcats:
                        link = cat.find('a')
                        name = link.find('span').string
                        url = link['href']
                        if db == True:
                            pass
                            #db_shows.append((name, 'bio', 'videos', url))
                        else:
                            common.addDirectory(name, 'bio', 'videos', url)
    if db == True:
        return db_shows
    else:
        common.setView('tvshows')
Esempio n. 50
0
def showroot(url=common.args.url):
    xbmcplugin.setContent(int(sys.argv[1]), 'shows')
    data = common.getURL(url)
    tree = BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    sets = tree.find('div', attrs={
        'id': 'scet-categories'
    }).findAll('div', attrs={'class': 'scet-cat-group'})
    for set in sets:
        set_title = set.find('h5').string.lower()
        if set_title == 'all videos':
            continue
        elif set_title == 'full episodes' or set_title == 'webisodes':
            mode = 'showsubFullEpisode'
        else:
            mode = 'showsubClips'
        for link in set.findAll('a'):
            name = link.string.strip()
            url = BASE + link['href'].split('?')[0] + '?view=detail'
            common.addDirectory(name, 'nbc', mode, url)
    common.setView('seasons')
Esempio n. 51
0
def showsub():
    showname=common.args.name
    if 'series.jhtml' in common.args.url:
        videos_url = common.args.url.replace('series.jhtml','video.jhtml')
    elif common.args.url.endswith('/'):
        redirect_url = common.args.url+'video.jhtml'
        videos_url = common.getRedirect(redirect_url).replace('series.jhtml','video.jhtml')
    else:
        videos_url = common.args.url
    data = common.getURL(videos_url)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    seasonmenu=tree.find('select',attrs={'id':'videolist_id'})
    if seasonmenu:
        seasons = seasonmenu.findAll('option')
        for season in seasons:
            url = BASE + season['value']
            name = season.string
            common.addDirectory(name,'mtv','seasonOptions',url)
        common.setView('seasons')
    else:
        seasonOptions(videos_url+'?filter=')
Esempio n. 52
0
def showcats(url=common.args.url):
    data = common.getURL(url)
    #try:
    #    var show  = new CBS.Show({id:111381});
    #    show_id = re.compile("new CBS\.Show\(id:(.*?)\);").findall(data)
    #    url = 'http://www.cbs.com/carousels/'+dir3+'/video/'+dir1+'/'+dir2+'/0/400/
    try:
        print 'CBS: Trying New Carousel'
        carousels = re.compile(
            "loadUpCarousel\('(.*?)','(.*?)', '(.*?)', (.*?), true, stored"
        ).findall(data)
        carousels[0][0]
        for name, dir1, dir2, dir3 in carousels:
            url = 'http://www.cbs.com/carousels/' + dir3 + '/video/' + dir1 + '/' + dir2 + '/0/400/'
            common.addDirectory(name, 'cbs', 'newvideos', url)
    except:
        print 'CBS: Carousel Failed'
        tree = BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
        try:
            print 'CBS: trying secondary-show-nav-wrapper'
            options = tree.find(attrs={'id': 'secondary-show-nav-wrapper'})
            options = options.findAll('a')
            for option in options:
                name = option.string.encode('utf-8')
                url = BASE + option['href']
                common.addDirectory(name, 'cbs', 'videos', url)
            print 'CBS: trying vid_module'
            options = tree.findAll(attrs={'class': 'vid_module'})
            for option in options:
                moduleid = option['id']
                name = option.find(attrs={'class': 'hdr'}).string
                common.addDirectory(name, 'cbs', 'showsubcats',
                                    url + '<moduleid>' + moduleid)
        except:
            print 'CBS: secondary-show-nav-wrapper failed'
            print 'CBS: trying vid_module secondary'
            options = tree.findAll(attrs={'class': 'vid_module'})
            for option in options:
                moduleid = option['id']
                name = option.find(attrs={'class': 'hdr'}).string
                common.addDirectory(name, 'cbs', 'showsubcats',
                                    url + '<moduleid>' + moduleid)
    common.setView('seasons')