Migliorie test suite
This commit is contained in:
@@ -1267,6 +1267,8 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru
|
||||
findS = servertools.get_server_from_url(videoitem.url)
|
||||
if not findS:
|
||||
info(videoitem, 'Non supportato')
|
||||
if logger.testMode:
|
||||
raise Exception('Server missing: ' + videoitem.url)
|
||||
return
|
||||
videoitem.server = findS[2]
|
||||
videoitem.title = findS[0]
|
||||
|
||||
@@ -60,6 +60,7 @@ class UnshortenIt(object):
|
||||
|
||||
def unshorten(self, uri, type=None):
|
||||
code = 0
|
||||
originalUri = uri
|
||||
while True:
|
||||
uri = uri.strip()
|
||||
oldUri = uri
|
||||
@@ -114,6 +115,8 @@ class UnshortenIt(object):
|
||||
|
||||
logger.info(uri)
|
||||
|
||||
if originalUri == uri and logger.testMode:
|
||||
raise Exception('Not un-shortened link: ' + uri)
|
||||
return uri, code
|
||||
|
||||
def unwrap_30x(self, uri, timeout=10):
|
||||
|
||||
@@ -182,19 +182,19 @@ for chItem in channel_list:
|
||||
# no title to search
|
||||
if not firstContent:
|
||||
continue
|
||||
itemlist = module.search(it, firstContent.fulltitle)
|
||||
itemlist = module.search(it, firstContent)
|
||||
else:
|
||||
itemlist = getattr(module, it.action)(it)
|
||||
|
||||
if itemlist and itemlist[0].action in ('findvideos', 'episodios'):
|
||||
firstContent = itemlist[0]
|
||||
firstContent = re.match('[ \w]*', itemlist[0].fulltitle).group(0)
|
||||
|
||||
# some sites might have no link inside, but if all results are without servers, there's something wrong
|
||||
for resIt in itemlist:
|
||||
if resIt.action == 'findvideos' or resIt.action == 'episodios':
|
||||
if hasattr(module, resIt.action):
|
||||
serversFound[it.title] = getattr(module, resIt.action)(resIt)
|
||||
if resIt.action == 'episodios':
|
||||
if serversFound[it.title] and resIt.action == 'episodios':
|
||||
getattr(module, serversFound[it.title][0].action)(serversFound[it.title][0])
|
||||
else:
|
||||
serversFound[it.title] = [resIt]
|
||||
|
||||
Reference in New Issue
Block a user