Example #1
0
def seasons(season_url = _common.args.url):
	base_url = season_url
	season_dict = OrderedDict({})
	if 'the-tonight-show' in season_url:
		add_show_thetonightshow(season_url)
		return
	has_episodes = False
	video_url = season_url + '/video'
	episode_url = season_url 
	for season_url in (episode_url, video_url):
		season_data = _connection.getURL(season_url)
		season_tree  = BeautifulSoup(season_data, 'html.parser')
		season_menu = season_tree.find_all('div', class_ = 'nbc_mpx_carousel')
		for season in season_menu:
			try:
				season_title = season.h2.text.strip()
				season_title = re.sub(' +',' ', season_title)
				season_id = season['id']
				season_node = season_id.split('_')[-1]
				if season_title not in season_dict.keys():
					season_dict[season_title] =  EPISODES % season_node
					if 'full episodes' == season_title.lower() or 'Season' in season_title:
						has_episodes = True
			except:
				pass
	if not has_episodes:
		_common.add_directory('Full Episodes', SITE, 'episodes',  base_url + '/episodes')
	for season_title in season_dict:
		season_url = season_dict[season_title]
		_common.add_directory(season_title, SITE, 'episodes',  season_url)
	_common.set_view('seasons')
def episodes(episode_url = _common.args.url):
	episode_data = _connection.getURL(VIDEOLIST % episode_url.split('#')[0])
	episode_menu = simplejson.loads(episode_data)['videos']
	for episode_item in episode_menu:
		if int(episode_item['fullep']) == int(episode_url.split('#')[1]):
			show_name = episode_item['series_name']
			url = episode_item['guid']
			episode_duration = int(episode_item['duration_secs'])/60
			episode_plot = episode_item['description_long']
			episode_name = episode_item['title']
			season_number = int(episode_item['season'])
			episode_thumb = episode_item['large_thumbnail'].replace('media.cwtv.com', 'pdl.warnerbros.com')
			try:
				episode_number = int(episode_item['episode'][len(str(season_number)):])
			except:
				episode_number = None
			try:
				episode_airdate = _common.format_date(episode_item['airdate'],'%Y-%b-%d', '%d.%m.%Y')
			except:
				episode_airdate = None
			u = sys.argv[0]
			u += '?url="' + urllib.quote_plus(url) + '"'
			u += '&mode="' + SITE + '"'
			u += '&sitemode="play_video"'
			infoLabels={	'title' : episode_name,
							'duration' : episode_duration,
							'season' : season_number,
							'episode' : episode_number,
							'plot' : episode_plot,
							'premiered' : episode_airdate,
							'tvshowtitle': show_name }
			_common.add_video(u, episode_name, episode_thumb, infoLabels = infoLabels)
	_common.set_view('episodes')
Example #3
0
def episodes(episode_url = _common.args.url):
	episode_id, type = episode_url.split('#')
	episode_start = 0
	episode_count = 200
	while episode_start < episode_count:
		episode_data = cove.videos.filter(fields = 'associated_images,mediafiles', filter_program = episode_id, order_by = '-airdate', filter_availability_status = 'Available', limit_start = episode_start, filter_type = type)
		episode_menu = episode_data['results']
		episode_count = episode_data['count']
		episode_stop = episode_data['stop']
		del episode_data
		for episode_item in episode_menu:
			infoLabels={}
			if episode_item['mediafiles']:
				url = str(episode_item['tp_media_object_id'])
				episode_name = episode_item['title']
				episode_plot = episode_item['long_description']
				episode_airdate = _common.format_date(episode_item['airdate'], '%Y-%m-%d %H:%M:%S', '%d.%m.%Y')
				episode_duration = int(episode_item['mediafiles'][0]['length_mseconds'] / 1000)
				episode_thumb = episode_item['associated_images'][0]['url']
				for episode_thumbs in episode_item['associated_images']:
					if episode_thumbs['type']['eeid'] == 'iPad-Large':
						episode_thumb = episode_thumbs['url']
				u = sys.argv[0]
				u += '?url="' + urllib.quote_plus(url) + '"'
				u += '&mode="' + SITE + '"'
				u += '&sitemode="play_video"'
				infoLabels={	'title' : episode_name,
								'durationinseconds' : episode_duration,
								'plot' : episode_plot,
								'premiered' : episode_airdate }
				_common.add_video(u, episode_name, episode_thumb, infoLabels = infoLabels)
		episode_start = episode_stop
	_common.set_view('episodes')
def seasons(season_url = _common.args.url):
	season_data = _connection.getURL(season_url)
	season_tree = BeautifulSoup(season_data, 'html.parser', parse_only = SoupStrainer('div'))
	season_menu = season_tree.find('a', text = re.compile('full episodes', re.IGNORECASE))
	season_menu2 = season_tree.find('a', href = re.compile('(?<!stand-up)/(video|clips)'))
	if season_menu is not None:
		season_url2 = season_menu['href']
		if 'http' not in season_url2:
			season_url2 = season_url + season_url2
		_common.add_directory('Full Episodes',  SITE, 'episodes', season_url2)
	elif 'episode' in season_url:
		if 'South Park' in _common.args.name:
			seasons = BeautifulSoup(season_data, 'html5lib').find_all('a',class_='seasonbtn')
			if seasons:
				for season in seasons:
					try:
						display = 'Season %s' %str(int(season.string))
					except:
						display = 'Special %s' %season.string
					_common.add_directory(display,  SITE, 'episodes', season['href'] )
		else:
			_common.add_directory('Full Episodes',  SITE, 'episodes', season_url)
	print season_url
	if season_menu2 is not None:
		season_url3 = season_menu2['href']
		if 'http' not in season_url3:
			season_url3 = season_url + season_url3
		_common.add_directory('Clips',  SITE, 'episodes', season_url3)
	_common.set_view('seasons')
Example #5
0
def episodes(episode_url = _common.args.url):
	episode_data = _connection.getURL(episode_url, header = {'X-Forwarded-For' : '12.13.14.15'})
	episode_menu = simplejson.loads(episode_data)['results']
	for episode_item in episode_menu:
		try:
			show_name = episode_item['seriesTitle']
		except:
			show_name = ''
		episode_name = episode_item['title']
		url = 'http://legacy.nick.com/videos/clip/%s.html'
		url = url % episode_item['urlKey']
		episode_plot = episode_item['description']
		image = episode_item['images'][0]['assets'][0]['path']
		episode_thumb = 'http://nick.com'+image
		try:
			episode_duration = _common.format_seconds(episode_item['duration'])
		except:
			episode_duration = -1
		u = sys.argv[0]
		u += '?url="' + urllib.quote_plus(url) + '"'
		u += '&mode="' + SITE + '"'
		u += '&sitemode="play_video"'
		infoLabels = {	'title' : episode_name,
						'plot' : episode_plot,
						'durationinseconds' : episode_duration,
						'tvshowtitle' : show_name }
		_common.add_video(u, episode_name, episode_thumb, infoLabels = infoLabels, quality_mode  = 'list_qualities')
	_common.set_view('episodes')
Example #6
0
def rootlist():
	root_data = _connection.getURL(SHOWS)
	root_tree = BeautifulSoup(root_data, 'html.parser', parse_only = SoupStrainer('div', id = 'inner'))
	root_menu = root_tree.find_all('div', class_ = 'alpha-group')
	for root_tree2 in root_menu:
		for root_item in root_tree2.find_all('a'):
			root_name = root_item.text.replace('Season','').strip()
			season_url = root_item['href'].replace('series.jhtml','video.jhtml?sort=descend')
			mode = 'show_subcats'
			if BASE not in season_url:
				season_url = BASE + season_url
			if root_name in blacklist:
				continue
			elif '/shows/events' in season_url:
				continue
			docontinue = False
			for series_name, choosen in multiseason:
				if series_name in root_name:
					if choosen is not root_name:
						docontinue = True
					elif choosen == root_name:
						root_name = series_name
						mode = 'seasons'
			if docontinue is True:
				continue
			if '(' in root_name:
				root_name = root_name.split('(')[0].strip()
			_common.add_show(root_name, SITE, mode, season_url)
	_common.set_view('tvshows')
Example #7
0
def add_videos(url=_common.args.url):
	episode_data = _connection.getURL(url)
	episode_tree = BeautifulSoup(episode_data)
	episode_subs = episode_tree.find(class_ = 'group-b')
	try:
		try:
			finalsubs = episode_subs.find(class_ = 'video-list').find_all('tr', class_ = True)
		except:
			try:
				finalsubs = episode_subs.find(id = 'vid_mod_1').find_all(itemscope = True)
			except:
				finalsubs = tree.find(id = 'vid_mod_1').find_all(itemscope = True)
		for sub in finalsubs:
			sub = sub.find('a')
			name = sub.text
			url = sub['href']
			if BASE not in url:
				url = BASE + url
			u = sys.argv[0]
			u += '?url="' + urllib.quote_plus(url) + '"'
			u += '&mode="' + SITE + '"'
			u += '&sitemode="play_url"'
			_common.add_video(u, name, '', infoLabels = {'title' : name}, quality_mode  = 'list_qualities')
		_common.set_view('episodes')
	except:
		pass
def seasons(collection_ids = _common.args.url):
	for collection_id in collection_ids.split(','):
		if ',' not in collection_ids:
			season_url = SEASONSEPISODES
		else:
			season_url = SEASONSEPISODESEXTRA
		season_data = _connection.getURL(season_url % collection_id)
		season_tree = BeautifulSoup(season_data, 'html.parser')
		episode_count = int(season_tree.episodes['totalitems'])
		if episode_count > 0:
			if ',' not in collection_ids:
				display = 'Episodes'
			else:
				display = 'Episodes - %s' % season_tree.episode['collectiontitle']
			_common.add_directory(display,  SITE, 'episodes', FULLEPISODES % collection_id)
	for collection_id in collection_ids.split(','):
		if ',' not in collection_ids:
			seasonclips_url = SEASONSCLIPS
		else:
			seasonclips_url = SEASONSCLIPSEXTRA
		season_data2 = _connection.getURL(seasonclips_url % collection_id)
		season_tree2 = BeautifulSoup(season_data2, 'html.parser')
		episode_count = int(season_tree2.episodes['totalitems'])
		if episode_count > 0:
			if ',' not in collection_ids:
				display = 'Clips'
			else:
				display = 'Clips - %s' % season_tree2.episode['collectiontitle']
			_common.add_directory(display,  SITE, 'episodes', CLIPS % collection_id)
	_common.set_view('seasons')
Example #9
0
def season_options(url = _common.args.url):
	_common.add_directory('All Videos', SITE,'add_videos',url)
	_common.add_directory('Full Episodes', SITE, 'add_videos', url + 'fulleps')
	_common.add_directory('Bonus Clips', SITE, 'add_videos', url + 'bonusclips')
	_common.add_directory('After Shows', SITE, 'add_videos', url + 'aftershows')
	_common.add_directory('Sneak Peeks', SITE, 'add_videos', url + 'sneakpeeks')
	_common.set_view('seasons')
Example #10
0
def rootlist():
	root_start = 0
	root_count = 200
	root_check = []
	root_menu = simplejson.loads(_connection.getURL(SHOWS, header = {'X-Requested-With' : 'XMLHttpRequest'}))
	for root_item in root_menu.itervalues():
		for root_item in root_item:
			root_check.append(root_item['title'])
	while root_start < root_count:
		root_data = cove.programs.filter(fields = 'mediafiles', order_by = 'title', limit_start = root_start)
		root_menu = root_data['results']
		root_count = root_data['count']
		root_stop = root_data['stop']
		del root_data
		for root_item2 in root_menu:
			if root_item2['website'] is None:
				root_website = ''
			else:
				root_website = root_item2['website']
			if (root_item2['title'] in root_check) and ('pbskids.org' not in root_website):
				root_name = _common.smart_utf8(root_item2['title'])
				season_url = re.compile('/cove/v1/programs/(.*?)/').findall(root_item2['resource_uri'])[0]
				_common.add_show(root_name,  SITE, 'seasons', season_url)
		root_start = root_stop
	_common.set_view('tvshows')
def seasons(SITE, BRANDID):
	xbmcplugin.addSortMethod(pluginHandle, xbmcplugin.SORT_METHOD_LABEL)
	season_url = _common.args.url
	season_menu = []
	season_numbers = []
	clip_numbers = []
	season_url2 = VIDEOLIST % BRANDID + '001/-1/' + season_url + '/-1/-1/-1/-1'
	season_data = _connection.getURL(season_url2)
	season_data2 = simplejson.loads(season_data)['videos']
	season_count = int(season_data2['@count'])
	if season_count > 1:
		season_menu = season_data2['video']
	elif season_count == 1:
		season_menu.append(dict(season_data2['video']))
	for season_item in season_menu:
		if int(season_item['@accesslevel']) == 0:
			if season_item['@type'] == 'lf':
				try:
					if season_item['season']['@id'] not in season_numbers:
						season_numbers.append(season_item['season']['@id'])
						season_name = 'Season ' + season_item['season']['@id']
						season_url3 = VIDEOLIST % BRANDID + '001/' + season_item['@type'] + '/' + season_url + '/' + season_item['season']['@id'] + '/-1/-1/-1'
						_common.add_directory(season_name, SITE, 'episodes', season_url3)
				except:
					pass
			elif season_item['@type'] == 'sf':
				try:
					if season_item['season']['@id'] not in clip_numbers:
						clip_numbers.append(season_item['season']['@id'])
						season_name = 'Season Clips ' + season_item['season']['@id']
						season_url4 = VIDEOLIST % BRANDID + '001/' + season_item['@type'] + '/' + season_url + '/' + season_item['season']['@id'] + '/-1/-1/-1'
						_common.add_directory(season_name, SITE, 'episodes', season_url4)
				except:
					pass
	_common.set_view('seasons')
def episodes(SITE):
	episode_menu = []
	episode_data = _connection.getURL(_common.args.url)
	episode_data2 = simplejson.loads(episode_data)['videos']
	episode_count = int(episode_data2['@count'])
	if episode_count > 1:
		episode_menu = episode_data2['video']
	elif episode_count == 1:
		episode_menu.append(dict(episode_data2['video']))
	for episode_item in episode_menu:
		if int(episode_item['@accesslevel']) == 0:
			highest_height = -1
			episode_name = episode_item['title']
			episode_duration = int(episode_item['duration']['$']) / 1000
			season_number = episode_item['season']['@id']
			episode_id = episode_item['@id']
			episode_type = episode_item['@type']
			try:
				episode_description = _common.replace_signs(episode_item['longdescription'])
			except:
				episode_description = _common.replace_signs(episode_item['description'])
			try:
				episode_airdate = episode_item['airdates']['airdate'].rsplit(' ',1)[0]
				episode_airdate = _common.format_date(episode_airdate,'%a, %d %b %Y %H:%M:%S', '%d.%m.%Y')
			except:
				try:
					episode_airdate = episode_item['airdates']['airdate'][0].rsplit(' ',1)[0]
					episode_airdate = _common.format_date(episode_airdate,'%a, %d %b %Y %H:%M:%S', '%d.%m.%Y')
				except:
					episode_airdate = -1
			try:
				episode_number = episode_item['number']
			except:
				episode_number = -1
			try:
				for episode_picture in episode_item['thumbnails']['thumbnail']:
					try:
						picture_height = int(episode_picture['@width'])
					except:
						if episode_picture['@type'] == 'source-16x9':
							picture_height = 720
						else:
							picture_height = 0
					if picture_height > highest_height:
						highest_height = picture_height
						episode_thumb = episode_picture['$']
			except:
				episode_thumb = episode_item['thumbnails']['thumbnail']['$']
			u = sys.argv[0]
			u += '?url="' + urllib.quote_plus(episode_id) + '#' + urllib.quote_plus(episode_type) + '"'
			u += '&mode="' + SITE + '"'
			u += '&sitemode="play_video"'
			infoLabels={'title' : episode_name,
						'plot' : episode_description,
						'premiered' : episode_airdate,
						'durationinseconds' : episode_duration,
						'episode' : episode_number,
						'season' : season_number }
			_common.add_video(u, episode_name, episode_thumb, infoLabels = infoLabels)
	_common.set_view('episodes')
Example #13
0
def episodes(episode_url = _common.args.url):
	episode_data = _connection.getURL(episode_url)
	episode_menu = simplejson.loads(episode_data)['entries']
	for i, episode_item in enumerate(episode_menu):
		url = episode_item['media$content'][0]['plfile$url']
		episode_duration = int(episode_item['media$content'][0]['plfile$duration'])
		episode_plot = episode_item['description']
		episode_airdate = _common.format_date(epoch = episode_item['pubDate']/1000)
		episode_name = episode_item['title']
		try:
			season_number = int(episode_item['pl' + str(i + 1) + '$season'][0])
		except:
			season_number = -1
		try:
			episode_number = int(episode_item['pl' + str(i + 1) + '$episode'][0])
		except:
			episode_number = -1
		try:
			episode_thumb = episode_item['plmedia$defaultThumbnailUrl']
		except:
			episode_thumb = None
		u = sys.argv[0]
		u += '?url="' + urllib.quote_plus(url) + '"'
		u += '&mode="' + SITE + '"'
		u += '&sitemode="play_video"'
		infoLabels={	'title' : episode_name,
						'durationinseconds' : episode_duration,
						'season' : season_number,
						'episode' : episode_number,
						'plot' : episode_plot,
						'premiered' : episode_airdate }
		_common.add_video(u, episode_name, episode_thumb, infoLabels = infoLabels)
	_common.set_view('episodes')
def episodes(episode_url = _common.args.url):
	episode_data = _connection.getURL(episode_url)
	episode_menu = simplejson.loads(episode_data.replace('}{', '},{'))['results']
	for episode_item in episode_menu:
		show_name = _common.args.name
		url = episode_item['videoURL']
		episode_duration = int(episode_item['length']/60)
		episode_plot = episode_item['shortDescription']
		episode_airdate = _common.format_date(episode_item['airdate'],'%Y-%m-%d', '%d.%m.%Y')
		episode_name = episode_item['name']
		try:
			season_number = episode_item['season']
		except:
			season_number = None
		try:
			episode_number = episode_item['episode']
		except:
			episode_number = None
		try:
			episode_thumb = episode_item['videoStillURL']
		except:
			episode_thumb = None
		u = sys.argv[0]
		u += '?url="' + urllib.quote_plus(url) + '"'
		u += '&mode="' + SITE + '"'
		u += '&sitemode="play_video"'
		infoLabels={	'title' : episode_name,
						'duration' : episode_duration,
						'season' : season_number,
						'episode' : episode_number,
						'plot' : episode_plot,
						'premiered' : episode_airdate,
						'tvshowtitle': show_name }
		_common.add_video(u, episode_name, episode_thumb, infoLabels = infoLabels)
	_common.set_view('episodes')
Example #15
0
def seasons(show_url = _common.args.url):
	""" Load the items for a show. This can be "Full Epiodes" and "Clips", or something based
	    on the data.
	    Southpark has a different site structure, so this is redirected to a different function.
	    Some pages have a manifest Javascript object that contains JSON feeds to all episodes.
	    Other pages do not have this. This function tries to find if the show home page has such
	    a feed. If so, only data from the feed is used. If the home page does not have the feed,
	    try to find the URL for the full episodes and the clips pages. For each of these pages
	    the script tries to load the manifest feed. If this cannot be found, add items based on
	    the HTML page. A consequence of this is that some shows can have mixed results: full
	    episides pages does not have a manifest, but clips does. This can lead to duplication of
	    container items. Many shows seem to contain a feed for full episodes, but this feed is empty """
	if 'South Park' in _common.args.name:
		add_items_from_southpark(show_url)
	else:
		triforceManifestFeed = _get_manifest(show_url)
		if triforceManifestFeed:
			add_items_from_manifestfile(triforceManifestFeed, show_url)
		else:
			full_episodes_url = get_full_episodes_url(show_url)
			clips_url = get_clips_url(show_url)
			if full_episodes_url:
				triforceManifestFeed = _get_manifest(full_episodes_url)
				if triforceManifestFeed:
					add_items_from_manifestfile(triforceManifestFeed, full_episodes_url)
				else:
					_common.add_directory('Full Episodes',  SITE, 'episodes', full_episodes_url)
			if clips_url:
				triforceManifestFeed = _get_manifest(clips_url)
				if triforceManifestFeed:
					add_items_from_manifestfile(triforceManifestFeed, clips_url)
				else:
					_common.add_directory('Full Episodes',  SITE, 'episodes', clips_url)
	_common.set_view('seasons')
def seasons(collection_ids=_common.args.url):
    for collection_id in collection_ids.split(","):
        if "," not in collection_ids:
            season_url = SEASONSEPISODES
        else:
            season_url = SEASONSEPISODESEXTRA
        season_data = _connection.getURL(season_url % collection_id)
        print BeautifulSoup(season_data, "html.parser").episodes
        season_tree = BeautifulSoup(season_data, "html.parser")
        episode_count = int(season_tree.episodes["totalitems"])
        if episode_count > 0:
            if "," not in collection_ids:
                display = "Episodes"
            else:
                display = "Episodes - %s" % season_tree.episode["collectiontitle"]
            _common.add_directory(display, SITE, "episodes", FULLEPISODES % collection_id)
    for collection_id in collection_ids.split(","):
        if "," not in collection_ids:
            seasonclips_url = SEASONSCLIPS
        else:
            seasonclips_url = SEASONSCLIPSEXTRA
        season_data2 = _connection.getURL(seasonclips_url % collection_id)
        season_tree2 = BeautifulSoup(season_data2, "html.parser")
        print BeautifulSoup(season_data2, "html.parser").episodes
        episode_count = int(season_tree2.episodes["totalitems"])
        if episode_count > 0:
            if "," not in collection_ids:
                display = "Clips"
            else:
                display = "Clips - %s" % season_tree2.episode["collectiontitle"]
            _common.add_directory(display, SITE, "episodes", CLIPS % collection_id)
    _common.set_view("seasons")
def episodes(episode_url = _common.args.url):
	episode_data = _connection.getURL(episode_url)
	episode_menu = simplejson.loads(episode_data)
	for episode_item in episode_menu['items']:
		if episode_item['videos']:
			url = episode_item['guid']
			episode_name = episode_item['title']
			episode_plot = episode_item['description']
			episode_airdate = _common.format_date(episode_item['airdate'], '%Y-%m-%d %H:%M:%S', '%d.%m.%Y')
			episode_duration = int(episode_item['videos'].itervalues().next()['length']) / 1000
			try:
				episode_thumb = episode_item['images']['kids-mezzannine-16x9']['url']
			except:
				try:
					episode_thumb = episode_item['images']['kids-mezzannine-4x3']['url']
				except:
					episode_thumb = episode_item['images']['mezzanine']['url']
			u = sys.argv[0]
			u += '?url="' + urllib.quote_plus(url) + '"'
			u += '&mode="' + SITE + '"'
			u += '&sitemode="play_video"'
			infoLabels={	'title' : episode_name,
							'durationinseconds' : episode_duration,
							'plot' : episode_plot,
							'premiered' : episode_airdate }
			_common.add_video(u, episode_name, episode_thumb, infoLabels = infoLabels)
	_common.set_view('episodes')
Example #18
0
def seasons(season_urls = _common.args.url):
	root_url = season_urls
	if season_urls[-1:] == '/':
		season_urls = season_urls + 'video'
	else:
		season_urls = season_urls + '/video'
	season_data = _connection.getURL(season_urls)
	show_id = re.compile('video.settings.show_id = (.*);').findall(season_data)[0]
	section_ids = re.compile('video.section_ids = \[(.*)\];').findall(season_data)[0]
	if section_ids:
		for section in section_ids.split(','):
			season_url = SEASONS % section
			season_data2 = _connection.getURL(season_url)
			try:
				season_title = simplejson.loads(season_data2)['result']['title']
				_common.add_directory(season_title,  SITE, 'episodes', FULLEPISODES % (section, show_id))
			except:
				pass
	else:
		show_tree = BeautifulSoup(season_data, 'html5lib')
		season_menu = show_tree.find_all(attrs = {'name' : 'season'})
		for season_item in season_menu:
			season_url = root_url + 'season/%s/videos/episodes' % season_item['value']
			_common.add_directory('Season ' + season_item['value'], SITE, 'episodesClassic', season_url)
		for season_item in season_menu:
			season_url = root_url + 'season/%s/videos/clips' % season_item['value']
			_common.add_directory('Clips Season ' + season_item['value'], SITE, 'episodesClassic', season_url)
	_common.set_view('seasons')
def rootlist():
	root_data = _connection.getURL(SHOWS)
	root_menu = simplejson.loads(root_data)['shows']['show']
	for root_item in root_menu:
		fullepisodes = 0
		clips = 0
		if (int(root_item['clips']['count']['@total']) + int(root_item['fullepisodes']['count']['@total'])) > 0:
			if int(root_item['clips']['count']['@total']) > 0:
				try:
					if int(root_item['clips']['count']['video']['@accesslevel']) == 0:
						clips = int(root_item['clips']['count']['video']['$'])	
				except:
					if int(root_item['clips']['count']['video'][0]['@accesslevel']) == 0:
						clips = int(root_item['clips']['count']['video'][0]['$'])
			if int(root_item['fullepisodes']['count']['@total']) > 0:
				try:
					if int(root_item['fullepisodes']['count']['video']['@accesslevel']) == 0:
						fullepisodes = int(root_item['fullepisodes']['count']['video']['$'])
				except:
					if int(root_item['fullepisodes']['count']['video'][0]['@accesslevel']) == 0:
						fullepisodes = int(root_item['fullepisodes']['count']['video'][0]['$'])
			if (fullepisodes + clips) > 0:
				root_name = root_item['title']
				season_url = root_item['@id']
				_common.add_show(root_name, SITE, 'seasons', season_url)
	_common.set_view('tvshows')
def episodes(episode_url = _common.args.url):
	episode_data = _connection.getURL(episode_url)
	episode_tree = BeautifulSoup(episode_data, 'html5lib')
	episode_menu = episode_tree.find('ul', id = 'browse_results').find_all('li', recursive = False)
	for episode_item in episode_menu:
		episode_name = episode_item.a['title']
		episode_thumb = episode_item.img['src']
		episode_plot = episode_item.find('div', class_ = 'browse_result_description').string.strip()
		show_name = _common.args.name
		url = BASE + episode_item.a['href']
		try:
			episode_duration = episode_item.find('span', class_ = 'duration').string.strip('()')
		except:
			episode_duration = 0
		try:
			episode_airdate = episode_item.find('p', class_ = 'browse_result_sale grid-visible').string.replace('Available: ','')
			episode_airdate = _common.format_date(episode_airdate, inputFormat = '%b %d, %Y')
		except:
			episode_airdate = None
		u = sys.argv[0]
		u += '?url="' + urllib.quote_plus(url) + '"'
		u += '&mode="' + SITE + '"'
		u += '&sitemode="play_video"'
		infoLabels={	'title' : episode_name,
						'duration' : episode_duration,
						'plot' : episode_plot,
						'premiered' : episode_airdate,
						'tvshowtitle': show_name }
		_common.add_video(u, episode_name, episode_thumb, infoLabels = infoLabels)
	_common.set_view('episodes')
def episodes(episode_url = _common.args.url):
	episode_data = _connection.getURL(episode_url)
	episode_tree = BeautifulSoup(episode_data, 'html5lib')
	episode_menu = episode_tree.find_all('div', id = re.compile('video_*'))
	for episode_item in episode_menu:
		show_name = episode_item.strong.string
		episode_name = _common.replace_signs(episode_item.a.img['title'].replace(show_name,''))
		episode_thumb = episode_item.a.img['src'].rsplit('_',1)[0] + '_640x360.jpg'
		episode_plot = _common.replace_signs(episode_item.find_all('p')[1].text)
		url = BASE + episode_item.a['href']
		try:
			seasonEpisode = episode_item.find('span', class_ = 'type').string
			seasonSplit = seasonEpisode.split(': Ep. ')
			season_number = int(seasonSplit[0].replace('Season', '').strip())
			episodeSplit = seasonSplit[1].split(' ')
			episode_number = int(episodeSplit[0])
			episode_duration = episodeSplit[1].replace('(', '').replace(')', '').strip()
		except:
			season_number = None
			episode_number = None
			episode_duration = None
		u = sys.argv[0]
		u += '?url="' + urllib.quote_plus(url) + '"'
		u += '&mode="' + SITE + '"'
		u += '&sitemode="play_video"'
		infoLabels={	'title' : episode_name,
						'duration' : episode_duration,
						'season' : season_number,
						'episode' : episode_number,
						'plot' : episode_plot,
						'tvshowtitle' : show_name }
		_common.add_video(u, episode_name, episode_thumb, infoLabels = infoLabels)
	_common.set_view('episodes')
Example #22
0
def episodes(episode_url = _common.args.url):
	episode_data = _connection.getURL(episode_url, header = {'X-Forwarded-For' : '12.13.14.15'})
	episode_tree = BeautifulSoup(episode_data)
	episode_menu = episode_tree.find_all('article')
	for episode_item in episode_menu:
		try:
			show_name = episode_item.find('p', class_ = 'show-name').text
		except:
			show_name = ''
		episode_name = episode_item.find('p', class_ = 'short-title').text
		url = BASE + episode_item.find('a')['href']
		episode_plot = _common.replace_signs(episode_item.find('p', class_ = 'description').text)
		try:
			episode_thumb = episode_item.find('img', class_ = 'thumbnail')['src']
		except:
			episode_thumb = None
		try:
			episode_duration = _common.format_seconds(episode_item.find('span', class_ = 'duration').text.replace('Duration:', ''))
		except:
			episode_duration = -1
		u = sys.argv[0]
		u += '?url="' + urllib.quote_plus(url) + '"'
		u += '&mode="' + SITE + '"'
		u += '&sitemode="play_video"'
		infoLabels = {	'title' : episode_name,
						'plot' : episode_plot,
						'durationinseconds' : episode_duration,
						'tvshowtitle' : show_name }
		_common.add_video(u, episode_name, episode_thumb, infoLabels = infoLabels, quality_mode  = 'list_qualities')
	_common.set_view('episodes')
def rootlist():
	root_data = _connection.getURL(SHOWS)
	root_menu = simplejson.loads(root_data)['shows']
	for root_item in root_menu:
		if root_item['external_link'] == '':
			root_name = root_item['title']
			_common.add_show(root_name,  SITE, 'seasons', root_name)
	_common.set_view('tvshows')
def seasons(season_url = _common.args.url):
	season_data = _connection.getURL(season_url)
	season_tree = BeautifulSoup(season_data, 'html.parser')
	season_menu = season_tree.find_all('div', class_ = 'tab-wrap')
	for season_item in season_menu:
		season_name = season_item.h2.text
		_common.add_directory(season_name, SITE, 'episodes', season_url)
	_common.set_view('seasons')
Example #25
0
def rootlist():
	root_data = _connection.getURL(SHOWS)
	root_menu = simplejson.loads(root_data)['entries']
	for root_item in root_menu:
		root_name = root_item['title']
		season_url = root_item['plcategory$fullTitle']
		_common.add_show(root_name,  SITE, 'seasons', season_url)
	_common.set_view('tvshows')
def rootlist():
	root_data = _connection.getURL(SHOWS)
	root_menu = BeautifulSoup(root_data, 'html5lib').find_all(href = re.compile('/shows/'))
	for root_item in root_menu:
		root_name = root_item['title']
		season_url = BASE + root_item['href']
		_common.add_show(root_name,  SITE, 'seasons', season_url)
	_common.set_view('tvshows')
def rootlist():
	root_data = _connection.getURL(SHOWS)
	root_menu = BeautifulSoup(root_data).find('select', id = 'rb-video-browser-show').find_all('option', title = True)
	for root_item in root_menu:
		root_name = root_item.text
		season_url = root_item['value']
		_common.add_show(root_name,  SITE, 'seasons', season_url)
	_common.set_view('tvshows')
Example #28
0
def rootlist():
	root_data = _connection.getURL(SHOWS)
	root_menu = simplejson.loads(root_data)['shows']
	for root_item in root_menu:
		root_name = root_item['show']['title']
		season_url = BASE + root_item['show']['path']
		_common.add_show(root_name,  SITE, 'seasons', season_url)
	_common.set_view('tvshows')
Example #29
0
def rootlist():
	show_data = _connection.getURL(SHOWS)
	show_tree = BeautifulSoup(show_data, 'html5lib')
	show_menu = show_tree.find('div', id='shows-list').find_all('a')
	for show_item in show_menu:
		show_name = _common.smart_utf8(show_item.text)
		_common.add_show(show_name,  SITE, 'seasons', show_item['href'])
	_common.set_view('tvshows')
def rootlist():
	root_data = _connection.getURL(SHOWS)
	root_menu = BeautifulSoup(root_data, 'html5lib').find_all('li')
	for root_item in root_menu:
		root_name = root_item.a.string.rsplit(' ',1)[0].strip()
		season_url = BASE + root_item.a['href'] + '?limit=100'
		_common.add_show(root_name,  SITE, 'episodes', season_url)
	_common.set_view('tvshows')