Lourdesvd

default encriptado distancia

Feb 25th, 2021 (edited)
403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.58 KB | None | 0 0
  1. #encoding=utf-8
  2. import sys
  3. #===============================================================================
  4. # reload(sys)
  5. # sys.setdefaultencoding('utf8')
  6. #===============================================================================
  7.  
  8. import xbmcgui,xbmcplugin,urlparse,urllib,requests,json,xbmcaddon,xbmc
  9. import re,base64
  10. import unicodedata
  11. from datetime import datetime, timedelta
  12. import time
  13. import youtube_resolver
  14. import random
  15. from resolveurl.plugins.lib import jsunpack
  16. from sources import main
  17. base_url = sys.argv[0]
  18. addon_handle = int(sys.argv[1])
  19. args = urlparse.parse_qs(sys.argv[2][1:])
  20. my_addon = xbmcaddon.Addon()
  21. PATH = my_addon.getAddonInfo('path')
  22. LETRAS = ("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
  23. def obtener_args(text):
  24. respuesta = ''
  25. if text != '':
  26. try:
  27. clave = my_addon.getAddonInfo('id')
  28. text = text.replace('%5d', ']')
  29. text = base64.b64decode(text.replace(']', '='))
  30. traducido = []
  31. indice_clave = 0
  32. clave = clave.upper()
  33.  
  34. for symbol in text:
  35. num = LETRAS.find(symbol.upper())
  36. if num != -1:
  37. num -= LETRAS.find(clave[indice_clave])
  38. num %= len(LETRAS)
  39. if symbol.isupper():
  40. traducido.append(LETRAS[num])
  41. elif symbol.islower():
  42. traducido.append(LETRAS[num].lower())
  43. indice_clave += 1
  44. if indice_clave == len(clave):
  45. indice_clave = 0
  46.  
  47. else:
  48. traducido.append(symbol)
  49. text = ('').join(traducido)
  50. text = base64.b64decode(text)
  51. return urlparse.parse_qs(text)
  52. except:
  53. pass
  54. return urlparse.parse_qs(respuesta)
  55.  
  56. args = obtener_args(sys.argv[2][1:])
  57.  
  58. def lang_lang(lang_in):
  59.  
  60. try:
  61. if 'Spanish' in xbmc.getLanguage():
  62. return lang_in.split('$')[0]
  63. elif 'English' in xbmc.getLanguage():
  64. return lang_in.split('$')[1]
  65. elif 'French' in xbmc.getLanguage():
  66. return lang_in.split('$')[2]
  67. else:
  68. return lang_in.split('$')[1]
  69. except:
  70. return lang_in
  71.  
  72.  
  73. def solo_nums(text_in):
  74. return ''.join([n for n in text_in if n.isdigit()])
  75.  
  76. def strip_accents(text):
  77. #===========================================================================
  78. # cambie el decode por que me tiraba error al decodificar LEÓN
  79. #===========================================================================
  80. codecs=['utf8', 'cp1252']
  81. for i in codecs:
  82. try:
  83. text = text.decode(i)
  84. break
  85. except UnicodeDecodeError:
  86. pass
  87.  
  88. text = unicodedata.normalize('NFD', text)\
  89. .encode('ascii', 'ignore')\
  90. .decode("utf-8")
  91. return str(text)
  92.  
  93. def only_legal_chars(string_in):
  94. string_out = strip_accents(string_in)
  95. string_out = re.sub(r'[\\/":*?<>|]+', "", string_out)
  96. string_out = "".join(i for i in string_out if ord(i)<128)
  97. string_out = ' '.join(string_out.split())
  98. return string_out
  99.  
  100. def build_url(query):
  101. query = urllib.urlencode(query)
  102. if query != '':
  103. clave = my_addon.getAddonInfo('id')
  104. query = base64.b64encode(query)
  105. traducido = []
  106. indice_clave = 0
  107. clave = clave.upper()
  108. for symbol in query:
  109. num = LETRAS.find(symbol.upper())
  110. if num != -1:
  111. num += LETRAS.find(clave[indice_clave])
  112. num %= len(LETRAS)
  113. if symbol.isupper():
  114. traducido.append(LETRAS[num])
  115. elif symbol.islower():
  116. traducido.append(LETRAS[num].lower())
  117. indice_clave += 1
  118. if indice_clave == len(clave):
  119. indice_clave = 0
  120. else:
  121. traducido.append(symbol)
  122. query = ('').join(traducido)
  123. query = base64.b64encode(query)
  124. return base_url + '?' + query.replace('=', ']')
  125.  
  126. def monta(texto):
  127. texto = texto.replace("~\n","\n")
  128. r = []
  129. a = texto.split('###')
  130. for b in range(1, len(a)):
  131. c = a[b].split('~')
  132. for d in c:
  133. r.append(d.split('~'))
  134. return r
  135.  
  136. def get_lista(order_in):
  137.  
  138. if 'Spanish' in xbmc.getLanguage():
  139. n = 0
  140. elif 'English' in xbmc.getLanguage():
  141. n = 1
  142. elif 'French' in xbmc.getLanguage():
  143. n = 2
  144. else:
  145. n = 1
  146.  
  147. headers = {
  148. 'Connection': 'keep-alive',
  149. 'Pragma': 'no-cache',
  150. 'Cache-Control': 'no-cache',
  151. 'Upgrade-Insecure-Requests': '1',
  152. 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36',
  153. 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
  154. 'Sec-Fetch-Site': 'none',
  155. 'Sec-Fetch-Mode': 'navigate',
  156. 'Sec-Fetch-User': '?1',
  157. 'Sec-Fetch-Dest': 'document',
  158. 'Accept-Language': 'es-ES,es;q=0.9'
  159. }
  160.  
  161. text = requests.get('https://github.com/WinnerAlex303/winner_data/blob/master/winner.txt?raw=true', headers=headers).text
  162.  
  163. #f = open('/home/alex/winner_brain/winner_data/winner.txt', "r")
  164. #text = f.read()
  165. #f.close()
  166.  
  167. text = base64.b64decode(text)
  168. text = text.replace('º','a')
  169. text = text.replace('ª','B')
  170. text = text.replace('!','c')
  171. text = text.replace('|','D')
  172. text = text.replace('"','e')
  173. text = text.replace('@','F')
  174. text = text.replace('·','h')
  175. text = text.replace('#','I')
  176. text = text.replace('$','j')
  177. text = text.replace('%','K')
  178. text = text.replace('&','l')
  179. text = text.replace('¬','M')
  180. text = text.replace('(','n')
  181. text = text.replace('?','O')
  182. text = text.replace('¡','p')
  183. text = text.replace('¿','Q')
  184. text = text.replace('^','r')
  185. text = text.replace('[','S')
  186. text = text.replace(')','u')
  187. text = text.replace(']','T')
  188. text = text.replace('*','v')
  189. text = text.replace(';','W')
  190. text = text.replace('{','x')
  191. text = text.replace(':','Y')
  192. text = text.replace('.','z')
  193. text = text.replace('}','R')
  194. text = base64.b64decode(text)
  195.  
  196. listado = text.strip().split("\n")
  197. lineas = []
  198.  
  199. now_timestamp = time.time()
  200. offset = datetime.fromtimestamp(now_timestamp) - datetime.utcfromtimestamp(now_timestamp)
  201.  
  202. for l in listado:
  203. ll = l.split('~')
  204.  
  205. try:
  206. ll[4] = ll[4].split('$')[n]
  207. except:
  208. pass
  209.  
  210. try:
  211. ll[9] = ll[9].split('$')[n]
  212. except:
  213. pass
  214.  
  215. ll[5] = str(datetime.fromtimestamp(time.mktime(time.strptime(ll[5], "%Y%m%d%H%M%S"))) + offset).replace('-','').replace(' ','').replace(':','')
  216.  
  217. if ll[0] == '':
  218. ll[0] = ll[4]
  219.  
  220. if ll[14] == '-':
  221. ll[14] = '999'
  222. if ll[15] == '-' or ll[15] == '':
  223. ll[15] = '999'
  224. lineas.append(ll)
  225.  
  226. if order_in != 0:
  227. lineas = sorted(lineas, key = lambda i: int(i[order_in]),reverse=False)
  228.  
  229. return lineas
  230.  
  231. def format_fecha(fecha_in):
  232. if fecha_in == '-':
  233. return '19801010101010'
  234. f = list(fecha_in)
  235. return f[6] + f[7] + '/' + f[4] + f[5] + ' ' + f[8] + f[9] + ':' + f[10] + f[11]
  236.  
  237. def get_color(hora_in):
  238.  
  239. if hora_in == '-':
  240. hora_in = '19801010101010'
  241.  
  242. timestamp_actual = time.mktime(datetime.now().timetuple())
  243. timestamp_evento = time.mktime(datetime.fromtimestamp(time.mktime(time.strptime(hora_in,'%Y%m%d%H%M%S'))).timetuple())
  244.  
  245. diff_tiempo = timestamp_actual - timestamp_evento
  246.  
  247. if diff_tiempo > -18000 and diff_tiempo < -1800:
  248. return 'orangered'
  249. elif diff_tiempo > -1800 and diff_tiempo < 7200:
  250. return 'springgreen'
  251. elif diff_tiempo > 7200 and diff_tiempo < 18000:
  252. return 'orangered'
  253. else:
  254. return 'whitesmoke'
  255.  
  256. def get_text(id_text):
  257. return my_addon.getLocalizedString(id_text).encode('utf-8')
  258.  
  259. def ordena_enlaces(enlaces_in):
  260.  
  261. q_4k = []
  262. q_2k = []
  263. q_1080 = []
  264. q_720 = []
  265. q_kbps = []
  266. q_480 = []
  267. q_360 = []
  268. q_320 = []
  269. q_resto = []
  270.  
  271. for enlace in enlaces_in:
  272. if enlace['q'] == '4K':
  273. q_4k.append(enlace)
  274. elif enlace['q'] == '2K':
  275. q_2k.append(enlace)
  276. elif enlace['q'] == '1080p':
  277. q_1080.append(enlace)
  278. elif enlace['q'] == '720p':
  279. q_720.append(enlace)
  280. elif 'kbps' in enlace['q']:
  281. enlace['qq'] = int(''.join(filter(str.isdigit, enlace['q'])))
  282. q_kbps.append(enlace)
  283. elif enlace['q'] == '480p':
  284. q_480.append(enlace)
  285. elif enlace['q'] == '360p':
  286. q_360.append(enlace)
  287. elif enlace['q'] == '320p':
  288. q_320.append(enlace)
  289. else:
  290. q_resto.append(enlace)
  291.  
  292. q_kbps = sorted(q_kbps, key = lambda i: i['qq'],reverse=True)
  293.  
  294. enlaces_q = q_4k + q_2k + q_1080 + q_720 + q_kbps + q_480 + q_360 + q_320 + q_resto
  295.  
  296. enlaces_por_idioma = []
  297. enlaces_ingles = []
  298. resto = []
  299.  
  300. order_lang2 = ''
  301. if 'Spanish' in xbmc.getLanguage():
  302. order_lang1 = 'ESP'
  303. order_lang2 = 'ING'
  304. elif 'English' in xbmc.getLanguage():
  305. order_lang1 = 'ING'
  306. elif 'French' in xbmc.getLanguage():
  307. order_lang1 = 'FRA'
  308. order_lang2 = 'ANG'
  309. else:
  310. order_lang1 = 'ING'
  311.  
  312. if order_lang2 != '':
  313. for enlace in enlaces_q:
  314. if order_lang1 == enlace['l']:
  315. enlaces_por_idioma.append(enlace)
  316. elif order_lang2 == enlace['l']:
  317. enlaces_ingles.append(enlace)
  318. else:
  319. resto.append(enlace)
  320. else:
  321. for enlace in enlaces_q:
  322. if order_lang1 == enlace['l']:
  323. enlaces_ingles.append(enlace)
  324. else:
  325. resto.append(enlace)
  326.  
  327. return enlaces_por_idioma + enlaces_ingles + resto
  328.  
  329. tarea = args.get('tarea', None)
  330. blancos = ''
  331.  
  332. if tarea is None:
  333.  
  334. try:
  335. contador = requests.get('http://bit.ly/Winner_contador', headers={'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36'})
  336. except:
  337. pass
  338.  
  339. lineas = get_lista(14)
  340.  
  341. url=build_url({'tarea':'hot'})
  342. item=xbmcgui.ListItem('[B]' + get_text(33001) + '[/B]', iconImage=PATH + '/resources/media/live.gif')
  343. item.setInfo(type="Video",infoLabels={"plot":get_text(33002), "Title":'[B]' + get_text(33001) + '[/B]'})
  344. item.setArt({'fanart':PATH + '/fanart.jpg', 'poster':PATH + '/resources/media/live.gif', 'icon':PATH + '/resources/media/live.gif'})
  345. xbmcplugin.addDirectoryItem(handle=addon_handle,url=url,listitem=item,isFolder=True)
  346.  
  347. deportes = []
  348. encontrados = ''
  349.  
  350.  
  351. for linea in lineas:
  352. if '#' + linea[9] + '#' not in encontrados:
  353. deportes.append({
  354. 'n':linea[9],
  355. 'i':linea[12],
  356. 'f':linea[13]
  357. })
  358. encontrados = encontrados + '#' + linea[9] + '#'
  359.  
  360.  
  361. for deporte in deportes:
  362. if deporte['i'] != blancos:
  363. url=build_url({'tarea':'competis','deporte':deporte['n']})
  364. item=xbmcgui.ListItem('[B]' + deporte['n'] + '[/B]', iconImage=deporte['i'])
  365. item.setInfo(type="Video",infoLabels={"plot":deporte['n'], "Title":'[B]' + deporte['n'] + '[/B]'})
  366. item.setArt({'fanart':deporte['f'], 'poster':deporte['i'], 'icon':deporte['i']})
  367. xbmcplugin.addDirectoryItem(handle=addon_handle,url=url,listitem=item,isFolder=True)
  368. xbmcplugin.endOfDirectory(addon_handle)
  369.  
  370. elif tarea[0]=='hot':
  371. tiempo_ahora = time.mktime(time.strptime(str(datetime.now().strftime("%Y%m%d%H%M%S")), "%Y%m%d%H%M%S"))
  372.  
  373. lineas = get_lista(15)
  374.  
  375. competis = []
  376. encontrados = ''
  377.  
  378. for linea in lineas:
  379. if '#' + linea[4] + '~' + linea[9] + '#' not in encontrados:
  380. tiempo = time.mktime(time.strptime(linea[5], "%Y%m%d%H%M%S"))
  381.  
  382. diff = tiempo - tiempo_ahora
  383.  
  384. if diff >= -10800 and diff <= 10800:
  385.  
  386. competis.append({
  387. 'n':linea[4],
  388. 'i':linea[10],
  389. 'f':linea[11],
  390. 't':linea[5],
  391. 'd':linea[9]
  392. })
  393. encontrados = encontrados + '#' + linea[4] + '~' + linea[9] + '#'
  394.  
  395.  
  396. lineas = get_lista(0)
  397.  
  398. eventos = []
  399. encontrados = ''
  400.  
  401. for linea in lineas:
  402. if '#' + linea[0] + '~' + linea[4] + '~' + linea[9] + '#' not in encontrados:
  403. tiempo = time.mktime(time.strptime(linea[5], "%Y%m%d%H%M%S"))
  404.  
  405. diff = tiempo - tiempo_ahora
  406.  
  407. if diff >= -10800 and diff <= 10800:
  408.  
  409. eventos.append({
  410. 'n':linea[0],
  411. 'd':format_fecha(linea[5]),
  412. 'o':linea[5],
  413. 't':linea[6],
  414. 'i':linea[7],
  415. 'f':linea[8],
  416. 'c':linea[4],
  417. 's':linea[9]
  418. })
  419. encontrados = encontrados + '#' + linea[0] + '~' + linea[4] + '~' + linea[9] + '#'
  420.  
  421. eventos = sorted(eventos, key = lambda i: i['o'],reverse=False)
  422.  
  423.  
  424.  
  425.  
  426. """
  427. KABYLIE - BELOUIZDAD~
  428. http://cdn.sportcast.fun/webplayer.php?t=ifrx&c=1499585&lang=en&eid=1011710&lid=1499585&ci=958&si=1~
  429. -~
  430. -~
  431. PRIMERA DIVISIÓN DE ALGERIA~
  432. 20201211150000~
  433. ~
  434. https://i.imgur.com/dzflmHa.jpg~
  435. https://www.irishtimes.com/polopoly_fs/1.1907346.1408968521!/image/image.jpg_gen/derivatives/box_620_330/image.jpg~
  436. FÚTBOL~
  437. https://i.imgur.com/dzflmHa.jpg~
  438. https://www.irishtimes.com/polopoly_fs/1.1907346.1408968521!/image/image.jpg_gen/derivatives/box_620_330/image.jpg~
  439. https://i.imgur.com/F8FKJjp.jpg~
  440. https://wallpaperstock.net/wallpapers/thumbs1/21883wide.jpg~
  441. 1~
  442. 90~
  443. """
  444.  
  445.  
  446.  
  447. lineas = get_lista(14)
  448.  
  449. deportes = []
  450. encontrados = ''
  451.  
  452. for linea in lineas:
  453.  
  454. if '#' + linea[9] + '#' not in encontrados:
  455.  
  456. tiempo = time.mktime(time.strptime(linea[5], "%Y%m%d%H%M%S"))
  457.  
  458. diff = tiempo - tiempo_ahora
  459.  
  460. if diff >= -10800 and diff <= 10800:
  461.  
  462. deportes.append({
  463. 'n':linea[9],
  464. 'i':linea[12],
  465. 'f':linea[13]
  466. })
  467. encontrados = encontrados + '#' + linea[9] + '#'
  468.  
  469. for deporte in deportes:
  470. """
  471. url=build_url({'tarea':'competis','deporte':deporte['n']})
  472. item=xbmcgui.ListItem('[B]' + deporte['n'] + '[/B]', iconImage=deporte['i'])
  473. item.setInfo(type="Video",infoLabels={"plot":deporte['n'], "Title":'[B]' + deporte['n'] + '[/B]'})
  474. item.setArt({'fanart':deporte['f'], 'poster':deporte['i'], 'icon':deporte['i']})
  475. xbmcplugin.addDirectoryItem(handle=addon_handle,url=url,listitem=item,isFolder=True)
  476. """
  477.  
  478. for competi in competis:
  479.  
  480. if competi['d'] == deporte['n']:
  481.  
  482. if competi['i'] != blancos:
  483.  
  484. url=build_url({'tarea':'eventos','competi':competi['n'],'deporte':competi['d']})
  485. item=xbmcgui.ListItem('[B]' + deporte['n'] + ' | [COLOR antiquewhite]' + competi['n'] + '[/COLOR][/B]', iconImage=deporte['i'])
  486. item.setInfo(type="Video",infoLabels={"plot":competi['n'], "Title":'[B]' + deporte['n'] + ' | [COLOR antiquewhite]' + competi['n'] + '[/COLOR][/B]'})
  487. item.setArt({'fanart':deporte['f'], 'poster':deporte['i'], 'icon':deporte['i']})
  488. xbmcplugin.addDirectoryItem(handle=addon_handle,url=url,listitem=item,isFolder=True)
  489.  
  490. for evento in eventos:
  491.  
  492. if evento['i'] != blancos:
  493.  
  494. if competi['n'] == evento['c'] and competi['d'] == evento['s']:
  495.  
  496. if evento['n'].strip() != '-':
  497.  
  498. color = get_color(evento['o'])
  499.  
  500. if color == 'orangered' or color == 'springgreen':
  501. titulo = ' > [B][COLOR ' + color + ']' + evento['d'] + '[/COLOR] | ' + evento['n'] + '[/B]'
  502. else:
  503. titulo = ' > [COLOR ' + color + '][I]' + evento['d'] + ' | ' + evento['n'] + '[/I][/COLOR]'
  504.  
  505. if evento['t'] == '':
  506. plot = evento['n']
  507. else:
  508. plot = evento['t']
  509.  
  510. try:
  511. url=build_url({'tarea':'enlaces','evento':evento['n'],'fanart':evento['f'], 'poster':evento['i'], 'd':evento['d']})
  512. except:
  513. url=build_url({'tarea':'enlaces','evento':evento['n'],'fanart':evento['f'], 'poster':evento['i'], 'd':evento['d']})
  514. item=xbmcgui.ListItem(titulo, iconImage=evento['i'])
  515. item.setInfo(type="Video",infoLabels={"plot":plot, "Title":titulo})
  516. item.setArt({'fanart':evento['f'], 'poster':evento['i'], 'icon':evento['i']})
  517. xbmcplugin.addDirectoryItem(handle=addon_handle,url=url,listitem=item,isFolder=True)
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525. xbmcplugin.endOfDirectory(addon_handle)
  526.  
  527. """
  528. lineas = get_lista(15)
  529.  
  530. competis = []
  531. encontrados2 = ''
  532.  
  533. for linea2 in lineas2:
  534. if '#' + linea2[4] + '~' + linea2[9] + '#' not in encontrados2:
  535. competis.append({
  536. 'n':linea2[4],
  537. 'i':linea2[10],
  538. 'f':linea2[11],
  539. 't':linea2[5]
  540. })
  541. encontrados2 = encontrados2 + '#' + linea2[4] + '~' + linea[9] + '#'
  542.  
  543. for competi in competis:
  544.  
  545. tiempo = time.mktime(time.strptime(competi['t'], "%Y%m%d%H%M%S"))
  546.  
  547. diff = tiempo - tiempo_ahora
  548.  
  549. if diff >= -3600 and diff <= 3600:
  550.  
  551. url=build_url({'tarea':'eventos','competi':competi['n']})
  552. item=xbmcgui.ListItem('[B]' + competi['n'] + '[/B]', iconImage=competi['i'])
  553. item.setInfo(type="Video",infoLabels={"plot":competi['n'], "Title":'[B]' + competi['n'] + '[/B]'})
  554. item.setArt({'fanart':competi['f'], 'poster':competi['i'], 'icon':competi['i']})
  555. xbmcplugin.addDirectoryItem(handle=addon_handle,url=url,listitem=item,isFolder=True)
  556.  
  557. xbmcplugin.endOfDirectory(addon_handle)
  558. """
  559.  
  560.  
  561. elif tarea[0]=='competis':
  562.  
  563. lineas = get_lista(15)
  564.  
  565. competis = []
  566. encontrados = ''
  567.  
  568. for linea in lineas:
  569. if '#' + linea[4] + '~' + linea[9] + '#' not in encontrados:
  570. if only_legal_chars(linea[9]) == only_legal_chars(args['deporte'][0]):
  571. competis.append({
  572. 'n':linea[4],
  573. 'i':linea[10],
  574. 'f':linea[11]
  575. })
  576. encontrados = encontrados + '#' + linea[4] + '~' + linea[9] + '#'
  577.  
  578. for competi in competis:
  579. if competi['i'] != blancos:
  580. url=build_url({'tarea':'eventos','competi':competi['n'],'deporte':args['deporte'][0]})
  581. item=xbmcgui.ListItem('[B]' + competi['n'] + '[/B]', iconImage=competi['i'])
  582. item.setInfo(type="Video",infoLabels={"plot":competi['n'], "Title":'[B]' + competi['n'] + '[/B]'})
  583. item.setArt({'fanart':competi['f'], 'poster':competi['i'], 'icon':competi['i']})
  584. xbmcplugin.addDirectoryItem(handle=addon_handle,url=url,listitem=item,isFolder=True)
  585. xbmcplugin.endOfDirectory(addon_handle)
  586.  
  587. elif tarea[0]=='eventos':
  588.  
  589. lineas = get_lista(0)
  590.  
  591. eventos = []
  592. encontrados = ''
  593.  
  594. for linea in lineas:
  595. if '#' + linea[0] + '~' + linea[4] + '~' + linea[9] + '#' not in encontrados:
  596. if only_legal_chars(linea[4]) == only_legal_chars(args['competi'][0]) and only_legal_chars(linea[9]) == only_legal_chars(args['deporte'][0]):
  597. eventos.append({
  598. 'n':linea[0],
  599. 'd':format_fecha(linea[5]),
  600. 'o':linea[5],
  601. 't':linea[6],
  602. 'i':linea[7],
  603. 'f':linea[8]
  604. })
  605. encontrados = encontrados + '#' + linea[0] + '~' + linea[4] + '~' + linea[9] + '#'
  606.  
  607. eventos = sorted(eventos, key = lambda i: i['o'],reverse=False)
  608.  
  609. for evento in eventos:
  610.  
  611. if evento['n'].strip() != '-':
  612.  
  613. if evento['i'] != blancos:
  614.  
  615. color = get_color(evento['o'])
  616.  
  617. if color == 'orangered' or color == 'springgreen':
  618. titulo = '[B][COLOR ' + color + ']' + evento['d'] + '[/COLOR] | ' + evento['n'] + '[/B]'
  619. else:
  620. titulo = '[COLOR ' + color + '][I]' + evento['d'] + ' | ' + evento['n'] + '[/I][/COLOR]'
  621.  
  622. if evento['t'] == '':
  623. plot = evento['n']
  624. else:
  625. plot = evento['t']
  626.  
  627. url=build_url({'tarea':'enlaces','evento':evento['n'],'fanart':evento['f'], 'poster':evento['i'], 'd':evento['d']})
  628. item=xbmcgui.ListItem(titulo, iconImage=evento['i'])
  629. item.setInfo(type="Video",infoLabels={"plot":plot, "Title":titulo})
  630. item.setArt({'fanart':evento['f'], 'poster':evento['i'], 'icon':evento['i']})
  631. xbmcplugin.addDirectoryItem(handle=addon_handle,url=url,listitem=item,isFolder=True)
  632. xbmcplugin.endOfDirectory(addon_handle)
  633.  
  634. elif tarea[0]=='enlaces':
  635.  
  636. lineas = get_lista(0)
  637.  
  638. enlaces = []
  639. encontrados = ''
  640.  
  641. for linea in lineas:
  642. if '#' + linea[1] + '~' + linea[0] + '~' + linea[4] + '~' + linea[9] + '#' not in encontrados:
  643. if only_legal_chars(linea[0]) == only_legal_chars(args['evento'][0]):
  644. enlaces.append({
  645. 'n':linea[0],
  646. 'd':args['d'][0],
  647. 'u':linea[1],
  648. 't':linea[6],
  649. 'i':args['poster'][0],
  650. 'f':args['fanart'][0],
  651. 'l':lang_lang(linea[2]),
  652. 'fl':linea[2],
  653. 'q':linea[3],
  654. 'c':linea[4]
  655. })
  656. encontrados = encontrados + '#' + linea[1] + '~' + linea[0] + '~' + linea[4] + '~' + linea[9] + '#'
  657.  
  658. enlaces_por_orden = ordena_enlaces(enlaces)
  659.  
  660. e = 1
  661. for enlace in enlaces_por_orden:
  662.  
  663. if enlace['i'] != blancos:
  664.  
  665. if enlace['l'] != '-':
  666. l = enlace['l'] + ' | '
  667. else:
  668. l = ''
  669.  
  670. if enlace['d'] != '-':
  671. d = enlace['d'] + ' | '
  672. else:
  673. d = ''
  674.  
  675. if enlace['q'] != '-':
  676. q = enlace['q'] + ' | '
  677. else:
  678. q = ''
  679.  
  680. if 'linkotes:' in enlace['u'] or 'acestream:' in enlace['u']:
  681. titulo = 'ACE ' + str(e) + ' | ' + l + d + q + enlace['n'] + ' | Acestream'
  682. plot = enlace['n'] + "\n\n" + enlace['c'] + "\n\n" + 'ACE ' + str(e) + ' | ' + l + d + q
  683. else:
  684. titulo = 'OP ' + str(e) + ' | ' + l + d + q + enlace['n']
  685. plot = enlace['n'] + "\n\n" + enlace['c'] + "\n\n" + 'OP ' + str(e) + ' | ' + l + d + q
  686.  
  687. plot_p = plot.split('|')
  688. plot_p.pop()
  689. plot = '|'.join(plot_p).strip()
  690.  
  691. item=xbmcgui.ListItem(titulo, iconImage=enlace['i'])
  692. item.setLabel(titulo)
  693. item.setInfo(type="Video", infoLabels = {"plot" : plot, 'Title': titulo})
  694. item.setArt({'fanart':enlace['f'], 'poster':enlace['i'], 'icon':enlace['i']})
  695.  
  696. if '//dailysport' in enlace['u']:
  697. url=build_url({'tarea':'resolve','resuelve':'dailysport','url':enlace['u'],'titulo':titulo,'plot':plot,'fanart':enlace['f'], 'poster':enlace['i']})
  698. xbmcplugin.addDirectoryItem(handle=addon_handle,url=url,listitem=item,isFolder=True)
  699. elif 'dpelota.com/' in enlace['u']:
  700. url=build_url({'tarea':'resolve','resuelve':'dpelota','url':enlace['u'],'titulo':titulo,'plot':plot,'fanart':enlace['f'], 'poster':enlace['i']})
  701. xbmcplugin.addDirectoryItem(handle=addon_handle,url=url,listitem=item,isFolder=True)
  702. elif 'assia1.tv' in enlace['u']:
  703. url=build_url({'tarea':'resolve','resuelve':'assia','url':enlace['u'],'titulo':titulo,'plot':plot,'fanart':enlace['f'], 'poster':enlace['i']})
  704. xbmcplugin.addDirectoryItem(handle=addon_handle,url=url,listitem=item,isFolder=True)
  705. elif 'iraffletv.com/' in enlace['u']:
  706. url=build_url({'tarea':'resolve','resuelve':'iraffletv','url':enlace['u'],'titulo':titulo,'plot':plot,'fanart':enlace['f'], 'poster':enlace['i']})
  707. xbmcplugin.addDirectoryItem(handle=addon_handle,url=url,listitem=item,isFolder=True)
  708. elif 'sportcast.fun' in enlace['u'] or 'sportcast.life' in enlace['u'] or 'yoursports.stream' in enlace['u'] or 'cdn.livetv' in enlace['u']:
  709. url=build_url({'tarea':'resolve','resuelve':'sportcast','url':enlace['u'],'titulo':titulo,'plot':plot,'fanart':enlace['f'], 'poster':enlace['i']})
  710. xbmcplugin.addDirectoryItem(handle=addon_handle,url=url,listitem=item,isFolder=True)
  711. elif 'youtube' in enlace['u']:
  712. url=build_url({'tarea':'resolve','resuelve':'youtube','url':enlace['u'],'titulo':titulo,'plot':plot,'fanart':enlace['f'], 'poster':enlace['i']})
  713. xbmcplugin.addDirectoryItem(handle=addon_handle,url=url,listitem=item,isFolder=True)
  714. elif 'sports-stream.link' in enlace['u']:
  715. url=build_url({'tarea':'resolve','resuelve':'sports-stream','url':enlace['u'],'titulo':titulo,'plot':plot,'fanart':enlace['f'], 'poster':enlace['i']})
  716. xbmcplugin.addDirectoryItem(handle=addon_handle,url=url,listitem=item,isFolder=True)
  717. elif 'rojadirectatv' in enlace['u']:
  718. url=build_url({'tarea':'resolve','resuelve':'rojadirectatv','url':enlace['u'],'titulo':titulo,'plot':plot,'fanart':enlace['f'], 'poster':enlace['i']})
  719. xbmcplugin.addDirectoryItem(handle=addon_handle,url=url,listitem=item,isFolder=True)
  720. elif 'sportzonline' in enlace['u']:
  721. url=build_url({'tarea':'resolve','resuelve':'sportzonline','url':enlace['u'],'titulo':titulo,'plot':plot,'fanart':enlace['f'], 'poster':enlace['i']})
  722. xbmcplugin.addDirectoryItem(handle=addon_handle,url=url,listitem=item,isFolder=True)
  723. elif 'daddylive' in enlace['u']:
  724. url=build_url({'tarea':'resolve','resuelve':'daddylive','url':enlace['u'],'titulo':titulo,'plot':plot,'fanart':enlace['f'], 'poster':enlace['i']})
  725. xbmcplugin.addDirectoryItem(handle=addon_handle,url=url,listitem=item,isFolder=True)
  726. elif 'gooru.live' in enlace['u']:
  727. url=build_url({'tarea':'resolve','resuelve':'gooru','url':enlace['u'],'titulo':titulo,'plot':plot,'fanart':enlace['f'], 'poster':enlace['i']})
  728. xbmcplugin.addDirectoryItem(handle=addon_handle,url=url,listitem=item,isFolder=True)
  729. elif 'tinyurl' in enlace['u']:
  730. url=build_url({'tarea':'resolve','resuelve':'tinyurl','url':enlace['u'],'titulo':titulo,'plot':plot,'fanart':enlace['f'], 'poster':enlace['i']})
  731. xbmcplugin.addDirectoryItem(handle=addon_handle,url=url,listitem=item,isFolder=True)
  732. elif 'linkotes:' in enlace['u'] or 'acestream:' in enlace['u'] or 'footters:' in enlace['u'] or 'resolver:' in enlace['u'] or 'twitch:' in enlace['u']:
  733. r = enlace['u'].split(':')
  734. r_url = enlace['u'].replace(r[0] + ':','')
  735. url=build_url({'tarea':'resolve','resuelve':r[0],'url':r_url,'titulo':titulo,'plot':plot,'fanart':enlace['f'], 'poster':enlace['i']})
  736. xbmcplugin.addDirectoryItem(handle=addon_handle,url=url,listitem=item,isFolder=True)
  737. else:
  738.  
  739. url=build_url({'tarea':'resolve','resuelve':'footters','url':enlace['u'],'titulo':titulo,'plot':plot,'fanart':enlace['f'], 'poster':enlace['i']})
  740. xbmcplugin.addDirectoryItem(handle=addon_handle,url=url,listitem=item,isFolder=True)
  741.  
  742. #enlace['u'] = enlace['u'].replace('gusanito','~')
  743. #item.setProperty("IsPlayable","true")
  744. #xbmcplugin.addDirectoryItem(handle=addon_handle,url=enlace['u'],listitem=item,isFolder=False)
  745. e = e + 1
  746. xbmcplugin.endOfDirectory(addon_handle)
  747.  
  748. elif tarea[0]=='resolve':
  749. main.resolve(args)
  750.  
  751. elif tarea[0] == 'f4mcifrado':
  752. main.f4mcifrado(args)
  753.  
Add Comment
Please, Sign In to add comment