Merge branch 'master' of https://github.com/kodiondemand/addon
This commit is contained in:
@@ -220,7 +220,7 @@ def findvideos(item):
|
||||
|
||||
itemlist = support.server(item, itemlist=itemlist)
|
||||
# Extract the quality format
|
||||
patronvideos = '>([^<]+)</strong></div>'
|
||||
patronvideos = '([\w.]+)</strong></div></td>'
|
||||
support.addQualityTag(item, itemlist, data, patronvideos)
|
||||
|
||||
return itemlist
|
||||
|
||||
@@ -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>[^"<]+)'
|
||||
|
||||
@@ -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="([^"]+)">»'
|
||||
typeContentDict = {'': 'music'}
|
||||
return locals()
|
||||
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -410,7 +410,7 @@ def downloadpage(url, **opt):
|
||||
response['data'] = req.content if req.content else ''
|
||||
if CF:
|
||||
import re
|
||||
response['data'] = re.sub('"/save/[^"]*(https?://[^"]+)', '"\\1', response['data'])
|
||||
response['data'] = re.sub('["|\']/save/[^"]*(https?://[^"]+)', '"\\1', response['data'])
|
||||
response['url'] = req.url
|
||||
|
||||
if type(response['data']) != str:
|
||||
|
||||
@@ -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']:
|
||||
|
||||
@@ -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
|
||||
@@ -958,11 +947,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 ''
|
||||
|
||||
@@ -186,11 +186,15 @@ def render_items(itemlist, parent_item):
|
||||
if item.action == 'play' and thumb_type == 1 and not item.forcethumb:
|
||||
item.thumbnail = "https://github.com/kodiondemand/media/raw/master/resources/servers/" + item.server.lower() + '.png'
|
||||
|
||||
# if cloudflare, cookies are needed to display images taken from site
|
||||
# if cloudflare and cloudscraper is used, cookies are needed to display images taken from site
|
||||
# before checking domain (time consuming), checking if tmdb failed (so, images scraped from website are used)
|
||||
# if item.action in ['findvideos'] and not item.infoLabels['tmdb_id'] and item.channel in httptools.channelsCF:
|
||||
# item.thumbnail = httptools.get_url_headers(item.thumbnail)
|
||||
# item.fanart = httptools.get_url_headers(item.fanart)
|
||||
if item.action in ['findvideos'] and not item.infoLabels['tmdb_id']:
|
||||
# faster but ugly way of checking
|
||||
for d in httptools.FORCE_CLOUDSCRAPER_LIST:
|
||||
if d + '/' in item.url:
|
||||
item.thumbnail = httptools.get_url_headers(item.thumbnail)
|
||||
item.fanart = httptools.get_url_headers(item.fanart)
|
||||
break
|
||||
|
||||
icon_image = "DefaultFolder.png" if item.folder else "DefaultVideo.png"
|
||||
listitem = xbmcgui.ListItem(item.title)
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user