From 87d00ffa67f3e2bfd5d386bcebb591fa9195b109 Mon Sep 17 00:00:00 2001 From: Kingbox <37674310+lopezvg@users.noreply.github.com> Date: Thu, 22 Jan 2026 13:49:02 +0100 Subject: [PATCH 1/6] Adaptaciones a Python 3.14 Normaliza expresiones Regex --- plugin.video.alfa/channels/cinecalidad.py | 24 ++--- plugin.video.alfa/channels/cuevana2.py | 12 +-- plugin.video.alfa/channels/dontorrent.py | 4 +- plugin.video.alfa/channels/grantorrent.py | 46 +++++----- plugin.video.alfa/channels/hdfull.py | 4 +- plugin.video.alfa/channels/mitorrent.py | 32 +++---- plugin.video.alfa/channels/pelisxd.py | 12 +-- plugin.video.alfa/channels/pelitorrent.py | 28 +++--- plugin.video.alfa/channels/serieskao.py | 1 + plugin.video.alfa/channels/tubeonline.py | 14 ++- plugin.video.alfa/channels/wolfmax4k.py | 34 +++---- plugin.video.alfa/core/channeltools.py | 4 +- plugin.video.alfa/core/filetools.py | 32 +++---- plugin.video.alfa/core/item.py | 4 +- plugin.video.alfa/core/proxytools.py | 2 +- plugin.video.alfa/core/proxytools_py3_3_06.py | 2 +- plugin.video.alfa/core/proxytools_py3_3_07.py | 2 +- plugin.video.alfa/core/proxytools_py3_3_08.py | 2 +- plugin.video.alfa/core/proxytools_py3_3_09.py | 2 +- plugin.video.alfa/core/proxytools_py3_3_10.py | 2 +- plugin.video.alfa/core/proxytools_py3_3_11.py | 2 +- plugin.video.alfa/core/proxytools_py3_3_12.py | 2 +- plugin.video.alfa/core/proxytools_py3_3_13.py | 2 +- plugin.video.alfa/core/proxytools_py3_3_14.py | 1 + plugin.video.alfa/core/scrapertools.py | 24 ++--- plugin.video.alfa/core/servertools.py | 4 +- plugin.video.alfa/core/tmdb.py | 6 +- plugin.video.alfa/core/videolibrarytools.py | 30 +++--- plugin.video.alfa/lib/AlfaChannelHelper.py | 2 +- plugin.video.alfa/lib/alfa_assistant.py | 4 +- plugin.video.alfa/lib/alfaresolver.py | 2 +- .../lib/alfaresolver_py3_3_06.py | 2 +- .../lib/alfaresolver_py3_3_07.py | 2 +- .../lib/alfaresolver_py3_3_08.py | 2 +- .../lib/alfaresolver_py3_3_09.py | 2 +- .../lib/alfaresolver_py3_3_10.py | 2 +- .../lib/alfaresolver_py3_3_11.py | 2 +- .../lib/alfaresolver_py3_3_12.py | 2 +- .../lib/alfaresolver_py3_3_13.py | 2 +- .../lib/alfaresolver_py3_3_14.py | 1 + .../lib/cloudscraper/cf_assistant.py | 10 +- plugin.video.alfa/lib/generictools.py | 2 +- plugin.video.alfa/lib/quasar/quasar/daemon.py | 4 +- plugin.video.alfa/modules/downloads.py | 72 +++++++-------- plugin.video.alfa/platformcode/config.py | 6 +- plugin.video.alfa/platformcode/custom_code.py | 16 ++-- plugin.video.alfa/platformcode/envtal.py | 18 ++-- plugin.video.alfa/platformcode/launcher.py | 4 +- .../platformcode/platformtools.py | 28 +++--- .../platformcode/xbmc_videolibrary.py | 18 ++-- plugin.video.alfa/servers/torrent.py | 92 +++++++++---------- plugin.video.alfa/servers/vidhidepro.py | 27 ++---- 52 files changed, 325 insertions(+), 331 deletions(-) create mode 100644 plugin.video.alfa/core/proxytools_py3_3_14.py create mode 100644 plugin.video.alfa/lib/alfaresolver_py3_3_14.py diff --git a/plugin.video.alfa/channels/cinecalidad.py b/plugin.video.alfa/channels/cinecalidad.py index 82bc494da..766105990 100644 --- a/plugin.video.alfa/channels/cinecalidad.py +++ b/plugin.video.alfa/channels/cinecalidad.py @@ -70,10 +70,10 @@ 'get_quality': {}, 'get_quality_rgx': [], 'next_page': {}, - 'next_page_rgx': [['\/page\/\d+', '/page/%s/']], + 'next_page_rgx': [[r'\/page\/\d+', '/page/%s/']], 'last_page': dict([('find', [{'tag': ['nav'], 'class': ['pagination']}]), ('find_all',[{'tag': ['a'], '@POS': [-2]}]), - ('get_text', [{'tag': '', '@STRIP': True, '@TEXT': '(\d+)'}])]), + ('get_text', [{'tag': '', '@STRIP': True, '@TEXT': r'(\d+)'}])]), 'year': {}, 'season_episode': {}, 'seasons': {}, @@ -86,14 +86,14 @@ 'episode_clean': [], 'plot': {}, 'findvideos': {'find_all': [{'tag': ['a'], 'class': ['inline-block']}]}, - 'title_clean': [['(?i)TV|Online|(4k-hdr)|(fullbluray)|4k| - 4k|(3d)|miniserie|\s*imax', ''], - ['(?i)[\[|\(]?\d{3,4}p[\]|\)]?|[\[|\(]?(?:4k|3d|uhd|hdr)[\]|\)]?', ''], - ['(?i)[-|\(]?\s*HDRip\)?|microHD|\(?BR-LINE\)?|\(?HDTS-SCREENER\)?', ''], - ['(?i)\(?BDRip\)?|\(?BR-Screener\)?|\(?DVDScreener\)?|\(?TS-Screener\)?|[\(|\[]\S*\.*$', ''], - ['(?i)Castellano-*|Ingl.s|Trailer|Audio|\(*SBS\)*|\[*\(*dvd\s*r\d*\w*\]*\)*|[\[|\(]*dv\S*[\)|\]]*', ''], - ['(?i)Dual|Subt\w*|\(?Reparado\)?|\(?Proper\)?|\(?Latino\)?|saga(?:\s*del)?', ''], - ['(?i)(?:\s*–)?\s*temp.*?\d+.*', ''], ['\d?\d?.*', ''], ['\d+[x|×]\d+.*', ''], - ['[\(|\[]\s*[\)|\]]', ''], ['(?i)(?:libro|volumen)?\s+\d{1,2}$', '']], + 'title_clean': [[r'(?i)TV|Online|(4k-hdr)|(fullbluray)|4k| - 4k|(3d)|miniserie|\s*imax', ''], + [r'(?i)[\[|\(]?\d{3,4}p[\]|\)]?|[\[|\(]?(?:4k|3d|uhd|hdr)[\]|\)]?', ''], + [r'(?i)[-|\(]?\s*HDRip\)?|microHD|\(?BR-LINE\)?|\(?HDTS-SCREENER\)?', ''], + [r'(?i)\(?BDRip\)?|\(?BR-Screener\)?|\(?DVDScreener\)?|\(?TS-Screener\)?|[\(|\[]\S*\.*$', ''], + [r'(?i)Castellano-*|Ingl.s|Trailer|Audio|\(*SBS\)*|\[*\(*dvd\s*r\d*\w*\]*\)*|[\[|\(]*dv\S*[\)|\]]*', ''], + [r'(?i)Dual|Subt\w*|\(?Reparado\)?|\(?Proper\)?|\(?Latino\)?|saga(?:\s*del)?', ''], + [r'(?i)(?:\s*–)?\s*temp.*?\d+.*', ''], [r'\d?\d?.*', ''], [r'\d+[x|×]\d+.*', ''], + [r'[\(|\[]\s*[\)|\]]', ''], [r'(?i)(?:libro|volumen)?\s+\d{1,2}$', '']], 'quality_clean': [['(?i)proper|unrated|directors|cut|repack|internal|real|extended|masted|docu|super|duper|amzn|uncensored|hulu', '']], 'language_clean': [], 'url_replace': [], @@ -310,7 +310,7 @@ def list_all_matches(item, matches_int, **AHkwargs): try: elem_json['url'] = elem.a.get("href", "") if '/serie' in elem_json['url']: continue - if scrapertools.find_single_match(elem_json['url'], "\d+x\d+") or "episode" in elem_json['url']: continue + if scrapertools.find_single_match(elem_json['url'], r"\d+x\d+") or "episode" in elem_json['url']: continue if sufix[item.site or 0] and sufix[item.site or 0] not in elem_json['url']: elem_json['url'] += sufix[item.site or 0] @@ -322,7 +322,7 @@ def list_all_matches(item, matches_int, **AHkwargs): if not elem_json.get('year'): elem_json['year'] = '-' - if elem.find('div'): elem_json['year'] = scrapertools.find_single_match(elem.find('div').get_text(strip=True), '\d{4}') or '-' + if elem.find('div'): elem_json['year'] = scrapertools.find_single_match(elem.find('div').get_text(strip=True), r'\d{4}') or '-' elem_json['thumbnail'] = re.sub(r'(-\d+x\d+.jpg)', '.jpg', elem.find('img', class_="w-full").get("data-src", "") \ or elem.find('img', class_="w-full").get("src", "")) diff --git a/plugin.video.alfa/channels/cuevana2.py b/plugin.video.alfa/channels/cuevana2.py index 089bfe96e..1cb131813 100644 --- a/plugin.video.alfa/channels/cuevana2.py +++ b/plugin.video.alfa/channels/cuevana2.py @@ -49,13 +49,13 @@ 'get_quality': {}, 'get_quality_rgx': '', 'next_page': {}, - 'next_page_rgx': [['\/page\/\d+', '/page/%s']], + 'next_page_rgx': [[r'\/page\/\d+', '/page/%s']], 'last_page': dict([('find', [{'tag': ['ul'], 'class': ['pagination']}, {'tag': ['span'], 'class': ['visually-hidden'], 'string': re.compile('(?i)Last')}]), - ('find_previous', [{'tag': ['a'], 'class': ['page-link'], '@ARG': 'href', '@TEXT': '(\d+)'}])]), + ('find_previous', [{'tag': ['a'], 'class': ['page-link'], '@ARG': 'href', '@TEXT': r'(\d+)'}])]), 'year': dict([('find', [{'tag': ['div'], 'class': ['MovieItem_data__BdOz3', 'SerieItem_data__LFJR_']}, {'tag': ['span']}]), - ('get_text', [{'strip': True, '@TEXT': '(\d{4})'}])]), + ('get_text', [{'strip': True, '@TEXT': r'(\d{4})'}])]), 'season_episode': dict([('find', [{'tag': ['div'], 'class': ['EpisodeItem_data__jsvqZ']}, {'tag': ['span']}]), ('get_text', [{'tag': '', '@STRIP': True}])]), @@ -72,8 +72,8 @@ 'plot': {}, 'findvideos': dict([('find', [{'tag': ['script'], 'id': ['__NEXT_DATA__']}]), ('get_text', [{'tag': '', '@STRIP': False, '@JSON': 'props,pageProps,episode/post,players|DEFAULT'}])]), - 'title_clean': [['(?i)TV|Online|(4k-hdr)|(fullbluray)|4k| - 4k|(3d)|miniserie|\s*\(\d{4}\)', ''], - ['[\(|\[]\s*[\)|\]]', '']], + 'title_clean': [[r'(?i)TV|Online|(4k-hdr)|(fullbluray)|4k| - 4k|(3d)|miniserie|\s*\(\d{4}\)', ''], + [r'[\(|\[]\s*[\)|\]]', '']], 'quality_clean': [['(?i)proper|unrated|directors|cut|repack|internal|real|extended|masted|docu|super|duper|amzn|uncensored|hulu', '']], 'language_clean': [], 'url_replace': [], @@ -312,7 +312,7 @@ def play(item): return [] soup = soup.find("script", string=re.compile('start.onclick')).string - item.url = scrapertools.find_single_match(str(soup), "url\s*=\s*'([^']+)'") + item.url = scrapertools.find_single_match(str(soup), r"url\s*=\s*'([^']+)'") if item.url: itemlist = servertools.get_servers_itemlist([item]) else: diff --git a/plugin.video.alfa/channels/dontorrent.py b/plugin.video.alfa/channels/dontorrent.py index 47996990f..069d9dc9e 100644 --- a/plugin.video.alfa/channels/dontorrent.py +++ b/plugin.video.alfa/channels/dontorrent.py @@ -772,8 +772,8 @@ def findvideos_matches(item, matches_int, langs, response, **AHkwargs): if '3d' in elem_json['url'].lower() and '3d' not in elem_json['quality'].lower(): elem_json['quality'] = '%s,3d' % elem_json['quality'] - if elem.find('b', class_='bold', string=re.compile('Clave:\s*')): - elem_json['password'] = elem.find('b', class_='bold', string=re.compile('Clave:\s*'))\ + if elem.find('b', class_='bold', string=re.compile(r'Clave:\s*')): + elem_json['password'] = elem.find('b', class_='bold', string=re.compile(r'Clave:\s*'))\ .find_next('a').get('data-content', '') elem_json['password'] = item.password = scrapertools.find_single_match(elem_json['password'], "value='([^']+)'") except Exception: diff --git a/plugin.video.alfa/channels/grantorrent.py b/plugin.video.alfa/channels/grantorrent.py index b4fb16266..663338e57 100644 --- a/plugin.video.alfa/channels/grantorrent.py +++ b/plugin.video.alfa/channels/grantorrent.py @@ -30,7 +30,7 @@ "https://www1.grantorrent.wf/", "https://www1.grantorrent.pm/", "https://grantorrent.zip/", 'https://grantorrent.bz/', 'https://grantorrent.fi/', 'https://grantorrent.si/', 'https://grantorrent.re/', 'https://grantorrent.ac/', 'https://grantorrent.ch/'], - 'pattern': '