Skip to content

Commit

Permalink
Merge pull request #1351 from lopezvg/master
Browse files Browse the repository at this point in the history
ARREGLOS Y MEJORAS
  • Loading branch information
SistemaRayoXP authored Sep 25, 2024
2 parents df3d850 + 30dc88c commit e2e7d0a
Show file tree
Hide file tree
Showing 14 changed files with 425 additions and 197 deletions.
8 changes: 4 additions & 4 deletions plugin.video.alfa/channels/dontorrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
canonical = {
'channel': 'dontorrent',
'host': config.get_setting("current_host", 'dontorrent', default=''),
'host_alt': ["https://dontorrent.email/", "https://elitedivx.net/", "https://lilatorrent.com/",
'host_alt': ["https://dontorrent.exposed/", "https://elitedivx.net/", "https://lilatorrent.com/",
"https://mastorrents.net/", "https://reinventorrent.org/", "https://todotorrents.org/",
"https://www13.dontorrent.link/", "https://tomadivx.net/"],
'host_black_list': ["https://dontorrent.date/",
"https://www14.dontorrent.link/", "https://tomadivx.net/"],
'host_black_list': ["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/",
"https://dontorrent.cc/", "https://dontorrent.sbs/", "https://dontorrent.fyi/",
Expand Down Expand Up @@ -745,7 +745,7 @@ def search(item, texto, **AHkwargs):
try:
if texto:
if item.btdigg: item.btdigg = texto
item.url = item.referer = host + 'buscar/' + texto + '/page/1'
item.url = item.referer = host + 'buscar/' + texto
item.c_type = "search"
item.texto = texto
return list_all(item)
Expand Down
4 changes: 2 additions & 2 deletions plugin.video.alfa/channels/eztv.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
'controls': {'min_temp': min_temp, 'url_base64': True, 'add_video_to_videolibrary': True, 'cnt_tot': 20,
'get_lang': False, 'reverse': False, 'videolab_status': True, 'tmdb_extended_info': True, 'seasons_search': False,
'host_torrent': host_torrent, 'btdigg': False, 'duplicates': [], 'dup_list': 'title', 'dup_movies': True,
'join_dup_episodes': False, 'manage_torrents': True},
'join_dup_episodes': False, 'manage_torrents': True, 'sort_findvideos': True},
'timeout': timeout}
AlfaChannel = DictionaryAllChannel(host, movie_path=movie_path, tv_path=tv_path, canonical=canonical, finds=finds,
idiomas=IDIOMAS, language=language, list_language=list_language, list_servers=list_servers,
Expand Down Expand Up @@ -401,7 +401,7 @@ def findvideos_links(item, elem_in, elem_json):
elem_json['url'] = url.get('href', '')
if elem_json['url'].endswith('.torrent'): break
if elem_json.get('url'): elem_json['url'] = AlfaChannel.urljoin(host, elem_json['url'])
elif not elem_json.get('torrent_info'):
elif not elem_json.get('torrent_info') and not 'POST' in str(elem):
elem_json['torrent_info'] = elem_json['size'] = elem.get_text(strip=True)

if x == 3 and not elem_json.get('torrent_info'):
Expand Down
6 changes: 3 additions & 3 deletions plugin.video.alfa/channels/hdfull.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
canonical = {
'channel': 'hdfull',
'host': config.get_setting("current_host", 'hdfull', default=''),
"host_alt": ["https://hd-full.info/", "https://hdfull.today/", "https://hdfull.quest/"],
"host_alt": ["https://hdfull.blog/", "https://hdfull.today/", "https://hdfull.quest/"],
'host_verification': '%slogin',
"host_black_list": ["https://hd-full.sbs/", "https://hd-full.life/",
"host_black_list": ["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 @@ -954,7 +954,7 @@ def play(item):
item.info = {item.url.split("###")[1].split(";")[0]: item.url.split("###")[1].split(";")[0]}
item.url = item.url.split("###")[0]
mediatype = '1' if item.contentType == 'tvshow' else '2' if item.contentType == 'movie' else '3' if item.contentType == 'episode' else '4'
if item.info:
if item.info and config.get_setting("videolibrary_mark_as_watched"):
post = "target_id=%s&target_type=%s&target_status=1" % (list(item.info.keys())[0], mediatype)

data = agrupa_datos(AlfaChannel.urljoin(host, "a/status"), post=post, hide_infobox=True)
Expand Down
2 changes: 1 addition & 1 deletion plugin.video.alfa/channels/pelitorrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def episodesxseason_matches(item, matches_int, **AHkwargs):

for elem in matches_int:
elem_json = {}
logger.error(elem)
#logger.error(elem)

try:
sxe = elem.find('span', class_='num-epi').get_text(strip=True).split('x')
Expand Down
2 changes: 1 addition & 1 deletion plugin.video.alfa/core/httptools.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ def retry_alt(url, req, response_call, proxy_data, **opt):
if not canonical['host_alt']:
return url, response_call
host_a = scrapertools.find_single_match(url, patron_host)
url = re.sub('\?__cpo\=.*?$', '', url)
url = re.sub(r'\?__cpo\=.*?$', '', url)
if not host_a:
return url, response_call

Expand Down
28 changes: 20 additions & 8 deletions plugin.video.alfa/lib/AlfaChannelHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def __init__(self, host, timeout=15, channel='', movie_path="/movies", tv_path="
self.color_setting = unify.colors_file[UNIFY_PRESET]
self.window = window
self.Comment = None
self.SEARCH_CLEAN = '\¿|\?|\/|\$|\@|\<|\>|\.'

self.httptools = httptools
self.response = self.httptools.build_response(HTTPResponse=True) # crea estructura vacía de response
Expand Down Expand Up @@ -168,7 +169,9 @@ def __init__(self, host, timeout=15, channel='', movie_path="/movies", tv_path="
if self.host != self.domains_updated[self.channel].get('host_alt', [''])[0] or self.host != self.canonical['host_alt'][0] \
or self.domains_updated[self.channel].get('host_alt', []) != self.canonical['host_alt'] \
or self.domains_updated[self.channel].get('UPDATE_CANONICAL'):
self.host = self.canonical['host'] = self.domains_updated[self.channel].get('host_alt', [self.canonical['host']])[0]
self.host = self.canonical['host'] = self.domains_updated[self.channel].get('host_alt', ([self.canonical['host']] \
if self.canonical['host'] else []) \
or self.canonical['host_alt'])[0]
if config.get_setting("current_host", self.channel) != self.host:
config.set_setting("current_host", self.host, self.channel)
channel = __import__('channels.%s' % self.channel, None, None, ["channels.%s" % self.channel])
Expand Down Expand Up @@ -865,7 +868,7 @@ def find_language(self, elem_in, item):
if self.DEBUG: logger.debug('find_LANGUAGE: %s' % language)
return language

def convert_size(self, size):
def convert_size(self, size, silent=False):

if isinstance(size, (str, unicode)): size = size.replace('[COLOR magenta][B]RAR-[/B][/COLOR]', '')
s = 0
Expand All @@ -883,7 +886,7 @@ def convert_size(self, size):
except Exception:
if isinstance(size, float): s = size

if self.DEBUG: logger.debug('SIZE: %s / %s' % (size, s))
if self.DEBUG and not silent: logger.debug('SIZE: %s / %s' % (size, s))
return s

def convert_time(self, seconds):
Expand Down Expand Up @@ -1499,14 +1502,14 @@ def list_all(self, item, data='', matches_post=None, postprocess=None, genericto
self.btdigg_search = self.btdigg and finds.get('controls', {}).get('btdigg_search', False) \
and config.get_setting('find_alt_search', item.channel, default=False)
#if self.btdigg: self.cnt_tot = finds_controls.get('cnt_tot', 20)
if item.texto: item.texto = item.texto.replace('%20', ' ').replace('+', ' ').strip()
if item.texto: item.texto = re.sub(self.SEARCH_CLEAN, '', item.texto).strip()
if item.btdigg and item.c_type == 'search':
if 'matches' in AHkwargs: del AHkwargs['matches']
item.btdigg = item.season_search = item.texto
item.btdigg = item.season_search = item.texto.replace('%20', ' ').replace('+', ' ')
item.texto = '%s%s' % (BTDIGG_URL_SEARCH, item.texto)
item.matches = self.find_btdigg_list_all(item, matches, finds_controls.get('channel_alt', DOMAIN_ALT), **AHkwargs)
elif item.c_type == 'search' and self.btdigg_search and ('|' in item.texto or '[' in item.texto):
item.season_search = item.texto
item.season_search = item.texto.replace('%20', ' ').replace('+', ' ')
item.texto = item.texto.split('|')[0].strip() if '|' in item.texto else item.texto.split('[')[0].strip()
item.url = item.url.replace(scrapertools.find_single_match(item.url, r'((?:\s|\+|%20)?[\[|\|].*?)(?:\/|\.|$)'), '')
AHkwargs['url'] = item.url
Expand Down Expand Up @@ -1886,6 +1889,7 @@ def list_all(self, item, data='', matches_post=None, postprocess=None, genericto
elif ('|' in item.season_search or '[' in item.season_search) and not '|' in new_item.season_search \
and not '[' in new_item.season_search:
new_item.season_search += scrapertools.find_single_match(item.season_search, r'(\s*[\[|\|][^$]+$)')
new_item.season_search = re.sub(self.SEARCH_CLEAN, '', new_item.season_search)
if not isinstance(new_item.infoLabels['year'], int):
new_item.infoLabels['year'] = str(new_item.infoLabels['year']).replace('-', '')
if new_item.broadcast:
Expand Down Expand Up @@ -2144,6 +2148,7 @@ def seasons(self, item, data='', action="episodesxseason", matches_post=None, po
self.btdigg_search = self.btdigg and finds.get('controls', {}).get('btdigg_search', False) \
and config.get_setting('find_alt_search', item.channel, default=False)
btdigg_contentSeason = 1
if item.season_search: item.season_search = re.sub(self.SEARCH_CLEAN, '', item.season_search)

AHkwargs = {'url': item.url, 'soup': soup, 'finds': finds, 'kwargs': kwargs, 'function': 'seasons'}
AHkwargs['matches_post_list_all'] = kwargs.pop('matches_post_list_all', None)
Expand Down Expand Up @@ -2378,8 +2383,15 @@ def seasons(self, item, data='', action="episodesxseason", matches_post=None, po
for elem in matches:
elem['season'] = int(scrapertools.find_single_match(str(elem.get('season', '1')), r'\d+') or '1')
if item.infoLabels['number_of_seasons'] and elem['season'] > item.infoLabels['number_of_seasons']:
logger.error('TEMPORADA ERRONEA: WEB: %s; TMDB: %s' % (elem['season'], item.infoLabels['number_of_seasons']))
if finds_controls.get('season_TMDB_limit', True) and not BTDIGG_URL_SEARCH in item.url: continue
config.set_setting('tmdb_cache_read', False)
item_temp = item.clone(contentSeason=elem['season'], contentType='season' if item.contentType != 'movie' else 'movie')
tmdb.set_infoLabels_item(item_temp, modo_grafico, idioma_busqueda=idioma_busqueda)
config.set_setting('tmdb_cache_read', True)
if item_temp.infoLabels['number_of_seasons'] and item_temp.infoLabels['number_of_seasons'] > item.infoLabels['number_of_seasons']:
item.infoLabels['number_of_seasons'] = item_temp.infoLabels['number_of_seasons']
if item.infoLabels['number_of_seasons'] and elem['season'] > item.infoLabels['number_of_seasons']:
logger.error('TEMPORADA ERRONEA: WEB: %s; TMDB: %s' % (elem['season'], item.infoLabels['number_of_seasons']))
if finds_controls.get('season_TMDB_limit', True) and not BTDIGG_URL_SEARCH in item.url: continue

elem['url'] = elem.get('url', item.url)
if url_base64: elem['url'] = self.convert_url_base64(elem['url'], self.host, item=item)
Expand Down
Loading

0 comments on commit e2e7d0a

Please sign in to comment.