aggiunto contentType "music" e altri piccoli aggiustamenti

This commit is contained in:
marco
2020-05-06 19:45:48 +02:00
parent affdc20a65
commit ca3f7e76fc
6 changed files with 17 additions and 21 deletions

View File

@@ -36,9 +36,10 @@ def mainlist(item):
('Cerca Musica.. submenu', ['/torrent-ita/2/', 'search', ['search', 'music', False]]),
('Audiolibri {musica}', ['/categoria.php?active=0&category=18&order=data&by=DESC&page=', 'peliculas', [0, 'music', False]]),
('Cerca Audiolibri.. submenu', ['/torrent-ita/18/', 'search', ['search', 'music', False]]),
('Altro {film}', ['/categoria.php?active=0&category=4&order=data&by=DESC&page=', 'peliculas', [0, 'movie', False]]),
('Cerca altro.. submenu', ['/torrent-ita/4/', 'search', ['search', 'movie', False]]),
('Cerca Tutto... color kod bold', ['/argh.php?search=', 'search', ['search', 'all', False]])
# mostrerebbe anche risultati non "multimediali" e allungherebbero inutilmente la ricerca globale
# ('Altro {film}', ['/categoria.php?active=0&category=4&order=data&by=DESC&page=', 'peliculas', [0, 'other', False]]),
# ('Cerca altro.. submenu', ['/torrent-ita/4/', 'search', ['search', 'other', False]]),
# ('Cerca Tutto... color kod bold', ['/argh.php?search=', 'search', ['search', 'all', False]])
]
return locals()
@@ -47,7 +48,7 @@ def mainlist(item):
@support.scrape
def peliculas(item):
sceneTitle = item.args[2]
if item.args[1] in ['tvshow', 'anime', 'music']:
if item.args[1] in ['tvshow', 'anime', 'music', 'other']:
patron = r'>[^"<]+'
else:
patron = r'>(?P<quality>[^"<]+)'

View File

@@ -25,6 +25,7 @@ def mainlist(item):
patron = r'<a href="(?P<url>[^"]+)"(?: class="")?>(?P<title>[^<]+)<'
def itemHook(item):
item.thumbnail = support.thumb(thumb='music.png')
item.contentType = 'music'
return item
def itemlistHook(itemlist):
itemlist.pop(0)
@@ -32,7 +33,8 @@ def mainlist(item):
support.Item(
channel=item.channel,
title=support.typo('Cerca...', 'bold color kod'),
url = item.url,
contentType='music',
url=item.url,
action='search',
thumbnail=support.thumb(thumb='search.png')))
return itemlist
@@ -43,6 +45,7 @@ def peliculas(item):
action = 'findvideos'
patron= r'<img src="[^"]+" alt="(?P<title>[^"]+)" data-echo="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+><a href="(?P<url>[^"]+)"'
patronNext = r'<a href="([^"]+)">&raquo'
typeContentDict = {'': 'music'}
return locals()

View File

@@ -21,6 +21,7 @@ def mainlist(item):
patron = r'text="(?P<title>[^"]+)" URL="(?P<url>[^"]+)"'
def itemHook(item):
item.thumbnail = support.thumb(thumb='music.png')
item.contentType = 'music'
return item
def itemlistHook(itemlist):
itemlist.append(

View File

@@ -41,7 +41,7 @@ class InfoLabels(dict):
# super(InfoLabels, self).__setitem__('code', value)
super(InfoLabels, self).__setitem__('imdb_id', str(value))
elif name == "mediatype" and value not in ["list", "movie", "tvshow", "season", "episode"]:
elif name == "mediatype" and value not in ["list", "movie", "tvshow", "season", "episode", "music"]:
super(InfoLabels, self).__setitem__('mediatype', 'list')
elif name in ['tmdb_id', 'tvdb_id', 'noscrap_id']:

View File

@@ -140,17 +140,6 @@ def regexDbg(item, patron, headers, data=''):
webbrowser.open(url + "/r/" + permaLink)
def scrape2(item, patron = '', listGroups = [], headers="", blacklist="", data="", patronBlock="",
patronNext="", action="findvideos", addVideolibrary = True, typeContentDict={}, typeActionDict={}):
m = re.search(r'(?<!\\|\[)\((?!\?)', patron)
n = 0
while m:
patron = patron[:m.end()] + '?P<' + listGroups[n] + '>' + patron[m.end():]
m = re.search(r'(?<!\\|\[)\((?!\?)', patron)
n += 1
regexDbg(item, patron, headers)
def scrapeLang(scraped, lang, longtitle):
## Aggiunto/modificato per gestire i siti che hanno i video
## in ita e subita delle serie tv nella stessa pagina
@@ -485,7 +474,7 @@ def scrape(func):
page=pag + 1,
thumbnail=thumb()))
if action != 'play' and function != 'episodios' and 'patronMenu' not in args:
if action != 'play' and function != 'episodios' and 'patronMenu' not in args and item.contentType in ['movie', 'tvshow', 'episode']:
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
from specials import autorenumber
@@ -959,11 +948,13 @@ def download(itemlist, item, typography='', function_level=1, function=''):
elif item.contentType == 'episode':
from_action = 'findvideos'
title = typo(config.get_localized_string(60356), typography) + ' - ' + item.title
else:
elif item.contentType == 'tvshow':
from_action = 'episodios'
title = typo(config.get_localized_string(60355), typography)
else: # content type does not support download
return itemlist
function = function if function else inspect.stack()[function_level][3]
# function = function if function else inspect.stack()[function_level][3]
contentSerieName=item.contentSerieName if item.contentSerieName else ''
contentTitle=item.contentTitle if item.contentTitle else ''

View File

@@ -386,7 +386,7 @@ def move_to_libray(item):
filetools.remove(library_path)
if filetools.isfile(download_path):
if filetools.move(download_path, library_path):
if filetools.move(download_path, library_path, silent=True):
final_path = library_path
if len(filetools.listdir(filetools.dirname(download_path))) == 0: