Detección de videos

Añadidos un par de ifs en test_video_exists para detectar videos inexistentes.
This commit is contained in:
pipcat
2018-04-01 11:40:42 +02:00
committed by GitHub
parent ca4941da7e
commit 78986bc14d

View File

@@ -10,6 +10,10 @@ def test_video_exists(page_url):
data = scrapertools.cache_page(url=page_url)
if "<h1>404 Not Found</h1>" in data:
return False, "El archivo no existe<br/>en streamcloud o ha sido borrado."
elif "<h1>File Not Found</h1>" in data:
return False, "El archivo no existe<br/>en streamcloud o ha sido borrado."
elif "<h1>Archivo no encontrado</h1>" in data:
return False, "El archivo no existe<br/>en streamcloud o ha sido borrado."
else:
return True, ""