def hgtv_main(): url = 'http://www.hgtv.com/shows/full-episodes/' req = urllib2.Request(url) req.add_header( 'User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3' ) response = urllib2.urlopen(req) link = response.read() response.close() matches = Addon.find_multiple_matches( link, '<div class="m-MediaBlock o-Capsule__m-MediaBlock m-MediaBlock--playlist">(.*?)</h4>' ) for entry in matches: name = Addon.find_single_match(entry, 'title="(.+?)"').replace( "&", "&").replace("'", "'").strip() description = "" url = "http:" + Addon.find_single_match(entry, '<a href="(.+?)"') iconimage = "http:" + Addon.find_single_match(entry, 'data-src="(.+?)"') if ".jpg" not in iconimage: iconimage = xbmc.translatePath( os.path.join(plugin_path, 'resources', 'images', 'hgtv_main.png')) videos = Addon.find_single_match( entry, '<span class="m-MediaBlock__a-AssetInfo">(.+?) Videos</span>') if videos != "0": Addon.addDir(name, description, url, 1, iconimage)
def abc_seasons(url, iconimage): req = urllib2.Request(url) req.add_header( 'User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3' ) response = urllib2.urlopen(req) link = response.read() response.close() matches = Addon.find_multiple_matches(link, '<option(.*?)option>') if matches == []: abc_episodes(url) else: seasonlist = [] for entry in matches: name = Addon.find_single_match(entry, '>(.+?)</').replace( "&", "&").replace("'", "'").strip() description = "" path = Addon.find_single_match(entry, 'value="(.+?)"').replace( "/index", "") url = "http://abc.go.com" + path if len(path) > 0: seasonlist.append(path) if len(seasonlist) > 0: Addon.addDir(name, description, url, 20, iconimage) else: dlg.ok(addonname, "No episodes found.") exit()
def abc_main(): url = 'http://abc.go.com/shows' req = urllib2.Request(url) req.add_header( 'User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3' ) response = urllib2.urlopen(req) link = response.read() response.close() matches = Addon.find_multiple_matches(link, '<li data-sm-id=""(.*?)/li>') for entry in matches: name = Addon.find_single_match( entry, '<div class="tile-show-name truncate">(.+?)</div>').replace( "&", "&").replace("'", "'") description = "" path = Addon.find_single_match(entry, '<a href="(.+?)"').replace( "/index", "") if name == "The Neighbors": url = "http://abc.go.com" + path + "/episode-guide/season-01" else: url = "http://abc.go.com" + path + "/episode-guide" iconimage = Addon.find_single_match(entry, 'srcset="(.+?) ') if "http" in url and name != "": Addon.addDir(name, description, url, 19, iconimage)
def cooking_main(): url = 'http://www.cookingchanneltv.com/videos/players/full-episodes-player' req = urllib2.Request(url) req.add_header( 'User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3' ) response = urllib2.urlopen(req) link = response.read() response.close() matches = Addon.find_multiple_matches(link, '<html >(.*?)</html>') for entry in matches: name = Addon.find_single_match( entry, '<span class="m-VideoPlayer__a-HeadlineText">(.+?)</span>' ).replace("&", "&").replace("'", "'") description = "" url = "null" iconimage = "http://cookingchanneltv.com/" + Addon.find_single_match( entry, '"thumbnailUrl" : "(.+?)"') if ".jpg" not in iconimage: iconimage = xbmc.translatePath( os.path.join(plugin_path, 'resources', 'images', 'cooking_main.png')) if name is not "": Addon.addDir(name, description, url, 7, iconimage) matches = Addon.find_multiple_matches( link, 'data-module="editorial-promo">(.*?)</div>') for entry in matches: name = Addon.find_single_match(entry, 'title="(.+?)"').replace( "&", "&").replace("'", "'") description = "" url = "http:" + Addon.find_single_match(entry, '<a href="(.+?)"') iconimage = "http:" + Addon.find_single_match(entry, 'data-src="(.+?)"') if ".jpg" not in iconimage: iconimage = xbmc.translatePath( os.path.join(plugin_path, 'resources', 'images', 'cooking_main.png')) if name is not "": Addon.addDir(name, description, url, 7, iconimage)
def pbs_main(): req = urllib2.Request('http://pbskids.org/video/') req.add_header( 'User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3' ) response = urllib2.urlopen(req) pg = response.read() response.close() a = re.compile( '<dd class="category-list-button.+?data-slug="(.+?)">(.+?)<.+?src="(.+?)".+?</dd', re.DOTALL).findall(pg) for url, name, thumb in a: url = 'https://cms-tc.pbskids.org/pbskidsvideoplaylists/%s.json' % url name = name.replace("&", "&").replace("'", "'") description = name iconimage = thumb Addon.addDir(str(name), str(description), str(url), 24, str(iconimage))
def freeform_main(): url = 'http://freeform.go.com/shows' req = urllib2.Request(url) req.add_header( 'User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3' ) response = urllib2.urlopen(req) link = response.read() response.close() matches = Addon.find_multiple_matches( link, '<div class="col-xs-4 shows-grid">(.*?)/p>') for entry in matches: name = Addon.find_single_match(entry, '<h3>(.+?)</h3>').replace( "&", "&").replace("'", "'") description = Addon.find_single_match(entry, '<p>(.+?)<').replace( "&", "&").replace("'", "'") url = "http://freeform.go.com" + Addon.find_single_match( entry, '<a href="(.+?)"') iconimage = Addon.find_single_match(entry, '<img src="(.+?)"') if "http" in url: Addon.addDir(name, description, url, 16, iconimage)
def nbc_main(): req = urllib2.Request('https://www.nbc.com/shows/all/popular') req.add_header( 'User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3' ) response = urllib2.urlopen(req) link = response.read() response.close() html = Addon.find_single_match(link, '<script>PRELOAD=(.*?)</script>') a = json.loads(html) a = a['lists']['allShows']['items'] for b in a: if b['tuneIn'] != 'WATCH VIDEOS' and b['tuneIn'] != 'COMING SOON' and b[ 'tuneIn'] != 'LEARN MORE' and b[ 'tuneIn'] != 'WATCH HIGHLIGHTS' and b[ 'tuneIn'] != 'WATCH VIDEO' and 'SERIES PREMIERE' not in str( b['tuneIn']): name = b['title'] description = "" url = 'https://www.nbc.com/' + b['urlAlias'] + '?nbc=1' iconimage = b['image']['path'] if "Coming Soon" not in name: Addon.addDir(name, description, url, 22, iconimage)