Skip to content

Commit

Permalink
Merge pull request #1359 from lopezvg/master
Browse files Browse the repository at this point in the history
ARREGLOS Y MEJORAS
  • Loading branch information
SistemaRayoXP authored Nov 19, 2024
2 parents a2a301b + 5cd786c commit a90dcba
Show file tree
Hide file tree
Showing 23 changed files with 449 additions and 142 deletions.
4 changes: 2 additions & 2 deletions plugin.video.alfa/channels/dontorrent.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@
"visible": "!eq(-1,false)"
},
{
"id": "btdigg_cf_clearance",
"id": "external_cookies",
"type": "text",
"label": "¿Introduzca el valor *cf_clearance* de la Cookie de BTDigg?",
"label": "¿Introduce el valor *cf_clearance* de la Cookie de BTDigg?",
"default": "",
"enabled": true,
"visible": "!eq(-2,false)"
Expand Down
25 changes: 21 additions & 4 deletions plugin.video.alfa/channels/dontorrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@
canonical = {
'channel': 'dontorrent',
'host': config.get_setting("current_host", 'dontorrent', default=''),
'host_alt': ["https://dontorrent.gratis/", "https://elitedivx.net/", "https://lilatorrent.com/",
'host_alt': ["https://dontorrent.gallery/", "https://elitedivx.net/", "https://lilatorrent.com/",
"https://mastorrents.net/", "https://reinventorrent.org/", "https://todotorrents.org/",
"https://www14.dontorrent.link/", "https://tomadivx.net/"],
'host_black_list': ["https://dontorrent.faith/", "https://dontorrent.exposed/",
"https://www17.dontorrent.link/", "https://tomadivx.net/"],
'host_black_list': ["https://www16.dontorrent.link/", "https://dontorrent.fashion/",
"https://dontorrent.equipment/", "https://www15.dontorrent.link/", "https://dontorrent.gratis/",
"https://www15.dontorrent.link/", "https://dontorrent.faith/", "https://dontorrent.exposed/",
"https://dontorrent.education/", "https://dontorrent.email/", "https://dontorrent.date/",
"https://dontorrent.earth/", "https://dontorrent.cricket/", "https://dontorrent.dance/",
"https://dontorrent.cologne/", "https://dontorrent.city/", "https://dontorrent.esq/",
Expand Down Expand Up @@ -395,9 +397,12 @@ def list_all_matches(item, matches_int, **AHkwargs):
elem_json['quality'] = '*%s' % re.sub(r'(?i)\(|\)|Ninguno', '',
elem_a.find_next_sibling('span', class_='text-muted').get_text(strip=True))
elem_json['title'] = re.sub(r'\[([^\]]+)\]', '', elem_json['title'])
elem_json['title'] = re.sub(r'(?i)\s*\[*\(*(?:3d|4k)\)*\]*', '', elem_json['title'])
elif tv_path in elem_json['url']:
elem_json['quality'] = scrapertools.find_single_match(elem_json['title'], r'\[([^\]]+)\]')
elem_json['quality'] = 'HDTV-720p' if '720p' in elem_json['quality'] else 'HDTV'
if '3d' in elem_json['title'].lower() and '3d' not in elem_json['quality'].lower():
elem_json['quality'] = '%s,3d' % elem_json['quality']

except Exception:
logger.error(elem_a)
Expand Down Expand Up @@ -478,13 +483,16 @@ def list_all_matches(item, matches_int, **AHkwargs):
if items_found > 0: items_found -= 1
if movie_path not in elem_json['url'] and tv_path not in elem_json['url'] and docu_path not in elem_json['url']: continue
if movie_path in elem_json['url']:
elem_json['title'] = elem_a.get_text('|').split('|')[0].rstrip('.')
elem_json['title'] = (elem_a.get_text('|').split('|')[0] + elem_a.get_text('|').split('|')[1]).rstrip('.')
elem_json['quality'] = '*%s' % scrapertools.find_single_match(elem_a.get_text('|').split('|')[-2],
r'\((.*?)\)').replace('Ninguno', '')
else:
elem_json['title'] = re.sub(r'(?i)\s*\(.*?\).*?$', '', elem_a.get_text()).rstrip('.')
elem_json['quality'] = '*%s' % scrapertools.find_single_match(elem_a.get_text(), r'\((.*?)\)').replace('Ninguno', '')
if '3d' in elem_json['title'].lower() and '3d' not in elem_json['quality'].lower():
elem_json['quality'] = '%s,3d' % elem_json['quality']
elem_json['language'] = '*'
if movie_path in elem_json['url']: elem_json['title'] = re.sub(r'(?i)\s*\[*\(*(?:3d|4k)\)*\]*', '', elem_json['title'])

except Exception:
logger.error(elem_a)
Expand Down Expand Up @@ -517,6 +525,7 @@ def list_all_matches(item, matches_int, **AHkwargs):
elem_json['title'] = re.sub(r'\d{3,7}[-|_|\/]+\d{3,10}[-|\/]', '', elem_json['title'].split('/')[-1])
elem_json['title'] = re.sub(r'--[^\.|$]*|.jpg|.png|$', '', elem_json['title'])
elem_json['title'] = re.sub(r'-\d{6,10}-mmed(?:.jpg|.png|$)', '', elem_json['title'])
elem_json['title'] = re.sub(r'(?i)\s*\[*\(*(?:3d|4k)\)*\]*', '', elem_json['title'])
elem_json['title'] = elem_json['title'].replace('-', ' ').replace('_', ' ').strip()

else:
Expand All @@ -532,6 +541,8 @@ def list_all_matches(item, matches_int, **AHkwargs):
if not elem_json['title']:
elem_json['title'] = elem_json['url']
elem_json['title'] = scrapertools.remove_htmltags(elem_json['title'])
if '3d' in elem_json['title'].lower() and '3d' not in elem_json['quality'].lower():
elem_json['quality'] = '%s,3d' % elem_json['quality']

except Exception:
logger.error(elem_a)
Expand Down Expand Up @@ -604,6 +615,10 @@ def episodesxseason_matches(item, matches_int, **AHkwargs):
elem_json['season'], elem_json['episode'], alt_epi = \
scrapertools.find_single_match(sxe, r'(?i)(\d+)x(\d+)\s*al\s*(\d+)')
epi_rango = True
elif scrapertools.find_single_match(sxe, r'(?i)(\d+)x(\d+)\s*-\s*\d+x(\d+)'):
elem_json['season'], elem_json['episode'], alt_epi = \
scrapertools.find_single_match(sxe, r'(?i)(\d+)x(\d+)\s*-\s*\d+x(\d+)')
epi_rango = True
elif scrapertools.find_single_match(sxe, r'(?i)(\d+)x(\d+)\s*-\s*(\d+)'):
elem_json['season'], elem_json['episode'], alt_epi = \
scrapertools.find_single_match(sxe, r'(?i)(\d+)x(\d+)\s*-\s*(\d+)')
Expand Down Expand Up @@ -712,6 +727,8 @@ def findvideos_matches(item, matches_int, langs, response, **AHkwargs):

elem_json['quality'] = elem.find('b', class_='bold', string=re.compile('Formato:'))\
.find_previous('p').get_text('|', strip=True).split('|')[1]
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*'))\
Expand Down
8 changes: 8 additions & 0 deletions plugin.video.alfa/channels/hdfull.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@
"default": true,
"enabled": true,
"visible": true
},
{
"id": "external_cookies",
"type": "text",
"label": "¿Tienes cookies con formato dominio:nombre¡valor;nombre¡valor...|dominio:nombre¡valor... ?",
"default": "",
"enabled": true,
"visible": true
}
]
}
14 changes: 8 additions & 6 deletions plugin.video.alfa/channels/hdfull.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,18 @@
list_quality_tvshow = AlfaChannelHelper.LIST_QUALITY_TVSHOW
list_quality = list_quality_movies + list_quality_tvshow
list_servers = AlfaChannelHelper.LIST_SERVERS
forced_proxy_opt = 'ProxySSL'
forced_proxy_opt = None
assistant = False

# https://dominioshdfull.com/

canonical = {
'channel': 'hdfull',
'host': config.get_setting("current_host", 'hdfull', default=''),
"host_alt": ["https://hdfull.blog/", "https://hdfull.today/", "https://hdfull.quest/"],
"host_alt": ["https://hdfull.tel/", "https://hdfull.today/", "https://hdfull.quest/"],
'host_verification': '%slogin',
"host_black_list": ["https://hd-full.info/", "https://hd-full.sbs/", "https://hd-full.life/",
"host_black_list": ["https://hdfull.buzz/", "https://hdfull.blog/",
"https://hd-full.info/", "https://hd-full.sbs/", "https://hd-full.life/",
"https://hd-full.fit/", "https://hd-full.me/", "https://hd-full.vip/",
"https://hd-full.lol/", "https://hd-full.co/", "https://hd-full.biz/",
"https://hd-full.in/", "https://hd-full.im/", "https://hd-full.one/",
Expand Down Expand Up @@ -1248,7 +1249,7 @@ def agrupa_datos(url, post=None, referer=True, soup=False, json=False, force_che
if isinstance(referer, str):
headers.update({'Referer': referer})
if len(canonical['host_alt']) > 1:
url = verify_domain_alt(url, post=post, headers=headers, soup=False, json=False)
url = verify_domain_alt(url, post=post, headers=headers, soup=False, json=False, alfa_s=alfa_s or hide_infobox)

page = AlfaChannel.create_soup(url, post=post, headers=headers, ignore_response_code=True, timeout=timeout,
soup=False, json=False, canonical=canonical, hide_infobox=hide_infobox, alfa_s=alfa_s)
Expand Down Expand Up @@ -1296,7 +1297,7 @@ def agrupa_datos(url, post=None, referer=True, soup=False, json=False, force_che

return data

def verify_domain_alt(url, post=None, headers={}, soup=False, json=False):
def verify_domain_alt(url, post=None, headers={}, soup=False, json=False, alfa_s=True):
global host, host_save, canonical

host_alt = AlfaChannel.obtain_domain(url, scheme=True).rstrip('/') + '/'
Expand All @@ -1307,8 +1308,9 @@ def verify_domain_alt(url, post=None, headers={}, soup=False, json=False):
for host_alt in canonical['host_alt']:
canonical_alt['host'] = host_alt
canonical_alt['host_alt'] = [host_alt]
headers['Referer'] = host_alt
page = AlfaChannel.create_soup(host_alt + url_rest, post=post, headers=headers, ignore_response_code=True, timeout=timeout,
soup=soup, json=json, canonical=canonical_alt, alfa_s=True, proxy_retries=0, retries_cloudflare=0,
soup=soup, json=json, canonical=canonical_alt, alfa_s=alfa_s, proxy_retries=0, retries_cloudflare=0,
canonical_check=False)
if page.sucess:
url = host_alt + url_rest
Expand Down
5 changes: 3 additions & 2 deletions plugin.video.alfa/channels/mejortorrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
canonical = {
'channel': 'mejortorrent',
'host': config.get_setting("current_host", 'mejortorrent', default=''),
'host_alt': ["https://www21.mejortorrent.zip/"],
'host_black_list': ["https://www3.mejortorrent.rip/", 'https://mejortorrent.cc/', 'https://mejortorrent.one/',
'host_alt': ["https://www24.mejortorrent.zip/"],
'host_black_list': ["https://www23.mejortorrent.zip/", "https://www22.mejortorrent.zip/", "https://www21.mejortorrent.zip/",
"https://www3.mejortorrent.rip/", 'https://mejortorrent.cc/', 'https://mejortorrent.one/',
'https://mejortorrent.nz', 'https://www.mejortorrentes.org/'],
'pattern': '<div\s*class="header-logo[^>]*>\s*<a\s*href="([^"]+)"',
'set_tls': True, 'set_tls_min': True, 'retries_cloudflare': 1, 'forced_proxy_ifnot_assistant': forced_proxy_opt,
Expand Down
7 changes: 4 additions & 3 deletions plugin.video.alfa/channels/pelitorrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
canonical = {
'channel': 'pelitorrent',
'host': config.get_setting("current_host", 'pelitorrent', default=''),
'host_alt': ["https://www.pelitorrent.com/"],
'host_black_list': ["https://pelitorrent.com/", "https://pelitorrent.xyz/", "https://www.pelitorrent.com/"],
'host_alt': ["https://www.torrenflix.com/"],
'host_black_list': ["https://www.pelitorrent.com/",
"https://pelitorrent.com/", "https://pelitorrent.xyz/", "https://www.pelitorrent.com/"],
'pattern': "<link\s*rel='stylesheet'\s*id='menu-icons-extra-css'\s*href='([^']+)'",
'set_tls': True, 'set_tls_min': True, 'retries_cloudflare': 1, 'forced_proxy_ifnot_assistant': forced_proxy_opt,
'CF': False, 'CF_test': False, 'alfa_s': True
Expand Down Expand Up @@ -214,7 +215,7 @@ def section(item):
for letra in ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']:

itemlist.append(item.clone(action="list_all", title=letra, url=item.url + 'letters/%s/' % letra))
itemlist.append(item.clone(action="list_all", title=letra, url=item.url + 'letter/%s/' % letra))

return itemlist

Expand Down
3 changes: 3 additions & 0 deletions plugin.video.alfa/core/httptools.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ def set_cookies(dict_cookie, clear=True, alfa_s=False):
secure = dict_cookie.get("secure", False)
domain_initial_dot = dict_cookie.get("domain_initial_dot", False)

# Refrescamos las cookies
load_cookies(alfa_s=alfa_s)

# Borramos las cookies ya existentes en dicho dominio (cp)
if clear:
try:
Expand Down
1 change: 1 addition & 0 deletions plugin.video.alfa/core/proxytools_py3_3_13.py

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions plugin.video.alfa/lib/AlfaChannelHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ def create_soup(self, url, item=Item(), **kwargs):
:return: objeto soup o response sino soup
"""
global DEBUG
from lib.generictools import js2py_conversion, check_blocked_IP
from lib.generictools import js2py_conversion, check_blocked_IP, get_cached_files_
get_cached_files_('password')

if "soup" not in kwargs: kwargs["soup"] = True
json = kwargs.pop("json", False)
Expand Down Expand Up @@ -524,13 +525,13 @@ def urlparse(self, url, scheme='', allow_fragments=True):

return urlparse(url, scheme=scheme, allow_fragments=allow_fragments)

def parse_qs(self, url, keep_blank_values=False, strict_parsing=False, max_num_fields=None):
def parse_qs(self, url, keep_blank_values=False, strict_parsing=False, encoding="utf-8", errors="replace", max_num_fields=None):
if PY3:
from urllib.parse import parse_qs
return parse_qs(url, keep_blank_values, strict_parsing, encoding, errors, max_num_fields)
else:
from urlparse import parse_qs

return parse_qs(url, keep_blank_values=keep_blank_values, strict_parsing=strict_parsing, max_num_fields=max_num_fields)
return parse_qs(url, keep_blank_values, strict_parsing)

def obtain_domain(self, url, sub=False, point=False, scheme=False):

Expand Down Expand Up @@ -1844,7 +1845,7 @@ def list_all(self, item, data='', matches_post=None, postprocess=None, genericto
new_item.matches.append(elem.get('matches', []) or elem.copy())

# Busca alias a los títulos para mejora TMDB
if generictools: check_alternative_tmdb_id(new_item, tmdb_check=False)
check_alternative_tmdb_id(new_item, tmdb_check=False)

# Ahora se filtra por idioma, si procede, y se pinta lo que vale
if self.filter_languages > 0 and self.list_language and not BTDIGG_URL_SEARCH in new_item.url \
Expand Down
2 changes: 1 addition & 1 deletion plugin.video.alfa/lib/alfaresolver.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugin.video.alfa/lib/alfaresolver_py3_3_06.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugin.video.alfa/lib/alfaresolver_py3_3_07.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugin.video.alfa/lib/alfaresolver_py3_3_08.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugin.video.alfa/lib/alfaresolver_py3_3_09.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugin.video.alfa/lib/alfaresolver_py3_3_10.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugin.video.alfa/lib/alfaresolver_py3_3_11.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugin.video.alfa/lib/alfaresolver_py3_3_12.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions plugin.video.alfa/lib/alfaresolver_py3_3_13.py

Large diffs are not rendered by default.

Loading

0 comments on commit a90dcba

Please sign in to comment.