Exemplo n.º 1
0
def masterlist():
	master_db = []
	master_dict = {}
	master_data = connection.getURL(SHOWS)
	master_tree = BeautifulSoup(master_data, 'html.parser')
	master_menu = master_tree.allcollections.find_all('collection')
	for master_item in master_menu:
		master_name = common.smart_utf8(master_item['name'])
		if '[AD]' not in master_name and 'Unlocked' not in master_name:
			tvdb_name = common.get_show_data(master_name, SITE, 'seasons')[-1]
			season_url = master_item['id'] 
			season_url = season_url + '#tveepisodes='
			try:
				for season in master_item.tveepisodes.find_all('season'):
					season_url = season_url + '-' + season['number']
			except:
				pass
			season_url = season_url + '#clips='
			try:
				for season in master_item.clips.find_all('season'):
					if season['number'] != '':
						season_url = season_url + '-' + season['number']
				else:
					season_url = season_url + '-' + '*'
			except:
				pass
			master_db.append((master_name,  SITE, 'seasons', season_url))
	return master_db
Exemplo n.º 2
0
 def GetShow(self, series_title, mode, sitemode, url):
     showdata = common.get_show_data(series_title, mode, sitemode, url)
     self.ExportShowList([showdata], 10)
     image = showdata[7]
     self.Notification(addon.getLocalizedString(39036),
                       addon.getLocalizedString(39037) % series_title,
                       image=image)
Exemplo n.º 3
0
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']
		master_stop = master_data['stop']
		del master_data
		for master_item2 in master_menu:
			website = master_item2['website']
			if website is None:
				website = ''
			if master_item2['title'] in master_check and ('PBS Kids' !=  master_item2['nola_root']) and ('blog' not in website):
				master_name = common.smart_utf8(master_item2['title'])
				tvdb_name = common.get_show_data(master_name, SITE, 'seasons')[-1]
				season_url = re.compile('/cove/v1/programs/(.*?)/').findall(master_item2['resource_uri'])[0]
				if tvdb_name not in master_dict.keys():
					master_dict[tvdb_name] = common.smart_unicode(master_name) + '#' +season_url
				else:
					master_dict[tvdb_name] = master_dict[tvdb_name] + ',' + master_name + '#' + season_url
		master_start = master_stop
	for master_name in master_dict:
		season_url = master_dict[master_name]
		master_db.append((master_name, SITE, 'seasons', season_url))
	return master_db
Exemplo n.º 4
0
def masterlist():
    master_db = []
    master_dict = {}
    master_data = connection.getURL(SHOWS)
    master_tree = BeautifulSoup(master_data, 'html.parser')
    master_menu = master_tree.allcollections.find_all('collection')
    for master_item in master_menu:
        master_name = common.smart_utf8(master_item['name'])
        if '[AD]' not in master_name and 'Unlocked' not in master_name:
            tvdb_name = common.get_show_data(master_name, SITE, 'seasons')[-1]
            season_url = master_item['id']
            season_url = season_url + '#tveepisodes='
            try:
                for season in master_item.tveepisodes.find_all('season'):
                    season_url = season_url + '-' + season['number']
            except:
                pass
            season_url = season_url + '#clips='
            try:
                for season in master_item.clips.find_all('season'):
                    if season['number'] != '':
                        season_url = season_url + '-' + season['number']
                else:
                    season_url = season_url + '-' + '*'
            except:
                pass
            master_db.append((master_name, SITE, 'seasons', season_url))
    return master_db
Exemplo n.º 5
0
def masterlist(SITE, SHOWS, SPECIALS=None):
    master_db = []
    root_dict = {}
    root_url = SHOWS
    root_data = connection.getURL(root_url)
    root_tree = BeautifulSoup(root_data,
                              'html.parser',
                              parse_only=SoupStrainer('div', id='grid-frame'))
    root_menu = root_tree.find_all('div', class_='media-module')
    for root_item in root_menu:
        root_name = root_item.find('div', class_='title').text
        season_url = BASE + root_item.a['href']
        if '-1' not in season_url:
            tvdb_name = common.get_show_data(root_name, SITE, 'seasons')[-1]
            root_name = root_name + '#' + season_url
            if tvdb_name not in root_dict.keys():
                root_dict[tvdb_name] = root_name
            else:
                root_dict[tvdb_name] = root_dict[tvdb_name] + '|' + root_name
    for root_name in root_dict:
        season_url = root_dict[root_name]
        master_db.append((root_name, SITE, 'seasons', season_url))
    more = root_tree.find('a', class_='load-more')
    if more:
        master_db.extend(masterlist(SITE, BASE + more['href']))
    return master_db
Exemplo n.º 6
0
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']
        master_stop = master_data['stop']
        del master_data
        for master_item2 in master_menu:
            website = master_item2['website']
            if website is None:
                website = ''
            if master_item2['title'] in master_check and (
                    'PBS Kids' !=
                    master_item2['nola_root']) and ('blog' not in website):
                master_name = common.smart_utf8(master_item2['title'])
                season_url = re.compile('/cove/v1/programs/(.*?)/').findall(
                    master_item2['resource_uri'])[0]
                tvdb_name = common.get_show_data(
                    master_name, SITE, 'seasons',
                    common.smart_unicode(master_name) + '#' + season_url)[-1]
                if season_url:
                    if tvdb_name not in master_dict.keys():
                        try:
                            master_dict[tvdb_name] = common.smart_unicode(
                                master_name) + '#' + season_url
                        except Exception, e:
                            print "e1", e
                            return e
                    else:
                        try:
                            master_dict[tvdb_name] = master_dict[
                                tvdb_name] + '|' + common.smart_unicode(
                                    master_name) + '#' + season_url
                        except Exception, e:
                            print "error", e
                            return e
                else:
                    print "No season"
Exemplo n.º 7
0
def masterlist():
	master_db = []
	master_dict = {}
	master_data = connection.getURL(SHOWS)
	master_tree = plistlib.readPlistFromString(master_data)
	for master_item in master_tree:
		master_name = common.smart_utf8(master_item['name'])
		tvdb_name = common.get_show_data(master_name, SITE, 'seasons')[-1]
		if tvdb_name not in master_dict.keys():
			master_dict[tvdb_name] = master_item['show-id']
		else:
			master_dict[tvdb_name] = master_dict[tvdb_name] + ',' + master_item['show-id']
	for master_name in master_dict:
		season_url = master_dict[master_name]
		master_db.append((master_name,  SITE, 'seasons', season_url))
	return master_db
Exemplo n.º 8
0
def masterlist():
	master_db = []
	master_dict = {}
	master_data = connection.getURL(SHOWS)
	master_tree = plistlib.readPlistFromString(master_data)
	for master_item in master_tree:
		master_name = common.smart_utf8(master_item['name'])
		tvdb_name = common.get_show_data(master_name, SITE, 'seasons')[-1]
		if tvdb_name not in master_dict.keys():
			master_dict[tvdb_name] = master_item['show-id']
		else:
			master_dict[tvdb_name] = master_dict[tvdb_name] + ',' + master_item['show-id']
	for master_name in master_dict:
		season_url = master_dict[master_name]
		master_db.append((master_name,  SITE, 'seasons', season_url))
	return master_db
Exemplo n.º 9
0
	def GetNetworkShows(self, site):
		network = common.get_network(site)
		if network:
			networkshows = getattr(network, 'masterlist')()
			shows = []
			for show in networkshows:
				try:
					series_title, mode, sitemode, url = show
					siteplot = None
				except:
					series_title, mode, sitemode, url, siteplot = show
				showdata = common.get_show_data(series_title, mode, sitemode, url, siteplot)
				shows.append(showdata)
			self.ExportShowList(shows, 100)
			image =  os.path.join(ustvpaths.IMAGEPATH, network.SITE + '.png')
			self.Notification(addon.getLocalizedString(39036), addon.getLocalizedString(39037) % network.NAME, image = image)
Exemplo n.º 10
0
def masterlist():
	master_db = []
	master_doubles = []
	master_dict = {}
	master_data = connection.getURL(SHOWS)
	master_menu = BeautifulSoup(master_data, 'html.parser').find_all('article', class_ = 'all-shows')
	for master_item in master_menu:
		master_name = master_item.a['title']
		if master_name not in master_doubles:
			tvdb_name = common.get_show_data(master_name, SITE, 'seasons')[-1]
			if tvdb_name not in master_dict.keys():
				master_dict[tvdb_name] = master_name
			else:
				master_dict[tvdb_name] = master_dict[tvdb_name] + ',' + master_name
			master_doubles.append(master_name)
	for master_name in master_dict:
		season_url = master_dict[master_name]
		master_db.append((master_name, SITE, 'seasons', season_url))
	return master_db
Exemplo n.º 11
0
def masterlist():
	master_dict = {}
	master_db = []
	master_data = connection.getURL(SHOWS)
	master_tree = BeautifulSoup(master_data, 'html5lib')
	master_section = master_tree.find_all('div', class_ = 'primetime_and_originals')
	for section in master_section:
		master_menu = section.find_all('a', text = True)
		for master_item in master_menu:
			master_name = master_item.text
			tvdb_name = common.get_show_data(master_name,SITE, 'seasons')[-1]
			season_url = BASE + master_item['href']
			if tvdb_name not in master_dict.keys():
				master_dict[tvdb_name] = season_url
			else:
				master_dict[tvdb_name] = master_dict[tvdb_name] + ',' + season_url
	for master_name, season_url in master_dict.iteritems():	
		master_db.append((master_name, SITE, 'seasons', season_url))
	return master_db
Exemplo n.º 12
0
 def GetNetworkShows(self, site):
     network = common.get_network(site)
     if network:
         networkshows = getattr(network, 'masterlist')()
         shows = []
         for show in networkshows:
             try:
                 series_title, mode, sitemode, url = show
                 siteplot = None
             except:
                 series_title, mode, sitemode, url, siteplot = show
             showdata = common.get_show_data(series_title, mode, sitemode,
                                             url, siteplot)
             shows.append(showdata)
         self.ExportShowList(shows, 100)
         image = os.path.join(ustvpaths.IMAGEPATH, network.SITE + '.png')
         self.Notification(addon.getLocalizedString(39036),
                           addon.getLocalizedString(39037) % network.NAME,
                           image=image)
Exemplo n.º 13
0
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, limit_end = 500)
		master_menu = master_data['results']
		master_count = master_data['count']
		master_stop = master_data['stop']
		print master_stop, master_count
		#del master_data
		for master_item2 in master_menu:
			website = master_item2['website']
			if website is None:
				website = ''
			if  ('PBS Kids' !=  master_item2['nola_root']) and ('blog' not in website):
				master_name = common.smart_utf8(master_item2['title'])
				print master_name
				season_url = re.compile('/cove/v1/programs/(.*?)/').findall(master_item2['resource_uri'])[0]
				tvdb_name = common.get_show_data(master_name, SITE, 'seasons', common.smart_unicode(master_name) + '#' +season_url)[-1]
				if season_url:
					if tvdb_name not in master_dict.keys():
						try:
							master_dict[tvdb_name] = common.smart_unicode(master_name) + '#' +season_url
						except Exception, e:
							print "e1", e
							return e
					else:
						try:
							master_dict[tvdb_name] = master_dict[tvdb_name] + '|' + common.smart_unicode(master_name) + '#' + season_url
						except Exception, e:
							print "error",e
							return e
				else:
					print "No season"
Exemplo n.º 14
0
def masterlist():
    master_dict = {}
    master_db = []
    master_data = connection.getURL(SHOWS)
    master_tree = BeautifulSoup(master_data, 'html5lib')
    master_section = master_tree.find_all('div',
                                          class_='primetime_and_originals')
    for section in master_section:
        master_menu = section.find_all('a', text=True)
        for master_item in master_menu:
            master_name = master_item.text
            tvdb_name = common.get_show_data(master_name, SITE, 'seasons')[-1]
            season_url = BASE + master_item['href']
            if tvdb_name not in master_dict.keys():
                master_dict[tvdb_name] = season_url
            else:
                master_dict[
                    tvdb_name] = master_dict[tvdb_name] + ',' + season_url
    for master_name, season_url in master_dict.iteritems():
        master_db.append((master_name, SITE, 'seasons', season_url))
    return master_db
Exemplo n.º 15
0
def masterlist():
    master_db = []
    master_doubles = []
    master_dict = {}
    master_data = connection.getURL(SHOWS)
    master_menu = BeautifulSoup(master_data,
                                'html.parser').find_all('article',
                                                        class_='all-shows')
    for master_item in master_menu:
        master_name = master_item.a['title']
        if master_name not in master_doubles:
            tvdb_name = common.get_show_data(master_name, SITE, 'seasons')[-1]
            if tvdb_name not in master_dict.keys():
                master_dict[tvdb_name] = master_name
            else:
                master_dict[
                    tvdb_name] = master_dict[tvdb_name] + ',' + master_name
            master_doubles.append(master_name)
    for master_name in master_dict:
        season_url = master_dict[master_name]
        master_db.append((master_name, SITE, 'seasons', season_url))
    return master_db
Exemplo n.º 16
0
def masterlist(SITE, SHOWS, SPECIALS = None):
	master_db = []
	root_dict = {}
	root_url = SHOWS
	root_data = connection.getURL(root_url)
	root_tree = BeautifulSoup(root_data, 'html.parser', parse_only = SoupStrainer('div', id = 'grid-frame'))
	root_menu = root_tree.find_all('div', class_ = 'media-module')
	for root_item in root_menu:
		root_name = root_item.find('div', class_ = 'title').text
		season_url = BASE + root_item.a['href']
		if '-1' not in season_url:
			tvdb_name = common.get_show_data(root_name, SITE, 'seasons')[-1]
			root_name = root_name + '#' + season_url 
			if tvdb_name not in root_dict.keys():
				root_dict[tvdb_name] = root_name
			else:
				root_dict[tvdb_name] = root_dict[tvdb_name] + '|' + root_name
	for root_name in root_dict:
		season_url = root_dict[root_name]
		master_db.append((root_name, SITE, 'seasons', season_url))
	more = root_tree.find('a', class_ = 'load-more')
	if more:
		master_db.extend(masterlist(SITE, BASE + more['href']))
	return master_db
Exemplo n.º 17
0
	def GetShow(self, series_title, mode, sitemode, url):
		showdata = common.get_show_data(series_title, mode, sitemode, url)
		self.ExportShowList([showdata], 10)
		image =  showdata[7]
		self.Notification(addon.getLocalizedString(39036), addon.getLocalizedString(39037) % series_title, image = image)