def WatchLive(url, name='', iconimage='', quality='best'): headers = { 'User-Agent': userAgent, 'Connection': 'keep-alive', 'Pragma': 'no-cache', 'Cache-Control': 'no-cache', 'Accept': 'application/json', 'DNT': '1', 'Referer': 'http://kab.tv/', 'Accept-Encoding': 'gzip, deflate', 'Accept-Language': 'en-US,en;q=0.9' } channels = common.OpenURL('http://kab.tv/api/streams', headers=headers, responseMethod='json') for channel in channels: if str(channel['id']) == url: link = channel['url'].strip() break if link == '': return None headers = {"User-Agent": userAgent} text = common.OpenURL(link, headers=headers) match = re.compile('hlsUrl":"(.*?)"').findall(text) link = common.GetStreams(match[0], headers=headers, quality=quality) final = '{0}|User-Agent={1}'.format(link, userAgent) common.PlayStream(final, quality, name, iconimage)
def Play(url, name='', iconimage='', quality='best'): try: result = common.OpenURL('{0}{1}'.format(baseUrl, url), headers={"User-Agent": userAgent}) id = re.compile(u'<video-js.*?data-video-id="(.*?)"', re.S).findall(result)[0] result = common.OpenURL('{0}{1}'.format(api, id), headers={"Accept": pk, "User-Agent": userAgent}) if result is None: link = 'https://c.brightcove.com/services/mobile/streaming/index/master.m3u8?videoId={0}'.format(id) link = common.GetStreams(link, headers={"User-Agent": userAgent}, quality=quality) else: sources = json.loads(result)['sources'] link = '' avg_bitrate = 0 for source in sources: if 'src' in source: s_type = source.get('type') #if s_type == 'application/x-mpegURL': # link = common.GetStreams(source['src'], headers={"User-Agent": userAgent}, quality=quality) # break if source.get('container') == 'MP4': if source['avg_bitrate'] > avg_bitrate: link = source['src'] avg_bitrate = source['avg_bitrate'] final = '{0}|User-Agent={1}'.format(link, userAgent) common.PlayStream(final, quality, name, iconimage) except Exception as ex: xbmc.log(str(ex), 3)
def WatchLive(name='', iconimage='', quality='best'): headers = {"User-Agent": userAgent} url = 'https://www.21.tv/pages/video/videoS.htm' text = common.OpenURL(url, headers=headers) match = re.compile('var videoSrc="(.*?)";').findall(text) text = common.OpenURL(match[0], headers=headers) match = re.compile("var\s*metadataURL\s*?=\s*?'(.+?)'").findall(text) metadataURL = match[0].replace('https://', 'http://').replace('https_streaming=true', 'https_streaming=false') text = common.OpenURL(metadataURL, headers=headers) match = re.compile("<SmilURL.*>(.+)</SmilURL>").findall(text) smil = match[0].replace('amp;', '') match = re.compile("<Server priority='1'>(.+)</Server>").findall(text) server = match[0] link = common.urlunparse(common.url_parse(smil)._replace(netloc=server)) headers = { 'Connection': 'keep-alive', 'Pragma': 'no-cache', 'Cache-Control': 'no-cache', 'Accept': '*/*', 'User-Agent': userAgent, 'Sec-Fetch-Site': 'same-site', 'Sec-Fetch-Mode': 'cors', 'Referer': metadataURL, 'Accept-Encoding': 'gzip, deflate, br', 'Accept-Language': 'en-US,en;q=0.9', } link = common.GetStreams(link, headers=headers, quality=quality) final = '{0}|User-Agent={1}&Referer={2}'.format(link, userAgent, metadataURL) common.PlayStream(final, quality, name, iconimage)
def Login(): headers = {"User-Agent": UA} text = common.OpenURL( '{0}?eu={1}&da=6gkr2ks9-4610-392g-f4s8-d743gg4623k2&dwp={2}&et=ln&du={3}' .format(entitlementsServices, username, password, deviceID), headers=headers) result = json.loads(text) if result['caseId'] != '1': return result text = common.OpenURL( '{0}?da=6gkr2ks9-4610-392g-f4s8-d743gg4623k2&et=gds&du={1}'.format( entitlementsServices, deviceID), headers=headers) return json.loads(text)
def GetChannels(url, iconimage): html = common.OpenURL(url, headers={"User-Agent": UA}) if html == "": return None match = re.compile("var makoliveJson ='(.*?)';").findall(html) resultJSON = json.loads(match[0]) if resultJSON is None or len(resultJSON) < 1: return None for channel in resultJSON['list']: name = common.GetLabelColor(common.encode(channel['title'], "utf-8"), keyColor="prColor") infos = { "Title": name, "Plot": common.encode(channel['subtitle'], "utf-8") } url = '{0}{1}'.format(baseUrl, channel['link']) iconimage = channel['picUrl'] common.addDir( name, url, 5, iconimage, infos, contextMenu=[(common.GetLocaleString( 30005 ), 'RunPlugin({0}?url={1}&name={2}&mode=5&iconimage={3}&moredata=choose&module=keshet)' .format(sys.argv[0], common.quote_plus(url), common.quote_plus(name), common.quote_plus(iconimage)))], moreData=bitrate, module='keshet', isFolder=False, isPlayable=True)
def GetSeriesList(iconimage): text = common.OpenURL( 'https://www.20il.co.il/tochniot_haarutz/%d7%97%d7%93%d7%a9%d7%95%d7%aa-%d7%a2%d7%a8%d7%95%d7%a5-20/' ) match = re.compile('<div class="tochniot-in-use-images(.*?)</div>', re.S).findall(text) match = re.compile('<a href="(.*?)".*?<img src="\s*(.*?)"', re.S).findall(match[0]) grids_arr = [] for link, iconimage in match: iconimage = GetQuoteUrl(iconimage) name = common.unquote( common.encode(link[link.rfind('/') + 1:], 'utf-8')) name = common.GetLabelColor(common.UnEscapeXML(name.replace('-', ' ')), keyColor="prColor", bold=True) if iconimage.startswith('http') == False: iconimage = '{0}{1}'.format(baseUrl, iconimage) grids_arr.append((name, '{0}{1}'.format(baseUrl, link), iconimage, { "Title": name })) grids_sorted = grids_arr if sortBy == 0 else sorted( grids_arr, key=lambda grids_arr: grids_arr[0]) for name, link, image, infos in grids_sorted: common.addDir(name, link, 1, common.encode(image, 'utf-8'), infos=infos, module=module)
def AddSeries(matches, catName): for link, iconimage, name, description in matches: i = link.lower().find('catid=') if i > 0: link = link[i + 6:] elif 'page.aspx' in link.lower(): try: t = common.OpenURL(link) m = re.compile( 'magazine_info_link w-inline-block\s*"\s*href=\'.*?catid=(.*?)&' ).findall(t) link = m[0] except: pass name = common.GetLabelColor(name.strip(), keyColor="prColor", bold=True) common.addDir(name, link, 2, iconimage, infos={ "Title": name, "Plot": description }, module=module, moreData='kan|||{0}'.format(catName), urlParamsData={'catName': catName})
def GetEpisodes(text): #raw_unicode_escape = False #match = []#re.compile(u'<main id="main"(.*?)</main>', re.S).findall(text) #if len(match) < 1: match = re.compile(u'pageGlobals.*?"id":(.*?),').findall(text) link = 'https://sport1.maariv.co.il/wp-json/sport1/v1/league/{0}/video/content?is_mobile=false&rows=800'.format(match[0]) text = common.OpenURL(link) match[0] = text.replace('\\"', '"').replace('\/', '/') #raw_unicode_escape = True match = re.compile(u'<div class="video-card(.*?)</a>', re.S).findall(match[0]) for item in match: m = re.compile("<a href=['\"](.*?)['\"].*?<img(.*?)>.*?<h3.*?>(.*?)</h3>", re.S).findall(item) if len(m) < 1: continue url, icon, name = m[0] m = re.compile(u'data-lazy="(.*?)"', re.S).findall(icon) if len(m) < 1: m = re.compile(u'src=["\'](.*?)["\']', re.S).findall(icon) icon = m[0] #if raw_unicode_escape: name = common.decode(name, 'raw_unicode_escape', force=True) url = common.decode(url, 'raw_unicode_escape', force=True) icon = common.decode(icon, 'raw_unicode_escape', force=True) name = common.GetLabelColor(common.UnEscapeXML(name.strip()), keyColor="chColor", bold=True) try: common.addDir(name, url.replace(baseUrl, ''), 4, icon, infos={"Title": name}, contextMenu=[(common.GetLocaleString(30005), 'RunPlugin({0}?url={1}&name={2}&mode=4&iconimage={3}&moredata=choose&module={4})'.format(sys.argv[0], common.quote_plus(url), name, common.quote_plus(icon), module)), (common.GetLocaleString(30023), 'RunPlugin({0}?url={1}&name={2}&mode=4&iconimage={3}&moredata=set_{4}_res&module={4})'.format(sys.argv[0], common.quote_plus(url), name, common.quote_plus(icon), module))], module=module, moreData=bitrate, isFolder=False, isPlayable=True) except Exception as ex: xbmc.log(str(ex), 3)
def GetUrlJson(url): result = {} try: html = common.OpenURL(url, headers={'User-Agent': userAgent, 'Accept-encoding': 'gzip, deflate, br'}) data_query = re.compile('data_query = (.*?)\.data_query;', re.S).findall(html) result = json.loads(data_query[0])['data_query'] if len(data_query) > 0 else {} except Exception as ex: xbmc.log(str(ex), 3) return result
def Play(name, url, iconimage, quality='best'): text = common.OpenURL(url, headers=headers) match = re.compile('DATA\s*=\s*{(.*?)};').findall(text) result = json.loads('{' + match[0] + '}') hour = url[url.find('?play=') + 6:] link = result[hour]['stream'] #link = common.GetStreams(match[0], headers=headers, quality=quality) final = '{0}|User-Agent={1}'.format(link, userAgent) common.PlayStream(final, quality, name, iconimage)
def GetTicket(link, headers): text = common.OpenURL(link, headers=headers) result = json.loads(text) if result['caseId'] == '4': result = Login() text = common.OpenURL(link, headers=headers) result = json.loads(text) if result['caseId'] != '1': xbmc.executebuiltin( "Notification({0}, You need to pay if you want to watch this video., {1}, {2})" .format(AddonName, 5000, icon)) return elif result['caseId'] != '1': xbmc.executebuiltin( "Notification({0}, Cannot get access for this video., {1}, {2})". format(AddonName, 5000, icon)) return return common.unquote_plus(result['tickets'][0]['ticket'])
def Watch(name, iconimage, quality='best'): url = 'https://www.20il.co.il/tochniot_meleot/%D7%A9%D7%99%D7%93%D7%95%D7%A8-%D7%97%D7%99/' text = common.OpenURL(url, headers=headers) match = re.compile('<div id="cdnwizPlayerWrapper.*?<iframe.*?src="(.*?)"', re.S).findall(text) Play(name, match[0], iconimage, quality, live='https://dvr.ch20-cdnwiz.com/mobilehls/dvr.m3u8')
def Play(url, name='', iconimage='', quality='best'): u = url.split('|||') url = u[0] if (Addon.getSetting("kanPreferYoutube") != "true") and (len(u) > 1) and ( 'youtube' in url or 'youtu.be' in url): text = common.OpenURL('{0}/Item/?itemId={1}'.format(baseUrl, u[1])) match = re.compile( '<script class="w-json" type="application/json">(.*?)</script>' ).findall(text) match = re.compile('src=\\\\"(.*?)\\\\"').findall(match[0]) if len(match) == 1: url = match[0] if 'youtube' in url or 'youtu.be' in url: if url.endswith('/'): url = url[:-1] video_id = url[url.rfind('/') + 1:] if '?' in video_id: video_id = video_id[:video_id.find('?')] final = '{0}/play/?video_id={1}'.format(youtubePlugin, video_id) elif 'omny.fm' in url: #text = common.OpenURL(url) #matches = re.compile('AudioUrl":"(.+?)"').findall(text) #if len(matches) == 0: # return #final = 'https://omny.fm{1}'.format(matches[-1]) final = '{0}{1}'.format(url[:-1], '.mp3') elif 'kaltura' in url: text = common.OpenURL(url, headers=headers) match = re.compile( 'window\.kalturaIframePackageData\s*=\s*{(.*?)};').findall(text) result = json.loads('{' + match[0] + '}') #final = result['entryResult']['meta']['downloadUrl'] playerConfig = result['playerConfig'] flavorAssets = result['entryResult']['contextData']['flavorAssets'][-1] final = 'https://cdnapisec.kaltura.com/p/{0}/sp/{0}00/playManifest/entryId/{1}/flavorIds/{2}/format/applehttp/protocol/https/a.m3u8?referrer=aHR0cHM6Ly93d3cua2FuLm9yZy5pbA==&clientTag=html5:v2.86&uiConfId={3}'.format( flavorAssets['partnerId'], playerConfig['entryId'], flavorAssets['id'], playerConfig['uiConfId']) else: final = GetPlayerKanUrl(url, headers=headers, quality=quality) listitem = xbmcgui.ListItem(path=final) listitem.setInfo(type="Video", infoLabels={"Title": name}) xbmcplugin.setResolvedUrl(handle=handle, succeeded=True, listitem=listitem)
def WatchLive(name='', iconimage='', quality='best'): headers={"User-Agent": userAgent} #text = common.OpenURL('https://www.hidabroot.org/live', headers=headers) #match = re.compile('<div id="video_wrapper".*?<iframe src="(.*?)"').findall(text) #text = common.OpenURL(match[0], headers=headers) text = common.OpenURL('https://go.shidur.net/player/testlive.php', headers=headers) match = re.compile('hls\.loadSource\(["\'](.*?)["\']\)').findall(text) link = common.GetStreams(match[0], headers=headers, quality=quality) final = '{0}|User-Agent={1}'.format(link, userAgent) common.PlayStream(final, quality, name, iconimage)
def GetJson(url): resultJSON = common.OpenURL(url, headers={"User-Agent": UA}, responseMethod='json') if resultJSON is None or len(resultJSON) < 1: return None if "root" in resultJSON: return resultJSON["root"] else: return resultJSON
def WatchLive(url, name='', iconimage='', quality='best'): try: text = common.OpenURL(baseUrl, headers=headers) link = re.compile('"webapp\.broadcast_link":"(.*?)"').findall( text)[0].replace('\u002F', '/') except Exception as ex: xbmc.log(str(ex), 3) link = 'https://cdna.streamgates.net/TheBest/live/playlist.m3u8' link = common.GetStreams(link, headers=headers, quality=quality) final = '{0}|User-Agent={1}'.format(link, userAgent) common.PlayStream(final, quality, name, iconimage)
def Play(name, url, iconimage, quality='best'): text = common.OpenURL(url, headers=headers) match = re.compile("source:.*?src: '(.*?)'").findall(text) ''' if match == []: match = re.compile('type="video/mp4"\s*src="(.*?)"').findall(text) if match == []: match = re.compile('file:\s*"(.*?)"').findall(text) ''' final = '{0}|User-Agent={1}'.format(match[0].replace(' ', '%20'), userAgent) common.PlayStream(final, quality, name, iconimage)
def PlayItem(url, name='', iconimage='', quality='best'): html = common.OpenURL(url, headers={"User-Agent": UA}) if html == "": return None match = re.compile("var videoJson ='(.*?)';").findall(html) prms = json.loads(match[0].replace("\\'", "'")) if prms is None or len(prms) < 1: return None iconimage = GetImage(prms, 'pic_I', iconimage) videoChannelId = prms["chId"] vcmid = prms["guid"] url = "vcmid={0}&videoChannelId={1}".format(vcmid, videoChannelId) Play(url, name, iconimage, quality)
def GetPlaylists(url): url = '{0}player/getplayerdata?rootId={1}'.format(apiUrl, channels[url]['rootId']) playlist = common.OpenURL(url, headers=headers, responseMethod='json') for item in playlist['musicChannels']: name = common.GetLabelColor(item['name'], keyColor="chColor") common.addDir(name, item['fileUrl'], 2, 'https://glz.co.il{0}'.format(item['playerImage']), infos={"Title": name}, module=module, isFolder=False, isPlayable=True)
def Play(name, url, iconimage, quality='best', live=None): text = common.OpenURL(url, headers=headers) match = re.compile('src:\s*"(.*?)"').findall(text) if len(match) < 0: match = re.compile('source\s*src="(.*?)"').findall(text) if len(match) < 0: match = re.compile("hls.loadSource\('(.*?)'\)").findall(text) if len(match) < 0 and live is not None: match = [live] link = common.GetRedirect(match[0], headers=headers) if link is None: link = common.GetStreams(match[0], headers=headers, quality=quality) final = '{0}|User-Agent={1}'.format(link, userAgent) common.PlayStream(final, quality, name, iconimage)
def GetPlayerKanUrl(url, headers={}, quality='best'): url = url.replace('https', 'http') i = url.rfind('http://') if i > 0: url = url[i:] url = url.replace('HLS/HLS', 'HLS') text = common.OpenURL(url, headers=headers) if 'ByPlayer' in url: match = re.compile('bynetURL:\s*"(.*?)"').findall(text) if len(match) == 0: match = re.compile('"UrlRedirector":"(.*?)"').findall(text) link = match[0].replace('https', 'http').replace('\u0026', '&') elif len(re.compile('media\.(ma)?kan\.org\.il').findall(url)) > 0: match = re.compile('hls:\s*?"(.*?)"').findall(text) link = match[0] elif 'kaltura' in url: text = common.OpenURL(url, headers=headers) match = re.compile( 'window\.kalturaIframePackageData\s*=\s*{(.*?)};').findall(text) result = json.loads('{' + match[0] + '}') link = result['entryResult']['meta']['hlsStreamUrl'] link = common.GetStreams(link, headers=headers, quality=quality) else: match = re.compile("var\s*metadataURL\s*?=\s*?'(.+?)'").findall(text) text = common.OpenURL(match[0].replace('https_streaming=true', 'https_streaming=false'), headers=headers) match = re.compile("<SmilURL.*>(.+)</SmilURL>").findall(text) smil = match[0].replace('amp;', '') match = re.compile( "<Server priority=['\"]1['\"]>(.+)</Server>").findall(text) server = match[0] link = common.urlunparse( common.url_parse(smil)._replace(netloc=server)) if 'api.bynetcdn.com/Redirector' not in link: link = common.GetStreams(link, headers=headers, quality=quality) return '{0}|User-Agent={1}'.format(link, userAgent)
def WatchLive(name='', iconimage='', quality='best'): url = 'http://walla-metadata-rr-d.vidnt.com/live/walla/ulpan/hls/metadata.xml' text = common.OpenURL(baseUrl, headers=headers) match = re.compile('id="iframePlayer"\s*src="(.*?)"').findall(text) if len(match) > 0: text = common.OpenURL('{0}{1}'.format(baseUrl, match[0]), headers=headers) match = re.compile("data-player='(.*?)'").findall(text) if len(match) > 0: jsn = json.loads(match[0]) liveStream = jsn.get('liveStream', 'ulpan') url = 'http://walla-metadata-rr-d.vidnt.com/live/walla/{0}/hls/metadata.xml'.format( liveStream) text = common.OpenURL(url, headers=headers) if quality == 'best': #match = re.compile('FileURL bitrate="(\d*)".*?>\s*(.*?)\s*</FileURL>').findall(text) #url = match[-1][1].replace('amp;', '') resolutions = [ x for x in re.compile( 'FileURL bitrate="(\d*)".*?>\s*(.*?)\s*</FileURL>').findall( text) ] resolutions = sorted(resolutions, key=lambda resolutions: int(resolutions[0]), reverse=True) url = resolutions[0][1].replace('amp;', '') else: match = re.compile("<SmilURL.*>(.*?)</SmilURL>").findall(text) url = match[0].replace('amp;', '') match = re.compile("<Server priority=['\"]1['\"]>(.+)</Server>").findall( text) server = match[0] link = common.urlunparse(common.url_parse(url)._replace(netloc=server)) link = common.GetStreams(link, headers=headers, quality=quality) common.PlayStream('{0}|User-Agent={1}'.format(link, userAgent), quality, name, iconimage)
def GetCategoriesList(iconimage): url = '{0}/vod/'.format(baseUrl) text = common.OpenURL(url) matches = re.compile(u'<div class="vod-slider">(.*?)<div class="tab-content">', re.S).findall(text) grids_arr = [] for match in matches: category = re.compile(u'<h2.*?>(.*?)</h2>.*?<a.*?href="(.*?)"', re.S).findall(match) if len(category) < 1: continue name, link = category[0] name = common.GetLabelColor(name.strip(), keyColor="prColor", bold=True) grids_arr.append((name, link)) grids_sorted = grids_arr if sortBy == 0 else sorted(grids_arr,key=lambda grids_arr: grids_arr[0]) for name, link in grids_sorted: common.addDir(name, '{0}/vod/{1}'.format(baseUrl, link), 1, iconimage, infos={"Title": name}, module=module)
def WatchLive(url, name='', iconimage='', quality='best', type='video'): channels = { '11': '{0}/live/tv.aspx?stationid=2'.format(baseUrl), '11c': '{0}/live/tv.aspx?stationid=23'.format(baseUrl), '23': '{0}/live/tv.aspx?stationid=20'.format(baseUrl), '33': 'https://www.makan.org.il/live/tv.aspx?stationid=3', 'kan4K': '{0}/live/tv.aspx?stationid=18'.format(baseUrl), 'wfb2019': '{0}/Item/?itemId=53195'.format(baseUrl), 'yfb2019': '{0}/Item/?itemId=52450'.format(baseUrl), 'bet': '{0}/radio/player.aspx?stationId=3'.format(baseUrl), 'gimel': '{0}/radio/player.aspx?stationid=9'.format(baseUrl), 'culture': '{0}/radio/player.aspx?stationid=5'.format(baseUrl), '88': '{0}/radio/player.aspx?stationid=4'.format(baseUrl), 'moreshet': '{0}/radio/player.aspx?stationid=6'.format(baseUrl), 'music': '{0}/radio/player.aspx?stationid=7'.format(baseUrl), 'kankids': 'https://www.kankids.org.il/radio/radio-kids.aspx', 'reka': '{0}/radio/player.aspx?stationid=10'.format(baseUrl), 'makan': '{0}/radio/player.aspx?stationId=13'.format(baseUrl) #'persian': 'http://farsi.kan.org.il/', #'nos': '{0}/radio/radio-nos.aspx'.format(baseUrl), #'oriental': '{0}/radio/oriental.aspx'.format(baseUrl), #'international': '{0}/radio/radio-international.aspx'.format(baseUrl) } channelUrl = channels[url] text = common.OpenURL(channelUrl, headers=headers) if text is None: return if url == 'persian': match = re.compile('id="playerFrame".*?src="(.*?)"', re.S).findall(text) elif '?itemId=' in channelUrl: match = re.compile( '<div class=\'videoWrapper\'><iframe.*?src="(.*?)"').findall(text) elif type == 'video': match = re.compile( '<iframe.*class="embedly-embed".*src="(.+?)"').findall(text) else: match = re.compile('<div class="player_content">.*?iframe src="(.*?)"', re.S).findall(text) if len(match) == 0: match = re.compile('iframeLink\s*?=\s*?"(.*?)"').findall(text) if 'dailymotion' in match[0]: id = re.compile('.*?video/(.*?)\?').findall(match[0]) link = 'plugin://plugin.video.dailymotion_com/?url={0}&mode=playLiveVideo'.format( id[0]) else: link = GetPlayerKanUrl(match[0], headers=headers, quality=quality) common.PlayStream(link, quality, name, iconimage)
def WatchLive(url, name='', iconimage='', quality='best'): link = channels[url]['live'] try: url = '{0}player/getplayerdata?rootId={1}'.format( apiUrl, channels[url]['rootId']) data = common.OpenURL(url, headers=headers, responseMethod='json') liveBroadcast = data['liveBroadcast']['fileUrl'] if liveBroadcast is not None: liveBroadcast = common.GetRedirect( data['liveBroadcast']['fileUrl'], headers=headers) if liveBroadcast is not None: link = liveBroadcast except Exception as ex: xbmc.log(str(ex), 3) final = '{0}|User-Agent={1}'.format(link, userAgent) common.PlayStream(final, quality, name, iconimage)
def GetPlaylists(cat): text = common.OpenURL('http://digital.100fm.co.il/app/', headers=headers) playlist = json.loads(text) for item in playlist['stations']: if cat != 'content': if item.get('tag', '') == 'content': continue if cat == 'popular': if item.get('popular', '') != 'true': continue else: if item.get('popular', '') == 'true': continue else: if item.get('tag', '') != 'content': continue name = common.GetLabelColor(item['name'], keyColor="chColor") common.addDir(name, item['audio'], 2, item['cover'], infos={"Title": name, "Plot": item['description']}, module=module, isFolder=False, isPlayable=True)
def GetPlaylists(url): text = common.OpenURL(url) rss = common.XmlToDict(text) for item in rss['rss']['channel']['item']: name = common.GetLabelColor(item['title'], keyColor="chColor") image = GetImage( re.compile("src='(.+?)'").findall(item['description'])[0]) common.addDir(name, item['link'], 2, image, infos={ "Title": name, "Plot": item['itunes:summary'] }, module=module, isFolder=False, isPlayable=True)
def GetSeriesList(iconimage): text = common.OpenURL('{0}/allprograms'.format(baseUrl)) series = re.compile('<li class=".*?programs">(.*?)</li>', re.S).findall(text) for serie in series: matches = re.compile( 'href="(.*?)".*?"background\-image: url\((.*?)\)".*?title="(.*?)".*?"program_tv_title">(.*?)</.*?<div>(.*?)</', re.S).findall(serie) for link, image, actor, name, description in matches: name = common.GetLabelColor(name, keyColor="prColor", bold=True) common.addDir(name, '{0}{1}'.format(baseUrl, link), 1, '{0}{1}'.format(baseUrl, image), infos={ "Title": name, "Plot": description }, module=module)
def WatchLive(name='', iconimage='', quality='best'): try: headers = {"User-Agent": userAgent} #url = 'https://main.knesset.gov.il/News/Broadcast/Pages/default.aspx?pos=tv' #url = 'https://main.knesset.gov.il/_layouts/15/1037/CustomScripts/KnessetBroadcastLobby.js' url = 'https://main.knesset.gov.il/_layouts/15/1037/CustomScripts/KnessetMainScripts.js?v=9' text = common.OpenURL(url, headers=headers) #match = re.compile('pathChannelVideo = ko\.observable\("(.*?)"\);').findall(text) match = re.compile( "playerPlenumLiveMediaElement\.setSrc\('(.*?)'\);").findall(text) #url = common.GetRedirect(match[0], headers=headers) url = match[0] except Exception as ex: xbmc.log(str(ex), 3) if url is None or len(url) < 10: url = ' https://contact.gostreaming.tv/Knesset/myStream/playlist.m3u8' link = common.GetStreams(url, headers=headers, quality=quality) final = '{0}|User-Agent={1}'.format(link, userAgent) common.PlayStream(final, quality, name, iconimage)
def GetCategories(): text = common.OpenURL( 'http://eco99fm.maariv.co.il/RSS_MusicChannels_Index/') rss = common.XmlToDict(text) for item in rss['rss']['channel']['item']: name = common.GetLabelColor(item['title'], keyColor="prColor", bold=True) image = GetImage( re.compile("src='(.+?)'").findall(item['description'])[0]) common.addDir(name, item['link'], 1, image, infos={ "Title": name, "Plot": item['itunes:summary'] }, module=module)