diff --git a/core/support.py b/core/support.py index 18fe0f0e..5916759c 100755 --- a/core/support.py +++ b/core/support.py @@ -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] diff --git a/lib/unshortenit.py b/lib/unshortenit.py index 74ccbf01..deed8473 100644 --- a/lib/unshortenit.py +++ b/lib/unshortenit.py @@ -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): diff --git a/tests/test_generic.py b/tests/test_generic.py index d0a7ed91..6d9691c1 100644 --- a/tests/test_generic.py +++ b/tests/test_generic.py @@ -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]