Skip to content

Commit

Permalink
Remise à niveau des sources
Browse files Browse the repository at this point in the history
  • Loading branch information
sizanic committed Sep 11, 2022
1 parent 109064f commit 1024a61
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 31 deletions.
2 changes: 2 additions & 0 deletions plugin.video.vstream/resources/lib/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def searchGlobal(self, sSearchText = '', sCat = ''):
sSearchText = oInputParameterHandler.getValue('searchtext')
sCat = oInputParameterHandler.getValue('sCat')

sSearchText = sSearchText.replace(':', ' ')

listPlugins = self._initSearch(sSearchText, sCat)

if len(listPlugins) == 0:
Expand Down
2 changes: 1 addition & 1 deletion plugin.video.vstream/resources/sites.json
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,6 @@
"label": "Zone Streaming",
"active": "True",
"url": "http://www.zone-streaming.fr/"
},
}
}
}
18 changes: 13 additions & 5 deletions plugin.video.vstream/resources/sites/_4kstreamz.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from resources.lib.handler.requestHandler import cRequestHandler
from resources.lib.parser import cParser
from resources.lib.comaddon import siteManager
from resources.lib.util import cUtil

SITE_IDENTIFIER = '_4kstreamz'
SITE_NAME = '4kstreamz'
Expand Down Expand Up @@ -144,6 +145,10 @@ def showMovies(sSearch=''):
oInputParameterHandler = cInputParameterHandler()
sUrl = oInputParameterHandler.getValue('siteUrl')
if sSearch:
oUtil = cUtil()
sSearchText = sSearch.replace(URL_SEARCH_MOVIES[0], '')
sSearchText = sSearchText.replace(URL_SEARCH_SERIES[0], '')
sSearchText = oUtil.CleanName(sSearchText)
sUrl = sSearch.replace(' ', '-').replace('%20', '-') + '.html'
oRequestHandler = cRequestHandler(sUrl)
sHtmlContent = oRequestHandler.request()
Expand All @@ -154,10 +159,7 @@ def showMovies(sSearch=''):
sPattern = '<a class="movie_single.+?href="([^"]+).+?img src="([^"]+).+?class="nop">([^<]+)'

aResult = oParser.parse(sHtmlContent, sPattern)
if aResult[0] is False:
oGui.addText(SITE_IDENTIFIER)

if aResult[0] is True:
if aResult[0]:
oOutputParameterHandler = cOutputParameterHandler()
for aEntry in aResult[1]:
sUrl2 = aEntry[0]
Expand All @@ -169,6 +171,10 @@ def showMovies(sSearch=''):
sThumb = URL_MAIN[:-1] + sThumb

sTitle = aEntry[2].strip()
if sSearch:
if not oUtil.CheckOccurence(sSearchText, sTitle):
continue # Filtre de recherche

sQual = ''
sDesc = ''
if 'list-films.html' in sUrl or '/films/page' in sUrl:
Expand All @@ -187,7 +193,9 @@ def showMovies(sSearch=''):
oGui.addMovie(SITE_IDENTIFIER, 'showLinks', sDisplayTitle, '', sThumb, sDesc, oOutputParameterHandler)
else:
oGui.addTV(SITE_IDENTIFIER, 'showSaisons', sDisplayTitle, '', sThumb, sDesc, oOutputParameterHandler)

else:
oGui.addText(SITE_IDENTIFIER)

if not sSearch:
sNextPage, sPaging = __checkForNextPage(sHtmlContent)
if sNextPage is not False:
Expand Down
16 changes: 12 additions & 4 deletions plugin.video.vstream/resources/sites/ducine.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from resources.lib.handler.outputParameterHandler import cOutputParameterHandler
from resources.lib.handler.requestHandler import cRequestHandler
from resources.lib.parser import cParser
from resources.lib.util import cUtil

SITE_IDENTIFIER = 'ducine'
SITE_NAME = 'Du Ciné'
Expand Down Expand Up @@ -144,6 +145,10 @@ def showMovies(sSearch=''):
oGui = cGui()

if sSearch:
oUtil = cUtil()
sSearchText = sSearch.replace(URL_SEARCH_MOVIES[0], '')
sSearchText = sSearchText.replace(URL_SEARCH_SERIES[0], '')
sSearchText = oUtil.CleanName(sSearchText)
sUrl = sSearch.replace(' ', '+')
else:
oInputParameterHandler = cInputParameterHandler()
Expand All @@ -156,16 +161,17 @@ def showMovies(sSearch=''):
oParser = cParser()
aResult = oParser.parse(sHtmlContent, sPattern)

if aResult[0] is False:
oGui.addText(SITE_IDENTIFIER)

if aResult[0] is True:
if aResult[0]:
oOutputParameterHandler = cOutputParameterHandler()
for aEntry in aResult[1]:
sUrl = aEntry[0]
sThumb = URL_MAIN[:-1] + aEntry[1]
sTitle = aEntry[3]

if sSearch:
if not oUtil.CheckOccurence(sSearchText, sTitle):
continue # Filtre de recherche

oOutputParameterHandler.addParameter('siteUrl', sUrl)
oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
oOutputParameterHandler.addParameter('sThumb', sThumb)
Expand All @@ -174,6 +180,8 @@ def showMovies(sSearch=''):
else:
sTitle = sTitle + ' [' + aEntry[2] + ']'
oGui.addMovie(SITE_IDENTIFIER, 'showHosters', sTitle, '', sThumb, '', oOutputParameterHandler)
else:
oGui.addText(SITE_IDENTIFIER)

if not sSearch:
sNextPage, sPaging = __checkForNextPage(sHtmlContent)
Expand Down
8 changes: 8 additions & 0 deletions plugin.video.vstream/resources/sites/enstream_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from resources.lib.handler.outputParameterHandler import cOutputParameterHandler
from resources.lib.handler.requestHandler import cRequestHandler
from resources.lib.parser import cParser
from resources.lib.util import cUtil

SITE_IDENTIFIER = 'enstream_series'
SITE_NAME = 'Enstream (Séries)'
Expand Down Expand Up @@ -109,6 +110,9 @@ def showSeries(sSearch=''):
oGui = cGui()

if sSearch:
oUtil = cUtil()
sSearchText = sSearch.replace(URL_SEARCH_SERIES[0], '')
sSearchText = oUtil.CleanName(sSearchText)
sUrl = sSearch.replace(' ', '+')
else:
oInputParameterHandler = cInputParameterHandler()
Expand All @@ -130,6 +134,10 @@ def showSeries(sSearch=''):
sTitle = aEntry[1]
sThumb = aEntry[2]

if sSearch:
if not oUtil.CheckOccurence(sSearchText, sTitle):
continue # Filtre de recherche

oOutputParameterHandler.addParameter('siteUrl', sUrl)
oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
oOutputParameterHandler.addParameter('sThumb', sThumb)
Expand Down
16 changes: 11 additions & 5 deletions plugin.video.vstream/resources/sites/serie_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from resources.lib.handler.outputParameterHandler import cOutputParameterHandler
from resources.lib.handler.requestHandler import cRequestHandler
from resources.lib.parser import cParser
from resources.lib.util import cUtil

SITE_IDENTIFIER = 'serie_streaming'
SITE_NAME = 'Série Streaming'
Expand Down Expand Up @@ -83,6 +84,9 @@ def showSeries(sSearch=''):
oGui = cGui()

if sSearch:
oUtil = cUtil()
sSearchText = sSearch.replace(URL_SEARCH_SERIES[0], '')
sSearchText = oUtil.CleanName(sSearchText)
sUrl = sSearch.replace(' ', '+')
reqType = cRequestHandler.REQUEST_TYPE_POST
sPattern = 'href="([^"]+).+?image: url\((.+?)"title">([^<]+)'
Expand All @@ -104,21 +108,23 @@ def showSeries(sSearch=''):
oParser = cParser()
aResult = oParser.parse(sHtmlContent, sPattern)

if (aResult[0] == False):
oGui.addText(SITE_IDENTIFIER)

if (aResult[0] == True):
if aResult[0]:
oOutputParameterHandler = cOutputParameterHandler()
for aEntry in aResult[1]:
sUrl = aEntry[idxUrl]
sTitle = aEntry[idxTitle].strip()
sThumb = 'https:' + aEntry[idxThumb].replace('posters//tv', 'posters/tv')

if sSearch:
if not oUtil.CheckOccurence(sSearchText, sTitle):
continue # Filtre de recherche
oOutputParameterHandler.addParameter('siteUrl', sUrl)
oOutputParameterHandler.addParameter('sThumb', sThumb)
oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
oGui.addTV(SITE_IDENTIFIER, 'showSaisons', sTitle, '', sThumb, '', oOutputParameterHandler)

else:
oGui.addText(SITE_IDENTIFIER)

if not sSearch:
sNextPage, sPaging = __checkForNextPage(sHtmlContent)
if (sNextPage != False):
Expand Down
15 changes: 11 additions & 4 deletions plugin.video.vstream/resources/sites/series_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from resources.lib.handler.outputParameterHandler import cOutputParameterHandler
from resources.lib.handler.requestHandler import cRequestHandler
from resources.lib.parser import cParser
from resources.lib.util import cUtil

SITE_IDENTIFIER = 'series_stream'
SITE_NAME = 'Séries Stream'
Expand Down Expand Up @@ -110,6 +111,9 @@ def showSeries(sSearch=''):
oGui = cGui()

if sSearch:
oUtil = cUtil()
sSearchText = sSearch.replace(URL_SEARCH_SERIES[0], '')
sSearchText = oUtil.CleanName(sSearchText)
sUrl = sSearch.replace(' ', '+')
else:
oInputParameterHandler = cInputParameterHandler()
Expand All @@ -121,21 +125,24 @@ def showSeries(sSearch=''):
oParser = cParser()
aResult = oParser.parse(sHtmlContent, sPattern)

if aResult[0] is False:
oGui.addText(SITE_IDENTIFIER)

if aResult[0] is True:
oOutputParameterHandler = cOutputParameterHandler()
for aEntry in aResult[1]:
sUrl = URL_MAIN[:-1] + aEntry[0]
sThumb = URL_MAIN[:-1] + aEntry[1]
sTitle = aEntry[2]

if sSearch:
if not oUtil.CheckOccurence(sSearchText, sTitle):
continue # Filtre de recherche

oOutputParameterHandler.addParameter('siteUrl', sUrl)
oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
oOutputParameterHandler.addParameter('sThumb', sThumb)
oGui.addTV(SITE_IDENTIFIER, 'showSaisons', sTitle, '', sThumb, '', oOutputParameterHandler)

else:
oGui.addText(SITE_IDENTIFIER)

if not sSearch:
sNextPage, sPaging = __checkForNextPage(sHtmlContent)
if sNextPage != False:
Expand Down
7 changes: 3 additions & 4 deletions plugin.video.vstream/resources/sites/vf_film.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@ def showMovies(sSearch=''):
oParser = cParser()
aResult = oParser.parse(sHtmlContent, sPattern)

if aResult[0] is False:
oGui.addText(SITE_IDENTIFIER)

if aResult[0] is True:
oOutputParameterHandler = cOutputParameterHandler()
for aEntry in aResult[1]:
Expand All @@ -136,7 +133,9 @@ def showMovies(sSearch=''):
oOutputParameterHandler.addParameter('sDesc', sDesc)
oOutputParameterHandler.addParameter('sYear', sYear)
oGui.addMovie(SITE_IDENTIFIER, 'showHoster', sDisplayTitle, '', sThumb, sDesc, oOutputParameterHandler)

else:
oGui.addText(SITE_IDENTIFIER)

if not sSearch:
sNextPage, sPaging = __checkForNextPage(sHtmlContent)
if sNextPage != False:
Expand Down
15 changes: 11 additions & 4 deletions plugin.video.vstream/resources/sites/voirseries_best.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from resources.lib.handler.requestHandler import cRequestHandler
from resources.lib.parser import cParser
from resources.lib.comaddon import siteManager
from resources.lib.util import cUtil

SITE_IDENTIFIER = 'voirseries_best'
SITE_NAME = 'VoirSeries'
Expand Down Expand Up @@ -177,6 +178,9 @@ def showSeries(sSearch=''):
oGui = cGui()
oParser = cParser()
if sSearch:
oUtil = cUtil()
sSearchText = sSearch.replace(URL_SEARCH_SERIES[0], '')
sSearchText = oUtil.CleanName(sSearchText)
sUrl = sSearch.replace(' ', '+').replace('%20', '+') + '&submit='
else:
oInputParameterHandler = cInputParameterHandler()
Expand All @@ -187,15 +191,16 @@ def showSeries(sSearch=''):
sPattern = 'class=shortstory>.+?href=([^ ]+).+?data-src=([^ ]+).+?>([^<]+)</a>'
aResult = oParser.parse(sHtmlContent, sPattern)

if aResult[0] is False:
oGui.addText(SITE_IDENTIFIER)

if aResult[0] is True:
if aResult[0]:
oOutputParameterHandler = cOutputParameterHandler()
for aEntry in aResult[1]:
sUrl = aEntry[0]
sThumb = aEntry[1]
sTitle = aEntry[2]

if sSearch:
if not oUtil.CheckOccurence(sSearchText, sTitle):
continue # Filtre de recherche

oOutputParameterHandler.addParameter('siteUrl', sUrl)
oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
Expand All @@ -204,6 +209,8 @@ def showSeries(sSearch=''):
oGui.addTV(SITE_IDENTIFIER, 'showEpisodes', sTitle, '', sThumb, '', oOutputParameterHandler)
else:
oGui.addTV(SITE_IDENTIFIER, 'showSaisons', sTitle, '', sThumb, '', oOutputParameterHandler)
else:
oGui.addText(SITE_IDENTIFIER)

if not sSearch:
sNextPage, sPaging = __checkForNextPage(sHtmlContent)
Expand Down
14 changes: 10 additions & 4 deletions plugin.video.vstream/resources/sites/wiflix.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,7 @@ def showMovies(sSearch=''):
sPattern += 'ml-desc"> (?:([0-9]+)| )</div.+?Synopsis:.+?ml-desc">(.*?)</div'
aResult = oParser.parse(sHtmlContent, sPattern)

if aResult[0] is False:
oGui.addText(SITE_IDENTIFIER)

if aResult[0] is True:
if aResult[0]:
oOutputParameterHandler = cOutputParameterHandler()

for aEntry in aResult[1]:
Expand Down Expand Up @@ -202,6 +199,8 @@ def showMovies(sSearch=''):
oOutputParameterHandler = cOutputParameterHandler()
oOutputParameterHandler.addParameter('siteUrl', sNextPage)
oGui.addNext(SITE_IDENTIFIER, 'showMovies', 'Page ' + sPaging, oOutputParameterHandler)
else:
oGui.addText(SITE_IDENTIFIER)

if not sSearch:
oGui.setEndOfDirectory()
Expand All @@ -226,6 +225,8 @@ def showSeries(sSearch=''):
oParser = cParser()

if sSearch:
oUtil = cUtil()
sSearchText = oUtil.CleanName(sSearch.replace('%20', ' '))
sUrl = sSearch.replace(' ', '+')

pdata = 'do=search&subaction=search&story=' + sUrl + '&titleonly=3&all_word_seach=1&catlist[]=31&catlist[]=35'
Expand Down Expand Up @@ -258,6 +259,11 @@ def showSeries(sSearch=''):
sThumb = URL_MAIN[:-1] + aEntry[0]

sTitle = aEntry[1].replace('- Saison', 'saison').replace(' wiflix', '')

# Filtre de recherche
if sSearch and not oUtil.CheckOccurence(sSearchText, sTitle):
continue

# sLang = re.sub('Saison \d+', '', aEntry[3]).replace(' ', '')
sDisplayTitle = sTitle
sUrl = aEntry[2]
Expand Down

0 comments on commit 1024a61

Please sign in to comment.