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