From 12690dfbb9eb660fecfc44c5f8c9c3677fef0d81 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Sat, 1 May 2021 14:55:45 +0200 Subject: [PATCH] Fix ilgenio (link in re-upload), cb01 caso speciale serie e soppressione errori nei canali in videoteca --- channels/cineblog01.py | 6 +++--- channels/ilgeniodellostreaming.py | 5 +++-- specials/videolibrary.py | 13 ++++++++----- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/channels/cineblog01.py b/channels/cineblog01.py index 41524176..8ec3df0c 100644 --- a/channels/cineblog01.py +++ b/channels/cineblog01.py @@ -135,9 +135,9 @@ def episodios(item): addVideolibrary = False downloadEnabled = False - folderUrl = scrapertools.find_single_match(data, r'TUTTA LA \w+\s+(?:–|-)\s+]+>(?P[^<]+)' sceneTitle = True @@ -148,7 +148,7 @@ def episodios(item): # debug=True data = support.match(item.url, headers=headers).data - folderItemlist = folder(item, data) if 'TUTTA LA ' in data else [] + folderItemlist = folder(item, data) if '<p>TUTTA L' in data else [] patronBlock = r'(?P<block>sp-head[^>]+>\s*(?:STAGION[EI]\s*(?:DA\s*[0-9]+\s*A)?\s*[0-9]+|MINISERIE) - (?P<lang>[^-<]+)(?:- (?P<quality>[^-<]+))?.*?<\/div>.*?)spdiv[^>]*>' patron = r'(?:/>|<p>|<strong>)(?P<other>.*?(?P<episode>[0-9]+(?:×|×)[0-9]+)\s*(?P<title2>.*?)?(?:\s*–|\s*-|\s*<).*?)(?:<\/p>|<br)' diff --git a/channels/ilgeniodellostreaming.py b/channels/ilgeniodellostreaming.py index d52b012f..b53e3a62 100644 --- a/channels/ilgeniodellostreaming.py +++ b/channels/ilgeniodellostreaming.py @@ -183,8 +183,9 @@ def findvideos(item): for link in encLinks: linkDec = base64.b64decode(link.encode()).decode() if 'player.php' in linkDec: - linkDec = support.httptools.downloadpage(linkDec, only_headers=True, follow_redirects=False).headers['Location'] - list_url.append(linkDec) + linkDec = support.httptools.downloadpage(linkDec, only_headers=True, follow_redirects=False).headers.get('Location') + if linkDec: + list_url.append(linkDec) if list_servers: for i, url in enumerate(list_url): itemlist.append(support.Item( diff --git a/specials/videolibrary.py b/specials/videolibrary.py index d78d92d9..f3d20e28 100644 --- a/specials/videolibrary.py +++ b/specials/videolibrary.py @@ -515,15 +515,18 @@ def findvideos(item): from core import servertools ch_results.append(executor.submit(servertools.find_video_items, item_json)) - except Exception as ex: + except: + import traceback logger.error("The findvideos function for the channel %s failed" % nom_canal) - template = "An exception of type %s occured. Arguments:\n%r" - message = template % (type(ex).__name__, ex.args) - logger.error(message) logger.error(traceback.format_exc()) for ris in futures.as_completed(ch_results): - list_servers.extend(ris.result()) + try: + list_servers.extend(ris.result()) + except: + import traceback + logger.error("The findvideos function for a channel failed") + logger.error(traceback.format_exc()) # Change the title to the servers adding the name of the channel in front and the infoLabels and the images of the item if the server does not have