Advertisement
Guest User

Untitled

a guest
Sep 24th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 44.60 KB | None | 0 0
  1. #-*- coding: utf-8 -*-
  2. #Vstream https://github.com/Kodi-vStream/venom-xbmc-addons
  3. # Ovni-crea
  4. from resources.lib.gui.hoster import cHosterGui #systeme de recherche pour l'hote
  5. from resources.lib.gui.gui import cGui #systeme d'affichage pour xbmc
  6. from resources.lib.handler.inputParameterHandler import cInputParameterHandler #entree des parametres
  7. from resources.lib.handler.outputParameterHandler import cOutputParameterHandler #sortie des parametres
  8. from resources.lib.handler.requestHandler import cRequestHandler #requete url
  9. from resources.lib.parser import cParser #recherche de code
  10. from resources.lib.comaddon import progress, VSlog, xbmc #import du dialog progress
  11. from resources.lib.util import cUtil #import du plugin cUtil
  12. import re,urllib,urllib2
  13. import base64
  14.  
  15. from resources.lib.packer import cPacker
  16.  
  17. SITE_IDENTIFIER = 'livetv'
  18. SITE_NAME = 'Livetv.sx'
  19. SITE_DESC = 'Site pour regarder du sport en direct gratuitement'
  20.  
  21. URL_MAIN = 'http://livetv.sx'
  22. URL_MAIN2 = 'http://cdn.livetvcdn.net'
  23. URL_SEARCH = (URL_MAIN + '/frx/fanclubs/?q=', 'showMovies4')
  24. FUNCTION_SEARCH = 'showMovies4'
  25.  
  26. SPORT_SPORTS = (URL_MAIN + '/frx/allupcoming/', 'showMovies') #Les matchs en directs
  27. SPORT_SPORTSCLASS = (URL_MAIN + '/frx/calendar/411/', 'showClass')# Les classements
  28. NETS_GENRES = (True, 'showGenres') #Les clubs de football
  29. UA = 'Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)'
  30.  
  31. def load():
  32. oGui = cGui()
  33.  
  34. oOutputParameterHandler = cOutputParameterHandler()
  35. oOutputParameterHandler.addParameter('siteUrl', 'http://venom/')
  36. oGui.addDir(SITE_IDENTIFIER, 'showSearch', 'Rechercher l équipe', 'search.png', oOutputParameterHandler)
  37.  
  38. oOutputParameterHandler = cOutputParameterHandler()
  39. oOutputParameterHandler.addParameter('siteUrl', SPORT_SPORTS[0])
  40. oGui.addDir(SITE_IDENTIFIER, SPORT_SPORTS[1], 'Les matchs en direct', 'news.png', oOutputParameterHandler)
  41.  
  42. oOutputParameterHandler = cOutputParameterHandler()
  43. oOutputParameterHandler.addParameter('siteUrl', NETS_GENRES[0])
  44. oGui.addDir(SITE_IDENTIFIER, NETS_GENRES[1], 'Les clubs de foot', 'genres.png', oOutputParameterHandler)
  45.  
  46. oOutputParameterHandler = cOutputParameterHandler()
  47. oOutputParameterHandler.addParameter('siteUrl', SPORT_SPORTSCLASS[0])
  48. oGui.addDir(SITE_IDENTIFIER, SPORT_SPORTSCLASS[1], 'les classemens des ligues', 'news.png', oOutputParameterHandler)
  49.  
  50. oGui.setEndOfDirectory()
  51.  
  52. def showSearch():
  53. oGui = cGui()
  54.  
  55. sSearchText = oGui.showKeyBoard()
  56. if (sSearchText != False):
  57. sUrl = URL_SEARCH[0] + sSearchText
  58. showMovies4(sUrl) #showMovies4 car c'est pour afficher le club recherché'
  59. oGui.setEndOfDirectory()
  60. return
  61.  
  62.  
  63. def showGenres(): #affiche les clubs de foot
  64. oGui = cGui()
  65.  
  66. liste = []
  67. liste.append( ['PSG', URL_MAIN + '/frx/team/1_4_216_psg/fanclub/'] )
  68. liste.append( ['Marseille (OM)', URL_MAIN + '/frx/team/1_310_383_marseille/fanclub/'] )
  69. liste.append( ['Barcelone', URL_MAIN + '/frx/team/1_3_227_barcelona/fanclub/'] )
  70. liste.append( ['Real-Madrid', URL_MAIN + '/frx/team/1_163_317_real_madrid/fanclub/'] )
  71. liste.append( ['Marchester Utd', URL_MAIN + '/frx/team/1_350_421_manchester_utd/fanclub/'] )
  72. liste.append( ['Chelsea', URL_MAIN + '/frx/team/1_351_397_chelsea/fanclub/'] )
  73. liste.append( ['Bayern Munich', URL_MAIN + '/frx/team/1_5_227_bayern/fanclub/'] )
  74. liste.append( ['Juventus', URL_MAIN + '/frx/team/1_244_365_juventus/fanclub/'] )
  75. liste.append( ['Arsenal', URL_MAIN + '/frx/team/1_353_406_arsenal/fanclub/'] )
  76. liste.append( ['Liverpool', URL_MAIN + '/frx/team/1_352_412_liverpool/fanclub/'] )
  77. liste.append( ['Manchester City', URL_MAIN + '/frx/team/1_363_446_manchester_city/fanclub/'] )
  78. liste.append( ['France', URL_MAIN + '/frx/team/1_77_258_france/fanclub/'] )
  79. liste.append( ['Dortmund', URL_MAIN + '/frx/team/1_136_296_dortmund/fanclub/'] )
  80. liste.append( ['Monaco', URL_MAIN + '/frx/team/1_319_383_monaco/fanclub/'] )
  81. liste.append( ['Portugal', URL_MAIN + '/frx/team/1_79_269_portugal/fanclub/'] )
  82. liste.append( ['Argentine', URL_MAIN + '/frx/team/1_62_253_argentina/fanclub/'] )
  83. liste.append( ['Belgique', URL_MAIN + '/frx/team/1_83_270_belgium/fanclub/'] )
  84.  
  85. for sTitle, sUrl in liste:
  86.  
  87. oOutputParameterHandler = cOutputParameterHandler()
  88. oOutputParameterHandler.addParameter('siteUrl', sUrl)
  89. oGui.addDir(SITE_IDENTIFIER, 'showMenu', sTitle, 'genres.png', oOutputParameterHandler)
  90. #showMenu car c'est pour afficher les infos du club seul resultat est fonctionnel pour l'instant''
  91.  
  92. oGui.setEndOfDirectory()
  93.  
  94. def showMovies(sSearch = ''):#affiche les catégories qui on des lives'
  95. oGui = cGui()
  96. if sSearch:
  97. sUrl = sSearch
  98. else:
  99. oInputParameterHandler = cInputParameterHandler()
  100. sUrl = oInputParameterHandler.getValue('siteUrl')
  101.  
  102. oRequestHandler = cRequestHandler(sUrl)
  103. sHtmlContent = oRequestHandler.request()
  104.  
  105. sPattern = '<a class="main" href="([^"]+)"><b>([^"]+)</b>.+?\s*</td>\s*<td width=.+?>\s*<a class="small" href=".+?"><b>([^"]+)</b></a>'
  106.  
  107. oParser = cParser()
  108. aResult = oParser.parse(sHtmlContent, sPattern)
  109. #VSlog(str(aResult))
  110.  
  111. if (aResult[0] == False):
  112. oGui.addText(SITE_IDENTIFIER)
  113.  
  114. if (aResult[0] == True):
  115. total = len(aResult[1])
  116. progress_ = progress().VScreate(SITE_NAME)
  117.  
  118. for aEntry in aResult[1]:
  119. progress_.VSupdate(progress_, total)
  120. if progress_.iscanceled():
  121. break
  122.  
  123. sTitle = str(aEntry[1])
  124. sUrl2 = str(aEntry[0])
  125. sThumb = ''
  126. #sLang = str(aEntry[3])
  127. #sQual = str(aEntry[4])
  128. sHoster = str(aEntry[2])
  129. sDesc = ''
  130.  
  131. sTitle = sTitle.decode("iso-8859-1", 'ignore')
  132. sTitle = sTitle.encode("utf-8", 'ignore')
  133. sTitle = ('%s (%s)') % (sTitle, sHoster)
  134. sUrl2 = URL_MAIN + sUrl2
  135.  
  136. oOutputParameterHandler = cOutputParameterHandler()
  137. oOutputParameterHandler.addParameter('siteUrl2', sUrl2)
  138. oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
  139. oOutputParameterHandler.addParameter('sThumb', sThumb)
  140.  
  141. oGui.addMovie(SITE_IDENTIFIER, 'showMovies2', sTitle, '', sThumb, sDesc, oOutputParameterHandler)
  142.  
  143. progress_.VSclose(progress_)
  144.  
  145. if not sSearch:
  146. oGui.setEndOfDirectory()
  147.  
  148. def showMovies2(sSearch = ''): #affiche les matchs en direct depuis la section showMovie
  149. oGui = cGui()
  150. if sSearch:
  151. sUrl = sSearch
  152. else:
  153. oInputParameterHandler = cInputParameterHandler()
  154. sUrl2 = oInputParameterHandler.getValue('siteUrl2')
  155.  
  156. oRequestHandler = cRequestHandler(sUrl2)
  157. sHtmlContent = oRequestHandler.request()
  158. #VSlog(sHtmlContent)
  159.  
  160. sPattern = '<a class="live" href="([^>]+)">([^>]+)</a>\s*(?:<br><img src="//cdn.livetvcdn.net/img/live.gif"><br>|<br>)\s*<span class="evdesc">([^>]+)\s*<br>\s*([^>]+)</span>'
  161.  
  162. oParser = cParser()
  163. aResult = oParser.parse(sHtmlContent, sPattern)
  164. #VSlog(str(aResult))
  165.  
  166. if (aResult[0] == False):
  167. oGui.addText(SITE_IDENTIFIER)
  168.  
  169. if (aResult[0] == True):
  170. total = len(aResult[1])
  171. progress_ = progress().VScreate(SITE_NAME)
  172.  
  173. for aEntry in aResult[1]:
  174. progress_.VSupdate(progress_, total)
  175. if progress_.iscanceled():
  176. break
  177.  
  178. sTitle2 = str(aEntry[1]).replace('<br>',' ')
  179. sUrl3 = str(aEntry[0])
  180. sThumb = ''
  181. #sLang = str(aEntry[3])
  182. sQual = str(aEntry[3])
  183. sHoster = str(aEntry[2])
  184. sDesc = ''
  185.  
  186. sTitle2 = sTitle2.decode("iso-8859-1", 'ignore')
  187. sTitle2 = cUtil().unescape(sTitle2)
  188. sTitle2 = sTitle2.encode("utf-8")
  189.  
  190. sHoster = sHoster.decode("iso-8859-1", 'ignore')
  191. sHoster = cUtil().unescape(sHoster)
  192. sHoster = sHoster.encode("utf-8")
  193.  
  194. sQual = sQual.decode("iso-8859-1", 'ignore')
  195. sQual = cUtil().unescape(sQual)
  196. sQual = sQual.encode("utf-8", 'ignore')
  197.  
  198. sTitle2 = ('%s (%s) [COLOR yellow]%s[/COLOR]') % (sTitle2, sHoster, sQual)
  199.  
  200. sUrl3 = URL_MAIN + sUrl3
  201. VSlog(sUrl3)
  202.  
  203. oOutputParameterHandler = cOutputParameterHandler()
  204. oOutputParameterHandler.addParameter('siteUrl3', sUrl3)
  205. oOutputParameterHandler.addParameter('sMovieTitle2', sTitle2)
  206. oOutputParameterHandler.addParameter('sThumb', sThumb)
  207.  
  208. oGui.addMovie(SITE_IDENTIFIER, 'showMovies3', sTitle2, '', sThumb, sDesc, oOutputParameterHandler)
  209.  
  210. progress_.VSclose(progress_)
  211.  
  212. if not sSearch:
  213. oGui.setEndOfDirectory()
  214.  
  215. def showMovies3(sSearch = ''): #affiche les videos disponible du live
  216. oGui = cGui()
  217. if sSearch:
  218. sUrl = sSearch
  219. else:
  220. oInputParameterHandler = cInputParameterHandler()
  221. sUrl3 = oInputParameterHandler.getValue('siteUrl3')
  222.  
  223. oRequestHandler = cRequestHandler(sUrl3)
  224. sHtmlContent = oRequestHandler.request()
  225. #sHtmlContent = sHtmlContent.decode("iso-8859-1", 'ignore')
  226. #sHtmlContent = cUtil().unescape(sHtmlContent)
  227. #sHtmlContent = sHtmlContent.encode("utf-8", 'ignore')
  228. sMovieTitle2 = oInputParameterHandler.getValue('sMovieTitle2')
  229.  
  230. sPattern = '<a title=".+?" *href="//cdn.livetvcdn.net(.+?)"'
  231.  
  232. oParser = cParser()
  233. aResult = oParser.parse(sHtmlContent, sPattern)
  234. #VSlog(str(aResult))
  235.  
  236. if (aResult[0] == False):
  237. oGui.addText(SITE_IDENTIFIER)
  238.  
  239. if (aResult[0] == True):
  240. total = len(aResult[1])
  241. progress_ = progress().VScreate(SITE_NAME)
  242.  
  243. for aEntry in aResult[1]:
  244. progress_.VSupdate(progress_, total)
  245. if progress_.iscanceled():
  246. break
  247.  
  248. sTitle = sMovieTitle2
  249. sUrl4 = str(aEntry)
  250. #sUrl4 = sUrl4.decode("iso-8859-1", 'ignore')
  251. #sUrl4 = cUtil().unescape(sUrl4)
  252. #sUrl4 = sUrl4.encode("utf-8")
  253. sThumb = ''
  254. #sLang = str(aEntry[3])
  255. #sQual = str(aEntry[3])
  256. #sHoster = str(aEntry[2])
  257. sDesc = ''
  258.  
  259. sTitle = ('%s') % (sMovieTitle2)
  260. sUrl4 = URL_MAIN2 + sUrl4
  261.  
  262. oOutputParameterHandler = cOutputParameterHandler()
  263. oOutputParameterHandler.addParameter('siteUrl4', sUrl4)
  264. oOutputParameterHandler.addParameter('sMovieTitle2', sTitle)
  265. oOutputParameterHandler.addParameter('sThumb', sThumb)
  266.  
  267. oGui.addMovie(SITE_IDENTIFIER, 'showHosters', sTitle, '', sThumb, sDesc, oOutputParameterHandler)
  268.  
  269. progress_.VSclose(progress_)
  270.  
  271. if not sSearch:
  272. oGui.setEndOfDirectory()
  273.  
  274. def showHosters(sSearch = ''): #affiche les videos disponible du live
  275. oGui = cGui()
  276. oInputParameterHandler = cInputParameterHandler()
  277. sUrl4 = oInputParameterHandler.getValue('siteUrl4')
  278. sMovieTitle2 = oInputParameterHandler.getValue('sMovieTitle2')
  279. sThumb = oInputParameterHandler.getValue('sThumb')
  280.  
  281. oRequestHandler = cRequestHandler(sUrl4)
  282. sHtmlContent = oRequestHandler.request()
  283.  
  284. oParser = cParser()
  285. if not 'aliez' in sUrl4:
  286. sPattern = '<td bgcolor=".+?" *align="center".+?\s*<iframe.+?src="([^"]+)".+?</iframe>'
  287. elif 'youtube' or 'aliez' or 'laola1tv' in sUrl4:
  288. sPattern = '</script>\s*<iframe.+?src="([^"]+)".+?</iframe>\s*</td>'
  289. else:
  290. sPattern = '<td bgcolor=".+?" *align="center".+?\s*<iframe.+?src="([^"]+)".+?</iframe>'
  291.  
  292. liste_url = []
  293.  
  294. aResult = oParser.parse(sHtmlContent, sPattern)
  295.  
  296. if (aResult[0]):
  297.  
  298. sHosterUrl = ''
  299.  
  300. url = aResult[1][0]
  301.  
  302. #url = 'http://thesports4u.net/embedlive/eurosport-1.php'
  303.  
  304. VSlog(url)
  305. #1 er methode
  306. if 'emb.aliez.me' in url:#Terminer
  307. Referer = url
  308. UA = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0'
  309. oRequestHandler = cRequestHandler(url)
  310. oRequestHandler.addHeaderEntry('User-Agent',UA)
  311. sHtmlContent2 = oRequestHandler.request()
  312. sPattern2 = 'source: *\'(.+?)\''
  313. aResult = re.findall(sPattern2, sHtmlContent2)
  314. if aResult:
  315. sHosterUrl = aResult[0] + '|User-Agent=' + UA + '&referer=' + Referer
  316. VSlog(sHosterUrl)
  317.  
  318. if 'emb.aliez.me' in url:#obligatoire pour fixer bug 403
  319. #Referer = url
  320. UA = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0'
  321. oRequestHandler = cRequestHandler(url)
  322. oRequestHandler.addHeaderEntry('User-Agent',UA)
  323. sHtmlContent2 = oRequestHandler.request()
  324. sPattern2 = 'source: *\'(http://a3.aliez.me.+?)\''
  325. aResult = re.findall(sPattern2, sHtmlContent2)
  326. if aResult:
  327. sHosterUrl = aResult[0] + '|User-Agent=' + UA
  328. VSlog(sHosterUrl)
  329.  
  330. if 'sport7.pw' in url:#Terminé
  331. oRequestHandler = cRequestHandler(url)
  332. sHtmlContent2 = oRequestHandler.request()
  333. sPattern2 = 'videoLink = \'(.+?)\''
  334. aResult = re.findall(sPattern2, sHtmlContent2)
  335. if aResult:
  336. sHosterUrl = aResult[0]
  337.  
  338. if 'totalsport.me' in url:#Terminé
  339. oRequestHandler = cRequestHandler(url)
  340. sHtmlContent2 = oRequestHandler.request()
  341. sPattern2 = 'source: "(.+?)"'
  342. aResult = re.findall(sPattern2, sHtmlContent2)
  343. if aResult:
  344. sHosterUrl = aResult[0]
  345.  
  346. if 'sportsbar.pw' in url:#Terminé
  347. oRequestHandler = cRequestHandler(url)
  348. sHtmlContent2 = oRequestHandler.request()
  349. sPattern2 = 'videoLink = \'(.+?)\''
  350. aResult = re.findall(sPattern2, sHtmlContent2)
  351. if aResult:
  352. sHosterUrl = aResult[0]
  353.  
  354. if 'livesoccers.pw' in url:#Terminé
  355. oRequestHandler = cRequestHandler(url)
  356. sHtmlContent2 = oRequestHandler.request()
  357. sPattern2 = '<iframe src=\'(.+?)\''
  358. aResult = re.findall(sPattern2, sHtmlContent2)
  359. if aResult:
  360. sHosterUrl2 = aResult[0]
  361. UA = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0'
  362. oRequestHandler = cRequestHandler(sHosterUrl2)
  363. oRequestHandler.addHeaderEntry('User-Agent',UA)
  364. oRequestHandler.addHeaderEntry('Referer',sHosterUrl2)
  365. sHtmlContent3 = oRequestHandler.request()
  366. VSlog(sHtmlContent3)
  367. sPattern3 = '<source src="([^"]+)"'
  368. aResult1 = re.findall(sPattern3, sHtmlContent3)
  369. if aResult1:
  370. sHosterUrl = aResult1[0]
  371.  
  372. if 'assia' in url:#Terminé
  373. oRequestHandler = cRequestHandler(url)
  374. sHtmlContent2 = oRequestHandler.request()
  375. sPattern2 = 'file:"([^"]+)"'
  376. aResult = re.findall(sPattern2, sHtmlContent2)
  377. if aResult:
  378. sHosterUrl = aResult[0]
  379.  
  380. if 'sportlive.site' in url:#Terminé
  381. oRequestHandler = cRequestHandler(url)
  382. sHtmlContent2 = oRequestHandler.request()
  383. sPattern2 = '<iframe src="(.+?)"'
  384. aResult = re.findall(sPattern2, sHtmlContent2)
  385. if aResult:
  386. sHosterUrl2 = aResult[0]
  387. #VSlog(str(sHosterUrl2))
  388. oRequestHandler = cRequestHandler(sHosterUrl2)
  389. sHtmlContent3 = oRequestHandler.request()
  390. sPattern3 = '<script type=\'text/javascript\'>id=\'(.+?)\''
  391. aResult2 = re.findall(sPattern3, sHtmlContent3)
  392. if aResult2:
  393. sHosterUrl3 = aResult2[0]
  394. sHosterUrl3 = "http://hdcast.pw/stream_jw2.php?id=" + sHosterUrl3
  395. #VSlog(str(sHosterUrl3))
  396. oRequestHandler = cRequestHandler(sHosterUrl3)
  397. sHtmlContent4 = oRequestHandler.request()
  398. sPattern4 = 'curl = "([^"]+)";'
  399. aResult3 = re.findall(sPattern4, sHtmlContent4)
  400. if aResult3:
  401. sHosterUrl = aResult3[0]
  402. sHosterUrl = base64.b64decode(sHosterUrl)
  403. VSlog(sHosterUrl)
  404.  
  405. if 'sport-stream365' in url:#Terminé
  406. sPattern2 = '<td bgcolor=".+?" *align="center".+?\s*<iframe.+?src="http://sport-stream365.com.+?/?game=([^"]+)&ta.+?".+?</iframe>'
  407. aResult = re.findall(sPattern2, sHtmlContent)
  408. if aResult:
  409. gameId = aResult[0]
  410. sHosterUrl = 'http://91.192.80.210/edge0/xrecord/' + gameId + '/prog_index.m3u8'
  411.  
  412. if 'youtube' in url:#Je sais pas
  413. sPattern2 = 'youtube.com/embed/(.+?)[?]autoplay=1'
  414. aResult = re.findall(sPattern2, url)
  415.  
  416. if aResult:
  417. video_id = aResult[0]
  418. VSlog(video_id)
  419.  
  420. url = url.replace('/embed/','/watch?v=')
  421. oRequestHandler = cRequestHandler(url)
  422. sHtmlContent2 = oRequestHandler.request()
  423.  
  424. sPattern2 = '\W[\'"]?t[\'"]?: ?[\'"](.+?)[\'"]'
  425. aResult = re.findall(sPattern2, sHtmlContent2)
  426.  
  427. if aResult:
  428. token = aResult[0]
  429. #VSlog(token)
  430.  
  431. params = {
  432. 'video_id': video_id,
  433. 'el': '$el',
  434. 'ps': 'default',
  435. 'eurl': 'https://youtube.googleapis.com/v/'+video_id,
  436. 'hl': 'fr_FR',
  437. 't': urllib2.quote(token)}
  438.  
  439. url2 = 'https://youtube.com/get_video_info?video_id=' +video_id#+ urllib.parse.urlencode(params)
  440.  
  441. req = urllib2.Request(url2)
  442.  
  443. response = urllib2.urlopen(req)
  444. sHtmlContent3 = response.read().decode('utf-8')
  445. #VSlog(sHtmlContent3)
  446.  
  447. sPattern3 = '&hlsvp=(.+?).m3u8.+?'
  448. aResult = re.findall(sPattern3, sHtmlContent3)
  449.  
  450. if aResult:
  451. sHosterUrl = urllib2.unquote(aResult[0])
  452. sHosterUrl = urllib2.unquote(sHosterUrl)
  453. sHosterUrl = sHosterUrl + '.m3u8'
  454. #VSlog(sHosterUrl)
  455.  
  456. if 'streamup.me' in url:#Terminé
  457. oRequestHandler = cRequestHandler(url)
  458. sHtmlContent2 = oRequestHandler.request()
  459. sPattern2 = '<iframe src="([^"]+)"'
  460. aResult = re.findall(sPattern2, sHtmlContent2)
  461. if aResult:
  462. sHosterUrl2 = aResult[0]
  463. VSlog(sHosterUrl2)
  464. oRequestHandler = cRequestHandler(sHosterUrl2)
  465. sHtmlContent3 = oRequestHandler.request()
  466. sHtmlContent3 = urllib.unquote(sHtmlContent3)
  467. VSlog(sHtmlContent3)
  468. sPattern3 = 'src: "\/\/(.+?)"'
  469. aResult = re.findall(sPattern3, sHtmlContent3)
  470. if aResult:
  471. sHosterUrl = 'http://'+aResult[0]
  472.  
  473. if 'livestream' in url:#Je sais pas ne démarre pas de temps en temps
  474. sPattern2 = '<td bgcolor=".+?" *align="center".+?\s*<iframe.+?src="https://([^"]+)/player?.+?</iframe>'
  475. aResult = re.findall(sPattern2, sHtmlContent)
  476. if aResult:
  477. accountId = aResult[0]
  478. jsonUrl = 'https://player-api.new.' + accountId + '?format=short'
  479.  
  480. oRequestHandler = cRequestHandler(jsonUrl)
  481. sHtmlContent = oRequestHandler.request()
  482.  
  483. sPattern3 = '"m3u8_url":"(.+?)"'
  484. aResult = re.findall(sPattern3, sHtmlContent)
  485. if aResult:
  486. sHosterUrl = aResult[0]
  487.  
  488. if 'forbet.tv' in url:#Probleme ssl
  489. oRequestHandler = cRequestHandler(url)
  490. sHtmlContent2 = oRequestHandler.request()
  491. sPattern2 = 'file: "([^"]+)"'
  492. aResult = re.findall(sPattern2, sHtmlContent2)
  493. if aResult:
  494. sHosterUrl = aResult[0]
  495.  
  496. if 'p.hd24.watch' in url:#Terminé
  497. oRequestHandler = cRequestHandler(url)
  498. sHtmlContent2 = oRequestHandler.request()
  499. sPattern2 = 'data-channel="([^"]+)">'
  500. aResult = re.findall(sPattern2, sHtmlContent2)
  501. if aResult:
  502. Host = '190-2-146-56.livesports24.online'
  503. sHosterUrl = 'https://'+Host+'/'+aResult[0]+'.m3u8'
  504.  
  505. if 'hdsoccerstreams.net' in url:#Pas terminer
  506. oRequestHandler = cRequestHandler(url)
  507. sHtmlContent2 = oRequestHandler.request()
  508. sPattern2 = '<script>fid="(.+?)"'
  509. aResult = re.findall(sPattern2, sHtmlContent2)
  510. if aResult:
  511. fid = aResult[0]
  512. VSlog(fid)
  513.  
  514. UA = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0'
  515. url2 = 'http://webtv.ws/embed.php?live=spstream'+ fid +'&vw=700&vh=440'
  516. Referer = url
  517. oRequestHandler = cRequestHandler(url2)
  518. oRequestHandler.addHeaderEntry('User-Agent',UA)
  519. oRequestHandler.addHeaderEntry('Referer',Referer)
  520. sHtmlContent3 = oRequestHandler.request()
  521. #VSlog(sHtmlContent3)
  522.  
  523. if 'thesports4u.net' in url:#Pas terminer a cause de wlive.tv
  524. oRequestHandler = cRequestHandler(url)
  525. sHtmlContent2 = oRequestHandler.request()
  526. sPattern2 = '<script>fid="(.+?)"'
  527. aResult = re.findall(sPattern2, sHtmlContent2)
  528. if aResult:
  529. fid = aResult[0]
  530. VSlog(fid)
  531.  
  532. UA = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0'
  533. url2 = 'http://wlive.tv/embed.php?player=desktop&live='+fid+'&vw=700&vh=440'
  534. #Referer = 'http://webtv.ws/embeds.php?live=spstream'+ fid +'&vw=700&vh=440'
  535. oRequestHandler = cRequestHandler(url2)
  536. oRequestHandler.addHeaderEntry('User-Agent',UA)
  537. oRequestHandler.addHeaderEntry('Referer',url2)
  538. sHtmlContent3 = oRequestHandler.request()
  539. VSlog(sHtmlContent3)
  540.  
  541.  
  542. if 'sports-stream.net' in url:#Terminé
  543. oRequestHandler = cRequestHandler(url)
  544. sHtmlContent2 = oRequestHandler.request()
  545. sPattern2 = 'sports-stream.+?ch=(.+?)"'
  546. aResult = re.findall(sPattern2, sHtmlContent2)
  547.  
  548. if aResult:
  549. fid = aResult[0]
  550.  
  551. UA = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0'
  552. url2 = 'http://webtv.ws/embeds.php?live=spstream'+ fid +'&vw=700&vh=440'
  553. oRequestHandler = cRequestHandler(url2)
  554. oRequestHandler.addHeaderEntry('User-Agent',UA)
  555. oRequestHandler.addHeaderEntry('Referer','http://www.sports-stream.net/chtv/sps.php?ch='+fid)
  556. sHtmlContent2 = oRequestHandler.request()
  557.  
  558. sPattern3 = 'source src="(.+?)".+?">'
  559. aResult = re.findall(sPattern3, sHtmlContent2)
  560. if aResult:
  561. sHosterUrl = aResult[0]
  562.  
  563. if 'foot.futbol' in url:#Terminé
  564. oRequestHandler = cRequestHandler(url)
  565. sHtmlContent2 = oRequestHandler.request()
  566. sPattern2 = '<iframe src=\'(.+?)\''
  567. aResult = re.findall(sPattern2, sHtmlContent2)
  568. if aResult:
  569. sHosterUrl2 = aResult[0]
  570. VSlog(sHosterUrl2)
  571. Referer = sHosterUrl2
  572. UA = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36'
  573. oRequestHandler = cRequestHandler(sHosterUrl2)
  574. oRequestHandler.addHeaderEntry('User-Agent',UA)
  575. oRequestHandler.addHeaderEntry('Referer',Referer)
  576. sHtmlContent3 = oRequestHandler.request()
  577. VSlog(sHtmlContent3)
  578. sPattern3 = '<source src="([^"]+)"'
  579. aResult2 = re.findall(sPattern3, sHtmlContent3)
  580. if aResult2:
  581. sHosterUrl = aResult2[0]
  582.  
  583. if 'viewhd.me' in url:#Pas terminer je sais pas comment on trouve le m3u dans hdstream
  584. oRequestHandler = cRequestHandler(url)
  585. sHtmlContent2 = oRequestHandler.request()
  586. sPattern2 = '<script>fid="([^"]+)"'
  587. aResult = re.findall(sPattern2, sHtmlContent2)
  588. if aResult:
  589. sHosterUrl2 = 'http://www.hdstream.live/embed.php?player=desktop&live='+aResult[0]+'&vw=620&vh=490'
  590. VSlog(sHosterUrl2)
  591. Referer = sHosterUrl2
  592. UA = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36'
  593. oRequestHandler = cRequestHandler(sHosterUrl2)
  594. oRequestHandler.addHeaderEntry('User-Agent',UA)
  595. oRequestHandler.addHeaderEntry('Referer',Referer)
  596. sHtmlContent3 = oRequestHandler.request()
  597. VSlog(sHtmlContent3)
  598.  
  599.  
  600. if 'socolive.net' in url:#Terminé
  601. oRequestHandler = cRequestHandler(url)
  602. sHtmlContent2 = oRequestHandler.request()
  603. sPattern2 = 'channel=\'(.+?)\', g=\'(.+?)\''
  604. aResult = re.findall(sPattern2, sHtmlContent2)
  605.  
  606. if aResult:
  607. for aEntry in aResult:
  608. channel = aEntry[0]
  609. g = aEntry[1]
  610. #VSlog(channel)
  611. #VSlog(g)
  612.  
  613. UA = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36'
  614. url2 = 'https://www.ucasterplayer.com/hembedplayer/'+ channel +'/'+ g +'/700/480'
  615. #VSlog(url2)
  616. oRequestHandler = cRequestHandler(url2)
  617. oRequestHandler.addHeaderEntry('User-Agent',UA)
  618. oRequestHandler.addHeaderEntry('Referer','http://socolive.net/ch=.+?')
  619. sHtmlContent2 = oRequestHandler.request()
  620. #VSlog(sHtmlContent2)
  621.  
  622. sPattern3 = '"src", "https://" \+ ea \+ "([^"]+)"'
  623. sPattern4 = 'ea = "([^"]+)"'
  624. aResult2 = re.findall(sPattern4, sHtmlContent2)
  625. aResult1 = re.findall(sPattern3, sHtmlContent2)
  626. if aResult2:
  627. urldomaine = aResult2[0]
  628. if aResult1:
  629. oRequestHandler.addHeaderEntry('User-Agent',UA)
  630. Referer = url2
  631. UA = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36'
  632. sHosterUrl = 'http://'+ urldomaine + aResult1[0] + '|User-Agent=' + UA + '&referer=' + Referer
  633. VSlog(sHosterUrl)
  634.  
  635. if '1me.club' in url:#Terminé
  636. oRequestHandler = cRequestHandler(url)
  637. sHtmlContent2 = oRequestHandler.request()
  638. sPattern2 = '<iframe src="(.+?)"'
  639. aResult = re.findall(sPattern2, sHtmlContent2)
  640.  
  641. if aResult:
  642. Referer = 'http://1me.club'
  643. UA = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36'
  644. VSlog(aResult[0])
  645. oRequestHandler = cRequestHandler(aResult[0])
  646. oRequestHandler.addHeaderEntry('User-Agent',UA)
  647. oRequestHandler.addHeaderEntry('Referer',Referer)
  648. sHtmlContent3 = oRequestHandler.request()
  649.  
  650. sPattern2 = '(\s*eval\s*\(\s*function(?:.|\s)+?{}\)\))'
  651. aResult = re.findall(sPattern2, sHtmlContent3)
  652.  
  653. if aResult:
  654.  
  655. str2 = aResult[0]
  656. if not str2.endswith(';'):
  657. str2 = str2 + ';'
  658.  
  659. str = cPacker().unpack(str2)
  660. VSlog(str)
  661.  
  662. sPattern3 = '{source:"([^"]+)"'
  663. aResult1 = re.findall(sPattern3, str)
  664. if aResult1:
  665. sHosterUrl = aResult1[0]
  666.  
  667.  
  668. #VSlog(sHosterUrl)
  669. xbmc.Player().play(sHosterUrl)
  670. return
  671.  
  672. def showMovies4(sSearch = ''):#Afficher le club recherché
  673. oGui = cGui()
  674. if sSearch:
  675. sUrl = sSearch
  676. else:
  677. oInputParameterHandler = cInputParameterHandler()
  678. sUrl = oInputParameterHandler.getValue('siteUrl')
  679.  
  680. oRequestHandler = cRequestHandler(sUrl)
  681. sHtmlContent = oRequestHandler.request()
  682.  
  683. sPattern = '<a href="([^"]+)"><span class="sltitle">([^<>]+)</span></a>\s*<br>\s*<font color=".+?">([^<>]+)</font>'
  684.  
  685. oParser = cParser()
  686. aResult = oParser.parse(sHtmlContent, sPattern)
  687. #VSlog(str(aResult))
  688.  
  689. if (aResult[0] == False):
  690. oGui.addText(SITE_IDENTIFIER)
  691.  
  692. if (aResult[0] == True):
  693. total = len(aResult[1])
  694. progress_ = progress().VScreate(SITE_NAME)
  695.  
  696. for aEntry in aResult[1]:
  697. progress_.VSupdate(progress_, total)
  698. if progress_.iscanceled():
  699. break
  700.  
  701. sTitle = str(aEntry[1])
  702. sUrl2 = str(aEntry[0])
  703. sThumb = ''
  704. #sLang = str(aEntry[3])
  705. #sQual = str(aEntry[4])
  706. sHoster = str(aEntry[2])
  707. sDesc = ''
  708.  
  709. sTitle = sTitle.decode("iso-8859-1", 'ignore')
  710. sTitle = sTitle.encode("utf-8", 'ignore')
  711. sTitle = ('%s (%s)') % (sTitle, sHoster)
  712.  
  713. sUrl2 = URL_MAIN + sUrl2
  714.  
  715. oOutputParameterHandler = cOutputParameterHandler()
  716. oOutputParameterHandler.addParameter('siteUrl', sUrl2)
  717. oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
  718. oOutputParameterHandler.addParameter('sThumb', sThumb)
  719.  
  720. if '/series' in sUrl:
  721. oGui.addTV(SITE_IDENTIFIER, 'ShowSerieSaisonEpisodes', sTitle, '', sThumb, sDesc, oOutputParameterHandler)
  722. else:
  723. oGui.addMovie(SITE_IDENTIFIER, 'showMenu', sTitle, '', sThumb, sDesc, oOutputParameterHandler)
  724.  
  725. progress_.VSclose(progress_)
  726.  
  727. if not sSearch:
  728. oGui.setEndOfDirectory()
  729.  
  730. def showMenu(sSearch = ''):#affiche le menu du club
  731. oGui = cGui()
  732. if sSearch:
  733. sUrl = sSearch
  734. else:
  735. oInputParameterHandler = cInputParameterHandler()
  736. sUrl = oInputParameterHandler.getValue('siteUrl')
  737.  
  738. oRequestHandler = cRequestHandler(sUrl)
  739. sHtmlContent = oRequestHandler.request()
  740.  
  741. sPattern = '<a href="([^"]+)" *class="white">(.+?)</a></td>'
  742.  
  743. oParser = cParser()
  744. aResult = oParser.parse(sHtmlContent, sPattern)
  745. #VSlog(str(aResult))
  746.  
  747. if (aResult[0] == False):
  748. oGui.addText(SITE_IDENTIFIER)
  749.  
  750. if (aResult[0] == True):
  751. total = len(aResult[1])
  752. progress_ = progress().VScreate(SITE_NAME)
  753.  
  754. for aEntry in aResult[1]:
  755. progress_.VSupdate(progress_, total)
  756. if progress_.iscanceled():
  757. break
  758.  
  759. sTitle = str(aEntry[1])
  760. sUrl2 = str(aEntry[0])
  761. sThumb = ''
  762. #sLang = str(aEntry[3])
  763. #sQual = str(aEntry[4])
  764. #sHoster = str(aEntry[2])
  765. sDesc = ''
  766.  
  767. sTitle = sTitle.decode("iso-8859-1", 'ignore')
  768. sTitle = sTitle.encode("utf-8", 'ignore')
  769. sTitle = ('%s') % (sTitle)
  770.  
  771. sUrl2 = URL_MAIN + sUrl2
  772.  
  773. oOutputParameterHandler = cOutputParameterHandler()
  774. oOutputParameterHandler.addParameter('siteUrl', sUrl2)
  775. oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
  776. oOutputParameterHandler.addParameter('sThumb', sThumb)
  777.  
  778. if '/series' in sUrl:
  779. oGui.addTV(SITE_IDENTIFIER, 'ShowSerieSaisonEpisodes', sTitle, '', sThumb, sDesc, oOutputParameterHandler)
  780. else:
  781. oGui.addMovie(SITE_IDENTIFIER, 'showResult', sTitle, '', sThumb, sDesc, oOutputParameterHandler)
  782.  
  783. progress_.VSclose(progress_)
  784.  
  785. if not sSearch:
  786. oGui.setEndOfDirectory()
  787.  
  788. def showResult(sSearch = ''):# le menu resultat quand on a choisi le club
  789. oGui = cGui()
  790. if sSearch:
  791. sUrl = sSearch
  792. else:
  793. oInputParameterHandler = cInputParameterHandler()
  794. sUrl = oInputParameterHandler.getValue('siteUrl')
  795.  
  796. oRequestHandler = cRequestHandler(sUrl)
  797. sHtmlContent = oRequestHandler.request()
  798.  
  799. sPattern = '<span class="date">([^<>]+)</span>.+?<span class="graydesc">([^<>]+)</span>.+?<td align="right">([^<>]+).+?<td align="center">\s*<b>([^<>]+)</b>.+?<td>([^<>]+)</td>.+?<font color=".+?">.+?</font>.+?<a class="small" *href="([^"]+)"'
  800.  
  801. oParser = cParser()
  802. aResult = oParser.parse(sHtmlContent, sPattern)
  803. #VSlog(str(aResult))
  804.  
  805. if (aResult[0] == False):
  806. oGui.addText(SITE_IDENTIFIER)
  807.  
  808. if (aResult[0] == True):
  809. total = len(aResult[1])
  810. progress_ = progress().VScreate(SITE_NAME)
  811.  
  812. for aEntry in aResult[1]:
  813. progress_.VSupdate(progress_, total)
  814. if progress_.iscanceled():
  815. break
  816.  
  817. sTitle = str(aEntry[2]) + str(aEntry[4])
  818. sUrl2 = str(aEntry[5])
  819. sDate = str(aEntry[0])
  820. sComp = str(aEntry[1])
  821. sEquip = str(aEntry[2])
  822. sScore = str(aEntry[3])
  823. sEquipe = str(aEntry[4])
  824. sThumb = ''
  825. #sLang = str(aEntry[3])
  826. #sQual = str(aEntry[4])
  827. #sHoster = str(aEntry[2])
  828. sDesc = ''
  829.  
  830. sTitle = sTitle.decode("iso-8859-1", 'ignore')
  831. sTitle = cUtil().unescape(sTitle)
  832. sTitle = sTitle.encode("utf-8", 'ignore')
  833.  
  834. sDate = sDate.decode("iso-8859-1", 'ignore')
  835. sDate = cUtil().unescape(sDate)
  836. sDate = sDate.encode("utf-8", 'ignore')
  837.  
  838. sScore = sScore.decode("iso-8859-1", 'ignore')
  839. sScore = cUtil().unescape(sScore)
  840. sScore = sScore.encode("utf-8", 'ignore')
  841.  
  842. sComp = sComp.decode("iso-8859-1", 'ignore')
  843. sComp = cUtil().unescape(sComp)
  844. sComp = sComp.encode("utf-8", 'ignore')
  845. sTitle = ('%s [%s] (%s) [COLOR]%s[/COLOR]]') % (sTitle, sScore, sDate, sComp)
  846. sUrl2 = URL_MAIN + sUrl2
  847.  
  848. oOutputParameterHandler = cOutputParameterHandler()
  849. oOutputParameterHandler.addParameter('siteUrl', sUrl2)
  850. oOutputParameterHandler.addParameter('sMovieTitlebis', sTitle)
  851. oOutputParameterHandler.addParameter('sThumb', sThumb)
  852.  
  853. if '/series' in sUrl:
  854. oGui.addTV(SITE_IDENTIFIER, 'ShowSerieSaisonEpisodes', sTitle, '', sThumb, sDesc, oOutputParameterHandler)
  855. else:
  856. oGui.addMovie(SITE_IDENTIFIER, 'showHosters2', sTitle, '', sThumb, sDesc, oOutputParameterHandler)
  857.  
  858. progress_.VSclose(progress_)
  859.  
  860. if not sSearch:
  861. oGui.setEndOfDirectory()
  862.  
  863. #def showDecode(): #les hosters des lives celui que je suis bloqué
  864. oGui = cGui()
  865. oInputParameterHandler = cInputParameterHandler()
  866. sUrl = oInputParameterHandler.getValue('siteUrl')
  867. sMovieTitle2 = oInputParameterHandler.getValue('sMovieTitle2')
  868. sThumb = oInputParameterHandler.getValue('sThumb')
  869.  
  870. oRequestHandler = cRequestHandler(sUrl)
  871. sHtmlContent = oRequestHandler.request()
  872.  
  873. oParser = cParser()
  874. sPattern = '.+?(http://.+?).+?'
  875. #urllib.unquote(sPattern)
  876.  
  877. aResult = oParser.parse(sHtmlContent, sPattern)
  878. VSlog(str(aResult))
  879.  
  880. if (aResult[0] == True):
  881. for aEntry in aResult[1]:
  882.  
  883. sHosterUrl = str(aEntry)
  884. sHosterUrl = sHosterUrl.decode("iso-8859-1", 'ignore')
  885. #sHosterUrl = cUtil().unescape(sHosterUrl)
  886. sHosterUrl = sHosterUrl.encode("utf-8", 'ignore')
  887. oHoster = cHosterGui().checkHoster(sHosterUrl)
  888. if (oHoster != False):
  889. oHoster.setDisplayName(sMovieTitle2)
  890. oHoster.setFileName(sMovieTitle2)
  891. cHosterGui().showHoster(oGui, oHoster, sHosterUrl, sThumb)
  892.  
  893. oGui.setEndOfDirectory()
  894.  
  895. def showHosters2(): #Les hosters des videos (pas des lives attentions)
  896. oGui = cGui()
  897. oInputParameterHandler = cInputParameterHandler()
  898. sUrl = oInputParameterHandler.getValue('siteUrl')
  899. sMovieTitlebis = oInputParameterHandler.getValue('sMovieTitlebis')
  900. sThumb = oInputParameterHandler.getValue('sThumb')
  901.  
  902. oRequestHandler = cRequestHandler(sUrl)
  903. sHtmlContent = oRequestHandler.request()
  904.  
  905. oParser = cParser()
  906. sPattern = '<iframe.+?src="(http.+?)".+?</iframe>'
  907.  
  908. aResult = oParser.parse(sHtmlContent, sPattern)
  909. #VSlog(str(aResult))
  910.  
  911. if (aResult[0] == True):
  912. for aEntry in aResult[1]:
  913.  
  914. sHosterUrl = str(aEntry)
  915. #sHosterUrl = sHosterUrl.decode("iso-8859-1", 'ignore')
  916. #sHosterUrl = cUtil().unescape(sHosterUrl)
  917. #sHosterUrl = sHosterUrl.encode("utf-8", 'ignore')
  918. oHoster = cHosterGui().checkHoster(sHosterUrl)
  919. if (oHoster != False):
  920. oHoster.setDisplayName(sMovieTitlebis)
  921. oHoster.setFileName(sMovieTitlebis)
  922. cHosterGui().showHoster(oGui, oHoster, sHosterUrl, sThumb)
  923.  
  924. oGui.setEndOfDirectory()
  925.  
  926. def showClass(sSearch = ''):# pas utilisé pour l'instant c'est pour afficher les videos disponibles sur le résumé du match et les melleurs moment ''
  927. oGui = cGui() #ouvre l'affichage
  928. if sSearch: #si une url et envoyer directement grace a la fonction showSearch
  929. sUrl = sSearch
  930. else:
  931. oInputParameterHandler = cInputParameterHandler()
  932. sUrl = oInputParameterHandler.getValue('siteUrl') #recupere l'url sortie en parametre
  933.  
  934. oRequestHandler = cRequestHandler(sUrl) #envoye une requete a l'url
  935. sHtmlContent = oRequestHandler.request() #requete aussi
  936.  
  937. #sHtmlContent = sHtmlContent.replace('<span class="likeThis">', '').replace('</span>', '')
  938. #la fonction replace est pratique pour supprimer un code du resultat
  939. sPattern = '<a.+?href="(/frx/calendar.+?)">([^<>]+)'
  940. #pour faire simple recherche ce bout de code dans le code source de l'url
  941. #- "([^"]+)" je veux cette partie de code qui se trouve entre guillemets mais pas de guillemets dans la chaine
  942. #- .+? je ne veux pas cette partie et peux importe ceux qu'elle contient
  943. #- >(.+?)< je veux cette partie de code qui se trouve entre < et > mais il peut y avoir n'inporte quoi entre les 2.
  944. #- (https*://[^"]) je veux l'adresse qui commence par https ou http jusqu'au prochain guillemet.
  945. #
  946. #Pour tester vos Regex, vous pouvez utiliser le site https://regex101.com/ en mettant dans les modifiers "gmis"
  947.  
  948. oParser = cParser()
  949. aResult = oParser.parse(sHtmlContent, sPattern)
  950. VSlog(str(aResult)) #Commenter ou supprimer cette ligne une fois fini
  951.  
  952. #affiche une information si aucun resulat
  953. if (aResult[0] == False):
  954. oGui.addText(SITE_IDENTIFIER)
  955.  
  956. if (aResult[0] == True):
  957. total = len(aResult[1])
  958. #dialog barre de progression
  959. progress_ = progress().VScreate(SITE_NAME)
  960.  
  961. for aEntry in aResult[1]:
  962. progress_.VSupdate(progress_, total) #dialog update
  963. if progress_.iscanceled():
  964. break
  965.  
  966. #L'array affiche vos info dans l'orde de sPattern en commencant a 0, attention dans ce cas la on recupere 6 information
  967. #Mais selon votre regex il ne peut y en avoir que 2 ou 3.
  968. sTitle = str(aEntry[1])
  969. sUrl2 = str(aEntry[0])
  970. sThumb = ''
  971. #sLang = str(aEntry[3])
  972. #sQual = str(aEntry[4])
  973. #sHoster = str(aEntry[2])
  974. sDesc = ''
  975.  
  976. #sTitle = sTitle.replace('En streaming', '')
  977.  
  978. #Si vous avez des information dans aEntry Qualiter lang organiser un peux vos titre exemple.
  979. #Si vous pouvez la langue et la Qualite en MAJ ".upper()" vostfr.upper() = VOSTFR
  980. sTitle = sTitle.decode("iso-8859-1", 'ignore')
  981. sTitle = cUtil().unescape(sTitle)
  982. sTitle = sTitle.encode("utf-8", 'ignore')
  983. sTitle = ('%s') % (sTitle)
  984. #mettre les information de streaming entre [] et le reste entre () vstream s'occupe de la couleur automatiquement.
  985.  
  986. #Utile que si les liens recuperer ne commence pas par (http://www.nomdusite.com/)
  987. sUrl2 = URL_MAIN + sUrl2
  988.  
  989. oOutputParameterHandler = cOutputParameterHandler()
  990. oOutputParameterHandler.addParameter('siteUrl', sUrl2) #sortie de l'url
  991. oOutputParameterHandler.addParameter('sMovieTitle', sTitle) #sortie du titre
  992. oOutputParameterHandler.addParameter('sThumb', sThumb) #sortie du poster
  993.  
  994. if '/series' in sUrl:
  995. oGui.addTV(SITE_IDENTIFIER, 'ShowSerieSaisonEpisodes', sTitle, '', sThumb, sDesc, oOutputParameterHandler)
  996. #addTV pour sortir les series tv (identifiant, function, titre, icon, poster, description, sortie parametre)
  997. else:
  998. oGui.addMovie(SITE_IDENTIFIER, 'showMovies5', sTitle, '', sThumb, sDesc, oOutputParameterHandler)
  999. #addMovies pour sortir les films (identifiant, function, titre, icon, poster, description, sortie parametre)
  1000.  
  1001. #il existe aussi addMisc(identifiant, function, titre, icon, poster, description, sortie parametre)
  1002. #la difference et pour les metadonner serie, films ou sans
  1003.  
  1004. progress_.VSclose(progress_) #fin du dialog
  1005.  
  1006. if not sSearch:
  1007. oGui.setEndOfDirectory() #ferme l'affichage
  1008.  
  1009. def showMovies5(sSearch = ''):# pas utilisé pour l'instant c'est pour afficher les videos disponibles sur le résumé du match et les melleurs moment ''
  1010. oGui = cGui() #ouvre l'affichage
  1011. if sSearch: #si une url et envoyer directement grace a la fonction showSearch
  1012. sUrl = sSearch
  1013. else:
  1014. oInputParameterHandler = cInputParameterHandler()
  1015. sUrl = oInputParameterHandler.getValue('siteUrl') #recupere l'url sortie en parametre
  1016.  
  1017. oRequestHandler = cRequestHandler(sUrl) #envoye une requete a l'url
  1018. sHtmlContent = oRequestHandler.request() #requete aussi
  1019. sPattern = '<span class="whitetitle">\s*<b>(J.+?)</b>|<span class="date">([^<>]+)'
  1020. sPattern2 = '<a href="([^"]+)">([^<>]+).+?<td align="center">'
  1021. #sPattern2 = ''
  1022. #sPattern = '<span class="whitetitle">\s*<b>(J.+?)</b>'
  1023. #sPattern2 = '<span class="date">([^<>]+)'
  1024.  
  1025. oParser = cParser()
  1026. aResult = oParser.parse(sHtmlContent, sPattern)
  1027. aResult2 = oParser.parse(sHtmlContent, sPattern2)
  1028.  
  1029. VSlog(str(aResult)) #Commenter ou supprimer cette ligne une fois fini
  1030.  
  1031.  
  1032. if (aResult[0] == True):
  1033. total = len(aResult[1])
  1034. #dialog barre de progression
  1035. progress_ = progress().VScreate(SITE_NAME)
  1036.  
  1037. for aEntry2 in aResult[1]:
  1038. progress_.VSupdate(progress_, total) #dialog update
  1039. if progress_.iscanceled():
  1040. break
  1041.  
  1042. #if aEntry:
  1043. #oGui.addText(SITE_IDENTIFIER, '[COLOR red]' + aEntry[0] + '[/COLOR]')
  1044.  
  1045. sInfo = str(aEntry2)
  1046. #sUrl2 = aEntry[]
  1047. #sThumb = ''
  1048. #sLang = str(aEntry[3])
  1049. #sQual = str(aEntry[4])
  1050. #sHoster = str(aEntry[2])
  1051. #sDesc = ''
  1052.  
  1053. sInfo = sInfo.decode("iso-8859-1", 'ignore')
  1054. sInfo = cUtil().unescape(sInfo)
  1055. sInfo = sInfo.encode("utf-8", 'ignore')
  1056.  
  1057. if (aResult2[0] == True):
  1058. total = len(aResult2[1])
  1059. Progress_ = progress().VScreate(SITE_NAME)
  1060.  
  1061. for aEntry in aResult2[1]:
  1062. progress_.VSupdate(progress_, total)
  1063. if progress_.iscanceled():
  1064. break
  1065.  
  1066. if aEntry2[0]:
  1067. (oGui.addText(SITE_IDENTIFIER, '[COLOR red]' +aEntry2[0] +'[/COLOR]')
  1068.  
  1069. sTitle = str(aEntry[1])
  1070. sUrl2 = str(aEntry[0])
  1071. sThumb = ''
  1072. sDesc = ''
  1073. sUrl2 = URL_MAIN + sUrl2
  1074.  
  1075. oOutputParameterHandler = cOutputParameterHandler()
  1076. oOutputParameterHandler.addParameter('siteUrl', sUrl2) #sortie de l'url
  1077. oOutputParameterHandler.addParameter('sMovieTitle', sTitle) #sortie du titre
  1078. oOutputParameterHandler.addParameter('sThumb', sThumb) #sortie du poster
  1079.  
  1080. if '/series' in sUrl2:
  1081. oGui.addTV(SITE_IDENTIFIER, 'ShowSerieSaisonEpisodes', sTitle, '', sThumb, sDesc, oOutputParameterHandler)
  1082. #addTV pour sortir les series tv (identifiant, function, titre, icon, poster, description, sortie parametre)
  1083. else:
  1084. oGui.addMovie(SITE_IDENTIFIER, 'showHosters2', sTitle, '', sThumb, sDesc, oOutputParameterHandler)
  1085. #addMovies pour sortir les films (identifiant, function, titre, icon, poster, description, sortie parametre)
  1086.  
  1087. progress_.VSclose(progress_) #fin du dialog
  1088.  
  1089. if not sSearch:
  1090. oGui.setEndOfDirectory() #ferme l'affichage
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement