def pbs_episodes(url): 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() a = json.loads(link) a = a['collections']['episodes']['content'] if len(a) > 0: for b in a: url = b.get('mp4') if not url is None: name = b.get('title', 'no title') iconimage = b.get('images', { 'x': None }).get('mezzanine', addon_logo) description = b.get('description') Addon.addLink(str(name), str(description), str(url), 25, str(iconimage)) else: dlg.ok(addonname, "No episodes found.") exit()
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 nbc_episodes(url): 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() id = re.compile(',"listKey"\:\"(.+?)"', re.DOTALL).search(link) if id is not None: id = id.group(1) id = id.rsplit('-', 1)[0] req = urllib2.Request( 'https://api.nbc.com/v3.14/videos?fields%5Bvideos%5D=title%2Cdescription%2Ctype%2Cgenre%2CvChipRating%2CvChipSubRatings%2Cguid%2Cpublished%2CrunTime%2Cairdate%2Cavailable%2CseasonNumber%2CepisodeNumber%2Cexpiration%2Centitlement%2CtveAuthWindow%2CnbcAuthWindow%2CexternalAdId%2CuplynkStatus%2CdayPart%2CinternalId%2Ckeywords%2Cpermalink%2CembedUrl%2Ccredits%2CselectedCountries%2Ccopyright&fields%5Bshows%5D=active%2Ccategory%2Ccolors%2CcreditTypeLabel%2Cdescription%2Cfrontends%2Cgenre%2CinternalId%2CisCoppaCompliant%2Cname%2Cnavigation%2Creference%2CschemaType%2CshortDescription%2CshortTitle%2CshowTag%2Csocial%2CsortTitle%2CtuneIn%2Ctype%2CurlAlias&fields%5Bimages%5D=derivatives%2Cpath%2Cwidth%2Cattributes%2CaltText%2Clink&fields%5BaggregatesShowProperties%5D=videoEpisodeSeasons%2CvideoTypes&include=image%2Cshow.image%2Cshow.aggregates&filter%5Bpublished%5D=1&filter%5BsalesItem%5D=0&filter%5Bshow%5D=' + id + '&filter%5Btype%5D%5Bvalue%5D=Full%20Episode&filter%5Btype%5D%5Boperator%5D=%3D&sort=airdate&page%5Bnumber%5D=1&page%5Bsize%5D=50' ) 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) html = response.read() response.close() a = json.loads(html) episodelist = [] for b in sorted(a['data']): entitlement = b['attributes'].get('entitlement') url = b['attributes'].get('embedUrl') url = url.split('guid/', 1)[1] url = url.split('?', 1)[0] url = 'http://link.theplatform.com/s/NnzsPC/media/guid/%s?format=preview' % url html = Addon.getRequest(url) if html == '': continue c = json.loads(html) name = c['title'] description = c.get('description') iconimage = c.get('defaultThumbnailUrl') url = 'http://link.theplatform.com/s/NnzsPC/media/' + c[ 'mediaPid'] + '?policy=43674&player=NBC.com%20Instance%20of%3A%20rational-player-production&formats=m3u,mpeg4&format=SMIL&embedded=true&tracking=true' if b['attributes'].get( 'type') == "Full Episode" and entitlement == "free": episodelist.append(name) if len(episodelist) > 0: Addon.addLink(str(name), description, url, 23, iconimage) else: dlg.ok(addonname, "No episodes found.") exit() else: dlg.ok(addonname, "No episodes found.") exit()
def nbc_stream(url): if not '&format=redirect' in url: html = Addon.getRequest(url) if 'video src="' in html: url = Addon.find_single_match(html, 'video src="(.+?)"') else: url = Addon.find_single_match(html, 'ref src="(.+?)"') if 'nbcvodenc' in url: html = Addon.getRequest(url) url = Addon.find_single_match(html, 'http(.+?)\n') url = 'http' + url.strip() elif not (url.endswith(".mp4") or url.endswith(".flv")): headers = Addon.defaultHeaders.copy() headers[ 'User-Agent'] = 'Mozilla/5.0 (Linux; U; en-US) AppleWebKit/528.5+ (KHTML, like Gecko, Safari/528.5+) Version/4.0 Kindle/3.0 (screen 600X800; rotate)' html = Addon.getRequest(url, headers=headers) urls = Addon.find_multiple_matches(html, 'BANDWIDTH=(.+?),.+?\n(.+?)\n') blast = 0 for b, u in urls: b = int(b) if blast < b: url = u blast = b url += '|User-Agent=' + urllib.quote(headers['User-Agent']) if "Unavailable.mp4" in url: dlg.ok(addonname, "Stream unavailable.") exit() else: Addon.play(url)
def food_stream(url): 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() url = Addon.find_single_match(link, '<video src="(.*?)"') Addon.play(url)
def freeform_movies(url): 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="movies-grid col-xs-6 col-md-4 col-lg-3">(.*?)</a>') for entry in matches: name = Addon.find_single_match(entry, '<h3 class="m-b-0">(.+?)</h3>').replace( "&", "&").replace("'", "'").strip() description = Addon.find_single_match(entry, '<p>(.+?)</p>').replace( "<p>", "").replace("<\/p>", "").strip().replace("'", "'").replace(""", '"') url = "http://freeform.go.com" + Addon.find_single_match( entry, '<a href="(.+?)"') iconimage = Addon.find_single_match(entry, '<img src="(.+?)"') lock = Addon.find_single_match( entry, 'data-sign-in-padlock data-requires-sign-in="(.+?)"').strip() if "http" in url and lock == "False": Addon.addLink(name, description, url, 17, iconimage)
def freeform_episodes(url): 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, '<hr />(.*?)<p class="m-t-1">') episodelist = [] for entry in matches: name = Addon.find_single_match( entry, '<h1 class="text-hover">(.+?)</h1>').replace( "&", "&").replace("'", "'").strip() description = Addon.find_single_match( entry, '"ResultDescription":(.+?)"').replace("<p>", "").replace( "<\/p>", "").strip().replace("'", "'").replace(""", '"') url = "http://freeform.go.com" + Addon.find_single_match( entry, '<a href="(.+?)"') iconimage = Addon.find_single_match(entry, '<img src="(.+?)"') lock = Addon.find_single_match( entry, 'data-sign-in-padlock data-requires-sign-in="(.+?)"').strip() if "http" in url and lock == "False": episodelist.append(name) if len(episodelist) > 0: Addon.addLink(name, description, url, 17, iconimage) else: dlg.ok(addonname, "No episodes found.") exit()
def autoPlay(): pl = Addon.get_playlist(xbmc.PLAYLIST_VIDEO) xbmc.Player().play(pl) #try and give it time to buffer enough of stream xbmc.sleep(5000) if xbmc.getCondVisibility('player.paused') == 1: xbmc.Player().pause()
def abc_stream(url): 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() vd = Addon.find_single_match(link, "VDKA(.+?)\"") url = 'https://api.entitlement.watchabc.go.com/vp2/ws-secure/entitlement/2020/authorize.json' udata = 'video%5Fid=VDKA' + str( vd) + '&device=001&video%5Ftype=lf&brand=001' uheaders = Addon.defaultHeaders.copy() uheaders['Content-Type'] = 'application/x-www-form-urlencoded' uheaders['Accept'] = 'application/json' uheaders['X-Requested-With'] = 'ShockwaveFlash/22.0.0.209' uheaders['Origin'] = 'http://cdn1.edgedatg.com' html = Addon.getRequest(url, udata, uheaders) a = json.loads(html) if a.get('uplynkData', None) is None: return sessionKey = a['uplynkData']['sessionKey'] if not '&cid=' in sessionKey: oid = Addon.find_single_match(html, '&oid=(.+?)&') eid = Addon.find_single_match(html, '&eid=(.+?)&') url = 'http://content.uplynk.com/ext/%s/%s.m3u8?%s' % (oid, eid, sessionKey) else: cid = Addon.find_single_match(html, '&cid=(.+?)&') url = 'http://content.uplynk.com/%s.m3u8?%s' % (cid, sessionKey) Addon.play(url)
def hgtv_episodes(url): 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, '"id" : "(.*?)},') for entry in matches: name = Addon.find_single_match(entry, '"title" : "(.+?)"').replace( "&", "&").replace("'", "'").strip() description = Addon.find_single_match( entry, '"description" : "(.+?)"').replace("<p>", "").replace("<\/p>", "") url = Addon.find_single_match(entry, '"releaseUrl" : "(.+?)"') iconimage = "http://hgtv.com/" + Addon.find_single_match( entry, '"thumbnailUrl" : "(.+?)"') if ".jpg" not in iconimage: iconimage = xbmc.translatePath( os.path.join(plugin_path, 'resources', 'images', 'hgtv_main.png')) if "http" in url: Addon.addLink(name, description, url, 2, iconimage)
def smith_main(): url = 'http://www.smithsonianchannel.com/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, '<li class="mix free" data-premium="false">(.*?)</li>') for entry in matches: name = Addon.find_single_match( entry, '<h3 class="promo-series-name">(.+?)</h3>').replace( "&", "&").replace("'", "'") description = Addon.find_single_match( entry, '<h2 class="promo-show-name">(.+?)</h2>').replace( "&", "&").replace("'", "'") url = "http://www.smithsonianchannel.com/" + Addon.find_single_match( entry, '<a href="(.+?)"') iconimage = "http:" + Addon.find_single_match( entry, '<source srcset="(.+?)"') if len(name) > 0 and "http" in url: Addon.addLink(name, description, url, 11, iconimage)
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 autoPlay(): try: pl = Addon.get_playlist(xbmc.PLAYLIST_VIDEO) xbmc.Player().play(pl) #try and give it time to buffer enough of stream xbmc.sleep(5000) if xbmc.getCondVisibility('player.paused') == 1: xbmc.Player().pause() except Exception, e: print str(e)
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 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 addToLibrary(play): Addon.log('Add to library: %s' % play) folder = Addon.get_setting('library_folder') if folder == '': d = xbmcgui.Dialog() d.ok( Addon.get_string(30300), 'You have not set the library folder.\nPlease update the addon settings and try again.', '', '') Addon.addon.openSettings(sys.argv[0]) folder = Addon.get_setting('library_folder') if folder == '': return if Addon.get_setting('download_hq') == 'true': #fix for old versions hq = '720p' else: hq = Addon.get_setting('hq') title = play.rsplit('@', 1)[0] assetID = play.rsplit('@', 1)[1] stream_url = muzu.resolve_stream(assetID, hq) #try and match artist and track name artist, track = getArtistAndTrack(title) kb = xbmc.Keyboard(artist, 'Enter Artist...') kb.doModal() if not kb.isConfirmed(): return artist = clean(kb.getText()) kb = xbmc.Keyboard(track, 'Enter Track...') kb.doModal() if not kb.isConfirmed(): return track = clean(kb.getText()) if track == '' and artist == '': return path = os.path.join(folder, artist + ' - ' + track) if not os.path.exists(path): os.mkdir(path) filename = os.path.join(path, track + '.strm') strm = stream_url f = open(filename, "w") f.write(strm) f.close()
def addToLibrary(play): Addon.log('Add to library: %s' % play) folder = Addon.get_setting('library_folder') if folder == '': d = xbmcgui.Dialog() d.ok(Addon.get_string(30300),'You have not set the library folder.\nPlease update the addon settings and try again.','','') Addon.addon.openSettings(sys.argv[0]) folder = Addon.get_setting('library_folder') if folder == '': return if Addon.get_setting('download_hq') == 'true': #fix for old versions hq = '720p' else: hq = Addon.get_setting('hq') title = play.rsplit('@', 1)[0] assetID = play.rsplit('@', 1)[1] stream_url = muzu.resolve_stream(assetID, hq) #try and match artist and track name artist, track = getArtistAndTrack(title) kb = xbmc.Keyboard(artist, 'Enter Artist...' ) kb.doModal() if not kb.isConfirmed(): return artist = clean(kb.getText()) kb = xbmc.Keyboard(track, 'Enter Track...' ) kb.doModal() if not kb.isConfirmed(): return track = clean(kb.getText()) if track == '' and artist == '': return path = os.path.join(folder, artist + ' - ' + track) if not os.path.exists(path): os.mkdir(path) filename = os.path.join(path, track+'.strm') strm = stream_url f = open(filename, "w") f.write(strm) f.close()
def abc_episodes(url): 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-episode-copy medium-8 large-6 columns nogutter ">(.*?)</picture>' ) if len(matches) > 0: episodelist = [] for entry in matches: season = Addon.find_single_match( entry, '<span class="season-number light">(.+?)</span>').replace( "&", "&").replace("'", "'").strip() season = re.sub('<[^<]+?>', '', season).strip() episode = Addon.find_single_match( entry, '<span class="episode-number">(.+?)</a>').replace( "&", "&").replace("'", "'").strip() episode = re.sub('<[^<]+?>', '', episode).strip() name = season + " " + episode description = Addon.find_single_match( entry, '<p>(.+?)</p>').replace("&", "&").replace("'", "'").strip() description = re.sub('<[^<]+?>', '', description).strip() path = Addon.find_single_match( entry, '<a class="dark-text" href="(.+?)">Watch</a>') url = "http://abc.go.com" + path iconimage = Addon.find_single_match(entry, 'srcset="(.+?) ') if len(path) > 0: episodelist.append(path) if len(episodelist) > 0: Addon.addLink(name, description, url, 21, iconimage) else: dlg.ok(addonname, "No episodes found.") exit() else: dlg.ok(addonname, "No episodes found.") exit()
def display_songs(mode, songs): if mode == 'music': add = Addon.add_music_item else: add = Addon.add_video_item for s in songs: if mode == 'music': infolabels = {'title': s['title'], 'artist': s['artist']} else: infolabels = {'title': '%s - %s' % (s['artist'], s['title'])} add(Addon.build_query({'mode': mode, 'song_id': s['song_id']}), infolabels, img=s['thumb'], total_items=16)
def show_streams(title, playlist_id): if mode == title: streams = source.Source().get_streams(playlist_id) if streams: for c in streams: title = c['title'] channel = c['title'] videoId = c['videoId'] img = c['img'] rURL = Addon.plugin_url + "?channel=" + channel + "&videoId=" + videoId + "&mode=play" Addon.add_video_item(rURL, {'title': title}, img=img) elif mode == 'play': videoId = Addon.plugin_queries['videoId'] stream_status = source.Source()._get_json( '/check' + base64.b64decode('LnBocA=='), {'id': videoId})['status'] if stream_status == 'true': stream = "https://www.youtube.com/watch?v=" + videoId stream_url = liveresolver.resolve(stream) item = xbmcgui.ListItem(path=stream_url) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item) else: dlg.ok(Addon.get_string(5000), Addon.get_string(7000)) exit()
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)
def display_songs(mode, songs): if mode == 'music': add = Addon.add_music_item else: add = Addon.add_video_item for s in songs: if mode == 'music': infolabels = {'title': s['title'], 'artist': s['artist']} else: infolabels = {'title': '%s - %s' % (s['artist'], s['title'])} add(Addon.build_query({ 'mode': mode, 'song_id': s['song_id'] }), infolabels, img=s['thumb'], total_items=16)
def downloadPath(title, stream_url): if not stream_url or stream_url == '': return None downloadFolder = Addon.get_setting('download_folder') if Addon.get_setting('ask_folder') == 'true': dialog = xbmcgui.Dialog() downloadFolder = dialog.browse(3, 'Save to folder...', 'files', '', False, False, downloadFolder) if downloadFolder == '': return None if downloadFolder is '': d = xbmcgui.Dialog() d.ok( Addon.get_string(30300), 'You have not set the default download folder.\nPlease update the addon settings and try again.', '', '') Addon.addon.openSettings(sys.argv[0]) downloadFolder = Addon.get_setting('download_folder') if downloadFolder == '' and Addon.get_setting('ask_folder') == 'true': dialog = xbmcgui.Dialog() downloadFolder = dialog.browse(3, 'Save to folder...', 'files', '', False, False, downloadFolder) if downloadFolder == '': return None filename = stream_url filename = filename.rsplit('/', 1)[1] filename = filename.rsplit('?', 1)[0] ext = filename.rsplit('.', 1)[1] if isChart(title): title = title.split(': ', 1)[1] if Addon.get_setting('ask_filename') == 'true': kb = xbmc.Keyboard(title, 'Save video as...') kb.doModal() if kb.isConfirmed(): filename = kb.getText() else: filename = title filename = clean(filename) + '.' + ext return os.path.join(downloadFolder, filename)
def downloadPath(title, stream_url): if not stream_url or stream_url == '': return None downloadFolder = Addon.get_setting('download_folder') if Addon.get_setting('ask_folder') == 'true': dialog = xbmcgui.Dialog() downloadFolder = dialog.browse(3, 'Save to folder...', 'files', '', False, False, downloadFolder) if downloadFolder == '' : return None if downloadFolder is '': d = xbmcgui.Dialog() d.ok(Addon.get_string(30300),'You have not set the default download folder.\nPlease update the addon settings and try again.','','') Addon.addon.openSettings(sys.argv[0]) downloadFolder = Addon.get_setting('download_folder') if downloadFolder == '' and Addon.get_setting('ask_folder') == 'true': dialog = xbmcgui.Dialog() downloadFolder = dialog.browse(3, 'Save to folder...', 'files', '', False, False, downloadFolder) if downloadFolder == '' : return None filename = stream_url filename = filename.rsplit('/', 1)[1] filename = filename.rsplit('?', 1)[0] ext = filename.rsplit('.', 1)[1] if isChart(title): title = title.split(': ', 1)[1] if Addon.get_setting('ask_filename') == 'true': kb = xbmc.Keyboard(title, 'Save video as...' ) kb.doModal() if kb.isConfirmed(): filename = kb.getText() else: return None else: filename = title filename = clean(filename) + '.' + ext return os.path.join(downloadFolder, filename)
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 freeform_stream(url): 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() vd = Addon.find_single_match(link, "VDKA(.+?)\"") url = 'https://api.entitlement.watchabc.go.com/vp2/ws-secure/entitlement/2020/authorize.json' udata = 'video%5Fid=VDKA' + str( vd) + '&device=001&video%5Ftype=lf&brand=002' uheaders = Addon.defaultHeaders.copy() uheaders['Content-Type'] = 'application/x-www-form-urlencoded' uheaders['Accept'] = 'application/json' uheaders['X-Requested-With'] = 'ShockwaveFlash/24.0.0.194' uheaders['Origin'] = 'http://cdn1.edgedatg.com' uheaders['DNT'] = '1' uheaders[ 'Referer'] = 'http://cdn1.edgedatg.com/aws/apps/datg/web-player-unity/1.0.6.13/swf/player_vod.swf' uheaders['Pragma'] = 'no-cache' uheaders['Connection'] = 'keep-alive' uheaders['Cache-Control'] = 'no-cache' html = Addon.getRequest(url, udata, uheaders) a = json.loads(html) if a.get('uplynkData', None) is None: return sessionKey = a['uplynkData']['sessionKey'] oid = Addon.find_single_match(html, '&oid=(.+?)&') eid = Addon.find_single_match(html, '&eid=(.+?)&') url = 'http://content.uplynk.com/ext/%s/%s.m3u8?%s' % (oid, eid, sessionKey) Addon.play(url)
along with this program. If not, see <http://www.gnu.org/licenses/>. ''' from resources.lib import Addon, tvtime import sys, os, urllib, urllib2 import json import xbmc, xbmcgui, xbmcplugin, xbmcaddon addon = xbmcaddon.Addon() addonname = addon.getAddonInfo('name') addonid = addon.getAddonInfo('id') plugin_path = xbmcaddon.Addon(id=addonid).getAddonInfo('path') Addon.plugin_url = sys.argv[0] Addon.plugin_handle = int(sys.argv[1]) Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:]) dlg = xbmcgui.Dialog() Addon.log('plugin url: ' + Addon.plugin_url) Addon.log('plugin queries: ' + str(Addon.plugin_queries)) Addon.log('plugin handle: ' + str(Addon.plugin_handle)) mode = Addon.plugin_queries['mode'] quality = int(Addon.get_setting('quality')) if mode == 'main': channels = tvtime.TVtime().get_channels(quality) if channels: for c in channels:
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ''' import datetime, time, os, urllib import xbmc, xbmcaddon import _strptime from resources.lib import Addon addon = xbmcaddon.Addon(id='plugin.video.ustvnow') plugin_path = addon.getAddonInfo('path') THUMB = os.path.join(plugin_path,'icon.png') while (not xbmc.abortRequested): if int(Addon.get_setting('write_type')) != 0: if int(Addon.get_setting('write_type')) in [2,3]: MSG = 'M3U' else: MSG = 'STRM' now = datetime.datetime.today() try: Update_LastRun = Addon.get_setting("Update_NextRun") if not Update_LastRun: raise exception() except: Update_LastRun = "1970-01-01 23:59:00.000000" Addon.set_setting('Update_NextRun', str(Update_LastRun)) try: SyncUpdate = datetime.datetime.strptime(Update_LastRun, "%Y-%m-%d %H:%M:%S.%f") except:
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ''' from resources.lib import Addon, crackle import sys import xbmcgui, xbmcplugin Addon.plugin_url = sys.argv[0] Addon.plugin_handle = int(sys.argv[1]) Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:]) proxy = '' if Addon.get_setting('proxy') == 'true': proxy = Addon.get_setting('proxy_server') crack = crackle.Crackle(proxy) Addon.log('plugin url: ' + Addon.plugin_url) Addon.log('plugin queries: ' + str(Addon.plugin_queries)) Addon.log('plugin handle: ' + str(Addon.plugin_handle)) mode = Addon.plugin_queries['mode'] play = Addon.plugin_queries['play'] if play:
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ''' from resources.lib import Addon, ustvnow import sys import urllib import xbmc, xbmcgui, xbmcplugin Addon.plugin_url = sys.argv[0] Addon.plugin_handle = int(sys.argv[1]) Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:]) email = Addon.get_setting('email') password = Addon.get_setting('password') ustv = ustvnow.Ustvnow(email, password) Addon.log('plugin url: ' + Addon.plugin_url) Addon.log('plugin queries: ' + str(Addon.plugin_queries)) Addon.log('plugin handle: ' + str(Addon.plugin_handle)) mode = Addon.plugin_queries['mode'] if mode == 'main': Addon.log(mode) Addon.add_directory({'mode': 'live'}, Addon.get_string(30001)) Addon.add_directory({'mode': 'recordings'}, Addon.get_string(30002))
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ''' from resources.lib import Addon, roadrunner import sys import xbmc Addon.plugin_url = sys.argv[0] Addon.plugin_handle = int(sys.argv[1]) Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:]) Addon.log('plugin url: ' + Addon.plugin_url) Addon.log('plugin queries: ' + str(Addon.plugin_queries)) Addon.log('plugin handle: ' + str(Addon.plugin_handle)) rr = roadrunner.Roadrunner() mode = Addon.plugin_queries['mode'] play = Addon.plugin_queries['play'] def display_songs(mode, songs): if mode == 'music': add = Addon.add_music_item else: add = Addon.add_video_item
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ''' from resources.lib import Addon import sys, os import urllib import xbmc, xbmcgui, xbmcplugin, xbmcaddon Addon.plugin_url = sys.argv[0] Addon.plugin_handle = int(sys.argv[1]) Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:]) email = Addon.get_setting('email') password = Addon.get_setting('password') premium = Addon.get_setting('subscription') == "true" premium_last = Addon.get_setting('subscription_last') == "true" dlg = xbmcgui.Dialog() addon = xbmcaddon.Addon(id='plugin.video.ustvnow') plugin_path = addon.getAddonInfo('path') write_path = xbmc.translatePath(Addon.get_setting('write_folder')) from resources.lib import ustvnow_new ustv = ustvnow_new.Ustvnow(email, password, premium) if premium != premium_last: ustv.clearCache()
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ''' import datetime, time, os, urllib import xbmc, xbmcaddon import _strptime from resources.lib import Addon addon = xbmcaddon.Addon(id='plugin.video.ustvnow') plugin_path = addon.getAddonInfo('path') THUMB = os.path.join(plugin_path,'icon.png') while (not xbmc.abortRequested): if int(Addon.get_setting('write_type')) != 0: if int(Addon.get_setting('write_type')) in [2,3]: MSG = 'M3U' else: MSG = 'STRM' now = datetime.datetime.today() try: Update_LastRun = Addon.getProperty("Update_NextRun") if not Update_LastRun: raise exception() except: Update_LastRun = "1970-01-01 23:59:00.000000" Addon.setProperty('Update_NextRun', str(Update_LastRun)) try: SyncUpdate = datetime.datetime.strptime(Update_LastRun, "%Y-%m-%d %H:%M:%S.%f") except:
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ''' from resources.lib import Addon, muzutv import os.path import random import sys import xbmc, xbmcgui, xbmcplugin Addon.plugin_url = sys.argv[0] Addon.plugin_handle = int(sys.argv[1]) Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:]) email = Addon.get_setting('email') password = Addon.get_setting('password') muzu = muzutv.MuzuTv() Addon.log('plugin url: ' + Addon.plugin_url) Addon.log('plugin queries: ' + str(Addon.plugin_queries)) Addon.log('plugin handle: ' + str(Addon.plugin_handle)) mode = Addon.plugin_queries['mode'] play = Addon.plugin_queries['play'] if play: Addon.log('play: %s' % play) if Addon.get_setting('hq') == 'true':
def pbs_stream(url): html = Addon.getRequest('%s?format=json' % url) a = json.loads(html) url = a.get('url') if url is not None: Addon.play(url)
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ''' from resources.lib import Addon, freedocast import sys import xbmc, xbmcgui, xbmcplugin Addon.plugin_url = sys.argv[0] Addon.plugin_handle = int(sys.argv[1]) Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:]) freedo = freedocast.Freedocast() Addon.log('plugin url: ' + Addon.plugin_url) Addon.log('plugin queries: ' + str(Addon.plugin_queries)) Addon.log('plugin handle: ' + str(Addon.plugin_handle)) mode = Addon.plugin_queries['mode'] play = Addon.plugin_queries['play'] if play: Addon.log('play: %s mode: %s' % (play, mode)) if mode == 'vid': stream_url = freedo.resolve_video(play) else:
along with this program. If not, see <http://www.gnu.org/licenses/>. ''' from resources.lib import Addon, ustvnow_plus import sys, os, urllib, urllib2 import json import xbmc, xbmcgui, xbmcplugin, xbmcaddon addon = xbmcaddon.Addon() addonname = addon.getAddonInfo('name') addonid = addon.getAddonInfo('id') plugin_path = xbmcaddon.Addon(id=addonid).getAddonInfo('path') Addon.plugin_url = sys.argv[0] Addon.plugin_handle = int(sys.argv[1]) Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:]) write_path = xbmc.translatePath(os.path.join(plugin_path, 'resources', 'guide')) setup = Addon.get_setting('setup') setup_new = Addon.get_setting('setup_new') email = Addon.get_setting('email') password = Addon.get_setting('password') ustv = ustvnow_plus.Ustvnow(email, password) dlg = xbmcgui.Dialog() Addon.log('plugin url: ' + Addon.plugin_url) Addon.log('plugin queries: ' + str(Addon.plugin_queries)) Addon.log('plugin handle: ' + str(Addon.plugin_handle))
import xbmc, xbmcgui, xbmcplugin import re, urllib CHARTS = [] CHARTS.append('') CHARTS.append(['568952', 'top-40-charts']) #Top 40 #The rest no longer available on Muzu #CHARTS.append(['695693', 'uk-rock']) #Rock Chart #CHARTS.append(['695695', '']) #Alternative #CHARTS.append(['695696', 'uk-dance']) #Dance Chart #CHARTS.append(['695701', 'uk-rnb']) #RnB Addon.plugin_url = sys.argv[0] Addon.plugin_handle = int(sys.argv[1]) Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:]) email = Addon.get_setting('email') password = Addon.get_setting('password') muzu = muzutv.MuzuTv() Addon.log('plugin url: ' + Addon.plugin_url) Addon.log('plugin queries: ' + str(Addon.plugin_queries)) Addon.log('plugin handle: ' + str(Addon.plugin_handle)) mode = Addon.plugin_queries['mode'] play = Addon.plugin_queries['play'] #print mode #print play
import sys import xbmc, xbmcgui, xbmcplugin import re, urllib CHARTS = [] CHARTS.append('') CHARTS.append(['568952', 'top-40-charts']) #Top 40 #The rest no longer available on Muzu #CHARTS.append(['695693', 'uk-rock']) #Rock Chart #CHARTS.append(['695695', '']) #Alternative #CHARTS.append(['695696', 'uk-dance']) #Dance Chart #CHARTS.append(['695701', 'uk-rnb']) #RnB Addon.plugin_url = sys.argv[0] Addon.plugin_handle = int(sys.argv[1]) Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:]) email = Addon.get_setting('email') password = Addon.get_setting('password') muzu = muzutv.MuzuTv() Addon.log('plugin url: ' + Addon.plugin_url) Addon.log('plugin queries: ' + str(Addon.plugin_queries)) Addon.log('plugin handle: ' + str(Addon.plugin_handle)) mode = Addon.plugin_queries['mode'] play = Addon.plugin_queries['play'] #print mode #print play
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ''' from resources.lib import Addon, ustvnow import sys import urllib import xbmc, xbmcgui, xbmcplugin DEFAULT_EMAIL = '*****@*****.**' DEFAULT_PASSWORD = '******' Addon.plugin_url = sys.argv[0] Addon.plugin_handle = int(sys.argv[1]) Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:]) email = Addon.get_setting('email') or DEFAULT_EMAIL password = Addon.get_setting('password') or DEFAULT_PASSWORD print "Logging into ustvnow with email %s and password %s" % (email, password) ustv = ustvnow.Ustvnow(email, password) Addon.log('plugin url: ' + Addon.plugin_url) Addon.log('plugin queries: ' + str(Addon.plugin_queries)) Addon.log('plugin handle: ' + str(Addon.plugin_handle)) mode = Addon.plugin_queries['mode'] if mode == 'main': mode = 'live'
along with this program. If not, see <http://www.gnu.org/licenses/>. ''' from resources.lib import Addon, ustvnow import sys, os, urllib, urllib2 import json, random import xbmc, xbmcgui, xbmcplugin, xbmcaddon addon = xbmcaddon.Addon() addonname = addon.getAddonInfo('name') addonid = addon.getAddonInfo('id') plugin_path = xbmcaddon.Addon(id=addonid).getAddonInfo('path') Addon.plugin_url = sys.argv[0] Addon.plugin_handle = int(sys.argv[1]) Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:]) write_path = xbmc.translatePath(os.path.join(plugin_path, 'resources', 'guide')) setup = Addon.get_setting('setup') setup_new = Addon.get_setting('setup_new') email = Addon.get_setting('email') password = Addon.get_setting('password') ustv = ustvnow.Ustvnow(email, password) dlg = xbmcgui.Dialog() Addon.log('plugin url: ' + Addon.plugin_url) Addon.log('plugin queries: ' + str(Addon.plugin_queries)) Addon.log('plugin handle: ' + str(Addon.plugin_handle))
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ''' import datetime, time, os, urllib import xbmc, xbmcaddon import _strptime from resources.lib import Addon addon = xbmcaddon.Addon(id='plugin.video.ustvnow') plugin_path = addon.getAddonInfo('path') THUMB = os.path.join(plugin_path, 'icon.png') while (not xbmc.abortRequested): if int(Addon.get_setting('write_type')) != 0: if int(Addon.get_setting('write_type')) in [2, 3]: MSG = 'M3U' else: MSG = 'STRM' now = datetime.datetime.today() try: Update_LastRun = Addon.getProperty("Update_NextRun") if not Update_LastRun: raise exception() except: Update_LastRun = "1970-01-01 23:59:00.000000" Addon.setProperty('Update_NextRun', str(Update_LastRun)) try: SyncUpdate = datetime.datetime.strptime(Update_LastRun, "%Y-%m-%d %H:%M:%S.%f")
GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ''' from resources.lib import Addon, ustvnow import sys import urllib import xbmc, xbmcgui, xbmcplugin, xbmcaddon addon = xbmcaddon.Addon() addonname = addon.getAddonInfo('name') addonid = addon.getAddonInfo('id') if Addon.get_setting('setup') == "false": win = xbmcgui.Window(10000) win.setProperty(addonname + '.setup', "true") xbmc.executebuiltin('RunScript("' + addonid + '", "")') while True: if win.getProperty(addonname + '.setup') == "false": break xbmc.sleep(250) Addon.plugin_url = sys.argv[0] Addon.plugin_handle = int(sys.argv[1]) Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:]) email = Addon.get_setting('email') password = Addon.get_setting('password') ustv = ustvnow.Ustvnow(email, password)
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ''' from pprint import pprint from resources.lib import Addon from resources.lib.eighttracks import EightTracks, EightTracksPlayer import sys import urllib import xbmc, xbmcgui Addon.plugin_url = sys.argv[0] Addon.plugin_handle = int(sys.argv[1]) Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:]) Addon.log('plugin url: ' + Addon.plugin_url) Addon.log('plugin queries: ' + str(Addon.plugin_queries)) Addon.log('plugin handle: ' + str(Addon.plugin_handle)) mode = Addon.plugin_queries['mode'] play = Addon.plugin_queries['play'] next = Addon.plugin_queries.get('next', None) if mode == 'main': et = EightTracks(Addon.get_setting('username'), Addon.get_setting('password'), show_validation_error=True) else: et = EightTracks(Addon.get_setting('username'),
import json, base64 import requests import xbmc, xbmcgui, xbmcplugin, xbmcaddon from datetime import date from datetime import time from datetime import datetime addon = xbmcaddon.Addon() addonid = addon.getAddonInfo('id') addonname = addon.getAddonInfo('name') plugin_path = xbmcaddon.Addon(id=addonid).getAddonInfo('path') Addon.plugin_url = sys.argv[0] Addon.plugin_handle = int(sys.argv[1]) Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:]) dlg = xbmcgui.Dialog() addon_logo = xbmc.translatePath(os.path.join(plugin_path, 'icon.png')) brand_logo = xbmc.translatePath(os.path.join(plugin_path, 'icon.png')) mode = Addon.plugin_queries['mode'] ##Begin HGTV## def hgtv_main(): url = 'http://www.hgtv.com/shows/full-episodes/' req = urllib2.Request(url) req.add_header(
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)