def showSearchEntries(entryUrl=False, sGui=False): oGui = sGui if sGui else cGui() params = ParameterHandler() if not entryUrl: entryUrl = params.getValue('sUrl') oRequest = cRequestHandler(entryUrl, ignoreErrors=(sGui is not False)) sHtmlContent = oRequest.request() sPattern = '"title":"([^"]+)","url":"([^"]+)","img":"([^"]+).*?date":"([^"]+)' isMatch, aResult = cParser.parse(sHtmlContent, sPattern) if not isMatch: if not sGui: oGui.showInfo('streamon', 'Es wurde kein Eintrag gefunden') return total = len(aResult) for sName, sUrl, sThumbnail, sYear in aResult: sThumbnail = sThumbnail.replace('\\/', '/').replace('\/', '/') sUrl = sUrl.replace('\\/', '/').replace('\/', '/') sThumbnail = re.sub('-\d+x\d+\.', '.', sThumbnail) if sThumbnail and not sThumbnail.startswith('http'): sThumbnail = URL_MAIN + sThumbnail isTvshow = True if "serie" in sUrl else False oGuiElement = cGuiElement(sName, SITE_IDENTIFIER, 'showSeasons' if isTvshow else 'showHosters') oGuiElement.setMediaType('tvshow' if isTvshow else 'movie') oGuiElement.setThumbnail(sThumbnail) oGuiElement.setYear(sYear) sUrl = cUtil.quotePlus(sUrl) params.setParam('entryUrl', sUrl) params.setParam('sName', sName) params.setParam('sThumbnail', sThumbnail) oGui.addFolder(oGuiElement, params, isTvshow, total)
def showEntries(entryUrl=False, sGui=False): oGui = sGui if sGui else cGui() params = ParameterHandler() if not entryUrl: entryUrl = params.getValue('sUrl') oRequest = cRequestHandler(entryUrl, ignoreErrors=(sGui is not False)) sHtmlContent = oRequest.request() sPattern = '<div[^>]*class="poster">.*?<img[^>]*src="([^"]+).*?<a[^>]*href="([^"]+)">([^<]+).*?(?:<span>([^<]+)?).*?<div[^>]*class="texto">([^<]+)' isMatch, aResult = cParser.parse(sHtmlContent, sPattern) if not isMatch: if not sGui: oGui.showInfo('streamon', 'Es wurde kein Eintrag gefunden') return total = len(aResult) for sThumbnail, sUrl, sName, sYear, sDesc in aResult: sThumbnail = re.sub('-\d+x\d+\.', '.', sThumbnail) isTvshow = True if "serien" in sUrl else False if sThumbnail and not sThumbnail.startswith('http'): sThumbnail = URL_MAIN + sThumbnail oGuiElement = cGuiElement(sName, SITE_IDENTIFIER, 'showSeasons' if isTvshow else 'showHosters') oGuiElement.setMediaType('tvshow' if isTvshow else 'movie') oGuiElement.setThumbnail(sThumbnail) if sYear: oGuiElement.setYear(sYear) oGuiElement.setDescription(sDesc) sUrl = cUtil.quotePlus(sUrl) if sUrl and not sUrl.startswith('http'): sUrl = URL_MAIN + sUrl params.setParam('entryUrl', sUrl) params.setParam('sName', sName) params.setParam('sThumbnail', sThumbnail) oGui.addFolder(oGuiElement, params, isTvshow, total) if not sGui: sPattern = '<div[^>]*class="resppages"><a[^>]*href="([^"]+)">' isMatchNextPage, sNextUrl = cParser.parseSingleResult( sHtmlContent, sPattern) if isMatchNextPage: if sNextUrl and not sNextUrl.startswith('http'): sNextUrl = URL_MAIN + sNextUrl params.setParam('sUrl', sNextUrl) oGui.addNextPage(SITE_IDENTIFIER, 'showEntries', params) oGui.setView('tvshows' if 'serien' in sUrl else 'movies') oGui.setEndOfDirectory()
def showSearchEntries(entryUrl=False, sGui=False): oGui = sGui if sGui else cGui() params = ParameterHandler() if not entryUrl: entryUrl = params.getValue('sUrl') sHtmlContent = __getContent(entryUrl) sPattern = '"title":"([^"]+)","url":"([^"]+)","img":"([^"]+).*?date":"([^"]+)' isMatch, aResult = cParser.parse(sHtmlContent, sPattern) if not isMatch: if not sGui: oGui.showInfo('streamon', 'Es wurde kein Eintrag gefunden') return total = len(aResult) for sName, sUrl, sThumbnail, sYear in aResult: sThumbnail = sThumbnail.replace('\\/', '/').replace('\/', '/') sUrl = sUrl.replace('\\/', '/').replace('\/', '/') sThumbnail = re.sub('-\d+x\d+\.', '.', sThumbnail) if sThumbnail and not sThumbnail.startswith('http'): sThumbnail = URL_MAIN + sThumbnail isTvshow = True if "serie" in sUrl else False sName = str_to_utf8(sName) oGuiElement = cGuiElement(sName, SITE_IDENTIFIER, 'showSeasons' if isTvshow else 'showHosters') oGuiElement.setMediaType('tvshow' if isTvshow else 'movie') oGuiElement.setThumbnail(sThumbnail) oGuiElement.setYear(sYear) sUrl = cUtil.quotePlus(sUrl) params.setParam('entryUrl', sUrl) params.setParam('sName', sName) params.setParam('sThumbnail', sThumbnail) oGui.addFolder(oGuiElement, params, isTvshow, total) if not sGui: sPattern = "span[^>]*class=[^>]*current[^>]*>.*?</span><a[^>]*href='([^']+)" isMatchNextPage, sNextUrl = cParser.parseSingleResult( sHtmlContent, sPattern) if isMatchNextPage: params.setParam('sUrl', sNextUrl) oGui.addNextPage(SITE_IDENTIFIER, 'showEntries', params) oGui.setView('tvshows' if 'serie' in sUrl else 'movies') oGui.setEndOfDirectory()
def showSearchEntries(entryUrl=False, sGui=False): oGui = sGui if sGui else cGui() params = ParameterHandler() if not entryUrl: entryUrl = params.getValue('sUrl') sHtmlContent = cRequestHandler(entryUrl).request() pattern = '2"><a[^>]href="([^"]+)"><img[^>]src="([^"]+)" alt="([^"]+).*?<span[^>]class="year">([\d]+)<.*?(?:<div[^>]class="contenido"><p>([^<]+)?)' isMatch, aResult = cParser.parse(sHtmlContent, pattern) if not isMatch: if not sGui: oGui.showInfo('streamon', 'Es wurde kein Eintrag gefunden') return total = len(aResult) for sUrl, sThumbnail, sName, sYear, sDesc in aResult: sThumbnail = re.sub('-\d+x\d+\.', '.', sThumbnail) if sThumbnail and not sThumbnail.startswith('http'): sThumbnail = URL_MAIN + sThumbnail isTvshow = True if "serie" in sUrl else False oGuiElement = cGuiElement(sName, SITE_IDENTIFIER, 'showSeasons' if isTvshow else 'showHosters') oGuiElement.setMediaType('tvshow' if isTvshow else 'movie') oGuiElement.setThumbnail(sThumbnail) oGuiElement.setFanart(sThumbnail) oGuiElement.setYear(sYear) oGuiElement.setDescription(sDesc) sUrl = cUtil.quotePlus(sUrl) params.setParam('entryUrl', sUrl) params.setParam('sName', sName) params.setParam('sThumbnail', sThumbnail) oGui.addFolder(oGuiElement, params, isTvshow, total) if not sGui: pattern = "span[^>]*class=[^>]*current[^>]*>.*?</span><a[^>]*href='([^']+)" isMatchNextPage, sNextUrl = cParser.parseSingleResult( sHtmlContent, pattern) if isMatchNextPage: params.setParam('sUrl', sNextUrl) oGui.addNextPage(SITE_IDENTIFIER, 'showSearchEntries', params) oGui.setView('tvshows' if 'serie' in sUrl else 'movies') oGui.setEndOfDirectory()