def viewSimil(self): sPluginPath = cPluginHandler().getPluginPath() oInputParameterHandler = cInputParameterHandler() sCleanTitle = oInputParameterHandler.getValue( 'sFileName') if oInputParameterHandler.exist( 'sFileName') else xbmc.getInfoLabel( 'ListItem.Property(sCleanTitle)') sCat = oInputParameterHandler.getValue( 'sCat') if oInputParameterHandler.exist( 'sCat') else xbmc.getInfoLabel('ListItem.Property(sCat)') oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('searchtext', sCleanTitle) oOutputParameterHandler.addParameter('sCat', sCat) oOutputParameterHandler.addParameter('readdb', 'False') sParams = oOutputParameterHandler.getParameterAsUri() sTest = '%s?site=%s&function=%s&%s' % (sPluginPath, 'globalSearch', 'globalSearch', sParams) # Si lancé depuis la page Home de Kodi, il faut d'abord en sortir pour lancer la recherche if xbmc.getCondVisibility('Window.IsVisible(home)'): xbmc.executebuiltin('ActivateWindow(%d)' % (10028)) xbmc.executebuiltin('Container.Update(%s)' % sTest) return False
def showIptvSite(): oGui = cGui() # test f4mTester sPath = 'special://home/addons/plugin.video.f4mTester/default.py' if not xbmcvfs.exists(sPath) and not xbmc.getInfoLabel( 'system.buildversion')[0:2] >= '19': oGui.addText( SITE_IDENTIFIER, "[COLOR red]plugin.video.f4mTester: L'addon n'est pas présent[/COLOR]" ) liste = [] #liste.append(['IptvGratuit', 'iptv_gratuit']) #liste.append(['IptvSource', 'iptv_source']) #liste.append(['Iptv4Sat', 'iptv_four_sat']) #liste.append(['Daily Iptv List', 'daily_iptv_list']) #liste.append(['Extinf', 'iptv']) liste.append(['ChannelStream', 'channelstream']) oOutputParameterHandler = cOutputParameterHandler() for sTitle, fName in liste: oOutputParameterHandler.addParameter('siteUrl', 'http://venom') oGui.addDir(fName, 'load', sTitle, 'tv.png', oOutputParameterHandler) oGui.setEndOfDirectory()
def viewInfo(self): if addon().getSetting('information-view') == "false": from resources.lib.config import WindowsBoxes oInputParameterHandler = cInputParameterHandler() sCleanTitle = oInputParameterHandler.getValue( 'sFileName') if oInputParameterHandler.exist( 'sFileName') else xbmc.getInfoLabel( 'ListItem.Property(sCleanTitle)') sMeta = oInputParameterHandler.getValue( 'sMeta') if oInputParameterHandler.exist( 'sMeta') else xbmc.getInfoLabel('ListItem.Property(sMeta)') sYear = oInputParameterHandler.getValue( 'sYear') if oInputParameterHandler.exist( 'sYear') else xbmc.getInfoLabel('ListItem.Year') WindowsBoxes(sCleanTitle, sCleanTitle, sMeta, sYear) else: # On appel la fonction integrer a Kodi pour charger les infos. xbmc.executebuiltin('Action(Info)')
def play__(): # Lancer les liens oGui = cGui() oInputParameterHandler = cInputParameterHandler() sUrl = oInputParameterHandler.getValue('siteUrl').replace('P_L_U_S', '+') sTitle = oInputParameterHandler.getValue('sMovieTitle') sThumbnail = oInputParameterHandler.getValue('sThumbnail') sDesc = oInputParameterHandler.getValue('sDesc') # Special url with tag if '[' in sUrl and ']' in sUrl: sUrl = GetRealUrl(sUrl) elif not xbmc.getInfoLabel('system.buildversion')[0:2] >= '19': stype = '' if '.ts' in sUrl: stype = 'TSDOWNLOADER' elif '.m3u' in sUrl: pass if stype: from F4mProxy import f4mProxyHelper f4mp = f4mProxyHelper() xbmcplugin.endOfDirectory(int(sys.argv[1]), cacheToDisc=True) f4mp.playF4mLink(sUrl, sTitle, proxy=None, use_proxy_for_chunks=False, maxbitrate=0, simpleDownloader=True, auth=None, streamtype=stype, setResolved=True, swf=None, callbackpath='', callbackparam='', iconImage=sThumbnail) return if 'f4mTester' in sUrl: xbmc.executebuiltin('XBMC.RunPlugin(' + sUrl + ')') return # Bug specifique au flux france TV # eof detectedL elif 'ftven.fr' in sUrl: oGuiElement = cGuiElement() oGuiElement.setSiteName(SITE_IDENTIFIER) oGuiElement.setTitle(sTitle) sUrl = sUrl.replace(' ', '%20') oGuiElement.setMediaUrl(sUrl) oGuiElement.setThumbnail(sThumbnail) oGuiElement.setDescription(sDesc) oPlayer = cPlayer() oPlayer.clearPlayList() oPlayer.addItemToPlaylist(oGuiElement) oPlayer.startPlayer() else: oHoster = cHosterGui().checkHoster(sUrl) if (oHoster != False): oHoster.setDisplayName(sTitle) oHoster.setFileName(sTitle) cHosterGui().showHoster(oGui, oHoster, sUrl, sThumbnail) oGui.setEndOfDirectory()
def showWeb(infile=None): # Code qui s'occupe de liens TV du Web oGui = cGui() oInputParameterHandler = cInputParameterHandler() if infile is None: sUrl = oInputParameterHandler.getValue('siteUrl') playlist = parseM3U(sUrl=sUrl) else: playlist = parseM3U(infile=infile) if oInputParameterHandler.exist('AZ'): sAZ = oInputParameterHandler.getValue('AZ') string = filter(lambda t: t.title.strip().capitalize().startswith(sAZ), playlist) playlist = sorted(string, key=lambda t: t.title.strip().capitalize()) else: playlist = sorted(playlist, key=lambda t: t.title.strip().capitalize()) if not playlist: oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('siteUrl', 'http://') oGui.addText( SITE_IDENTIFIER, '[COLOR red]Problème de lecture avec la playlist[/COLOR]') else: total = len(playlist) progress_ = progress().VScreate(SITE_NAME) for track in playlist: progress_.VSupdate(progress_, total) if progress_.iscanceled(): break sThumb = track.icon if not sThumb: sThumb = 'tv.png' # les + ne peuvent pas passer url2 = track.path.replace('+', 'P_L_U_S') if not xbmc.getInfoLabel('system.buildversion')[0:2] >= '19': if '[' not in url2 and ']' not in url2 and '.m3u8' not in url2 and 'dailymotion' not in url2: url2 = 'plugin://plugin.video.f4mTester/?url=' + QuotePlus( url2) url2 += '&streamtype=TSDOWNLOADER&name=' + Quote( track.title) thumb = '/'.join([sRootArt, sThumb]) oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('siteUrl', url2) oOutputParameterHandler.addParameter('sMovieTitle', track.title) oOutputParameterHandler.addParameter('sThumbnail', thumb) oGuiElement = cGuiElement() oGuiElement.setSiteName(SITE_IDENTIFIER) oGuiElement.setFunction('play__') oGuiElement.setTitle(track.title) oGuiElement.setFileName(track.title) oGuiElement.setIcon('tv.png') oGuiElement.setMeta(0) oGuiElement.setThumbnail(thumb) oGuiElement.setDirectTvFanart() oGuiElement.setCat(6) oGui.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, SITE_IDENTIFIER, SITE_IDENTIFIER, 'direct_epg', 'Guide tv Direct') oGui.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, SITE_IDENTIFIER, SITE_IDENTIFIER, 'soir_epg', 'Guide tv Soir') oGui.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, SITE_IDENTIFIER, SITE_IDENTIFIER, 'enregistrement', 'Enregistrement') oGui.createContexMenuBookmark(oGuiElement, oOutputParameterHandler) oGui.addFolder(oGuiElement, oOutputParameterHandler) progress_.VSclose(progress_) oGui.setEndOfDirectory()
def parseM3U(sUrl=None, infile=None): # Traite les m3u local oGui = cGui() oInputParameterHandler = cInputParameterHandler() sUrl = oInputParameterHandler.getValue('siteUrl') if infile is None: if 'iptv4sat' in sUrl or '.zip' in sUrl: sHtmlContent = getHtml(sUrl) zip_files = ZipFile(io.BytesIO(sHtmlContent)) files = zip_files.namelist() oOutputParameterHandler = cOutputParameterHandler() for Title in files: oOutputParameterHandler.addParameter('sMovieTitle', Title) oOutputParameterHandler.addParameter('siteUrl', sUrl) oGui.addDir(SITE_IDENTIFIER, 'unZip', Title, 'tv.png', oOutputParameterHandler) oGui.setEndOfDirectory() return elif '#EXTM3U' not in sUrl: oRequestHandler = cRequestHandler(sUrl) oRequestHandler.addHeaderEntry('User-Agent', UA) inf = oRequestHandler.request() if 'drive.google' in inf: inf = unGoogleDrive(inf) inf = inf.split('\n') else: inf = infile else: inf = infile try: line = inf.readline() # Local variable 'line' value is not used ?? except: pass playlist = [] song = track(None, None, None, None) ValidEntry = False for line in inf: if xbmc.getInfoLabel('system.buildversion')[0:2] >= '19': try: line = line.decode('utf-8') except AttributeError: pass line = line.strip() if line.startswith('#EXTINF:'): length, title = line.split('#EXTINF:')[1].split(',', 1) try: licon = line.split('#EXTINF:')[1].partition('tvg-logo=')[2] icon = licon.split('"')[1] except: icon = 'tv.png' ValidEntry = True song = track(length, title, None, icon) elif (len(line) != 0): if ValidEntry and (not (line.startswith('!') or line.startswith('#'))): ValidEntry = False song.path = line playlist.append(song) song = track(None, None, None, None) try: inf.close() except: pass return playlist
# vStream https://github.com/Kodi-vStream/venom-xbmc-addons import re import base64 from Plugins.Extensions.IPTVPlayer.tsiplayer.addons.resources.lib import xbmc from Plugins.Extensions.IPTVPlayer.tsiplayer.addons.resources.lib.gui.hoster import cHosterGui from Plugins.Extensions.IPTVPlayer.tsiplayer.addons.resources.lib.gui.gui import cGui from Plugins.Extensions.IPTVPlayer.tsiplayer.addons.resources.lib.handler.inputParameterHandler import cInputParameterHandler from Plugins.Extensions.IPTVPlayer.tsiplayer.addons.resources.lib.handler.outputParameterHandler import cOutputParameterHandler from Plugins.Extensions.IPTVPlayer.tsiplayer.addons.resources.lib.handler.requestHandler import cRequestHandler from Plugins.Extensions.IPTVPlayer.tsiplayer.addons.resources.lib.parser import cParser from Plugins.Extensions.IPTVPlayer.tsiplayer.addons.resources.lib.comaddon import progress # Detecte si c'est Kodi 19 ou plus if xbmc.getInfoLabel('system.buildversion')[0:2] >= '19': isPython3 = True else: isPython3 = False UA = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0' SITE_IDENTIFIER = 'french_stream_com' SITE_NAME = 'French-stream' SITE_DESC = 'Films, Séries & Mangas en streaming' URL_MAIN = 'https://www.french-streaming.to/' # old 'https://www8.french-streaming.com/' # URL_SEARCH_MOVIES = (URL_MAIN + 'index.php?do=search&subaction=search&catlist[]=9&story=', 'showMovies') # URL_SEARCH_SERIES = (URL_MAIN + 'index.php?do=search&subaction=search&catlist[]=10&story=', 'showSeries') URL_SEARCH_MOVIES = (URL_MAIN + 'search/', 'showMovies')
def showMovies(sSearch=''): oGui = cGui() if sSearch: sUrl = URL_MAIN + 'search.php' oRequestHandler = cRequestHandler(sUrl) oRequestHandler.setRequestType(cRequestHandler.REQUEST_TYPE_POST) oRequestHandler.addParameters('q', Unquote(sSearch)) else: oInputParameterHandler = cInputParameterHandler() sUrl = oInputParameterHandler.getValue('siteUrl') oRequestHandler = cRequestHandler(sUrl) oRequestHandler.addHeaderEntry('Referer', URL_MAIN) sHtmlContent = oRequestHandler.request() if sSearch: sPattern = '<a href="([^"]+).+?url\((.+?)\).+?<div class="title"> (.+?) </div>' elif 'Annee/' in sUrl or '/ABC' in sUrl: sPattern = '<div class="table-movies-content.+?href="([^"]+).+?url\((.+?)\).+?<.i>.([^<]+)' elif 'genre/' in sUrl: sPattern = 'film-uno.+?href="([^"]+).+?data-src="([^"]+).+?alt="([^"]+)' else: sPattern = 'class="film-uno".+?href="([^"]+).+?data-src="([^"]+).+?alt="([^"]+).+?min.+?·([^<]+).+?short-story">([^<]*)' oParser = cParser() aResult = oParser.parse(sHtmlContent, sPattern) if (aResult[0] == False): oGui.addText(SITE_IDENTIFIER) if (aResult[0] == True): total = len(aResult[1]) progress_ = progress().VScreate(SITE_NAME) oOutputParameterHandler = cOutputParameterHandler() for aEntry in aResult[1]: progress_.VSupdate(progress_, total) if progress_.iscanceled(): break sUrl = aEntry[0] sThumb = aEntry[1] sTitle = aEntry[2] sDesc = '' if len(aEntry) > 3: if xbmc.getInfoLabel('system.buildversion')[0:2] >= '19': sQual = aEntry[3].split('·')[1].replace('Â', '').strip() sLang = aEntry[3].split('·')[2].strip() else: sQual = aEntry[3].split('·')[1].strip() sLang = aEntry[3].split('·')[2].strip() sDesc = aEntry[4] sDisplayTitle = ('%s [%s] (%s)') % (sTitle, sQual, sLang) else: sDisplayTitle = sTitle oOutputParameterHandler.addParameter('siteUrl', sUrl) oOutputParameterHandler.addParameter('sMovieTitle', sTitle) oOutputParameterHandler.addParameter('sThumb', sThumb) oOutputParameterHandler.addParameter('sDesc', sDesc) oGui.addMovie(SITE_IDENTIFIER, 'showHoster', sDisplayTitle, '', sThumb, sDesc, oOutputParameterHandler) progress_.VSclose(progress_) if not sSearch: sNextPage, sPaging = __checkForNextPage(sHtmlContent) if (sNextPage != False): oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('siteUrl', sNextPage) # sNumPage = re.search('(page|genre).*?[-=\/]([0-9]+)', sNextPage).group(2) # ou replace'.html',''; '([0-9]+)$' oGui.addNext(SITE_IDENTIFIER, 'showMovies', 'Page ' + sPaging, oOutputParameterHandler) oGui.setEndOfDirectory()