From 94f5b130122f0c40b008bf9e2498858b5eb7ac70 Mon Sep 17 00:00:00 2001 From: marco <10120390+mac12m99@users.noreply.github.com> Date: Thu, 26 Nov 2020 15:08:40 +0100 Subject: [PATCH] =?UTF-8?q?wstream:=20migliorato=20controllo=20validit?= =?UTF-8?q?=C3=A0=20link?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- servers/wstream.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/servers/wstream.py b/servers/wstream.py index c0eb6098..70822630 100644 --- a/servers/wstream.py +++ b/servers/wstream.py @@ -12,6 +12,9 @@ from core import httptools, scrapertools from platformcode import logger, config, platformtools # real_host = 'wstream.video' +errorsStr = ['Sorry this file is not longer available', 'Sorry this video is unavailable', 'Video is processing' + 'File was deleted', 'Not Found'] + def test_video_exists(page_url): global headers @@ -50,10 +53,10 @@ def test_video_exists(page_url): data = new_data real_url = page_url - if "Not Found" in data or "File was deleted" in data or 'Video is processing' in data or 'Sorry this video is unavailable' in data: - return False, config.get_localized_string(70449) % 'Wstream' - else: - return True, "" + for e in errorsStr: + if e in data: + return False, config.get_localized_string(70449) % 'Wstream' + return True, "" # Returns an array of possible video url's from the page_url