Merge branch 'fix/dead_ad_string' into 'integration'

Fix/dead ad string

See merge request pablomartincalvo/Drogon!2
This commit is contained in:
Pablo Martin 2021-01-04 21:29:52 +00:00
commit 3740ab2ada

View file

@ -1,16 +1,18 @@
import sys
sys.path.append("..")
import logging
from time import sleep
from core.config import refresher_delay
from db_layer.capturas_interface import capturas_interface
from db_layer.capturing_tasks_interface import capturing_interface
from core.config import refresher_delay
from core import my_logger
import logging
class Refresher:
def start(self):
@staticmethod
def start() -> None:
"""
Execute main flow.
:return: None
"""
while True:
sleep(refresher_delay)
@ -28,12 +30,9 @@ class Refresher:
:param html: HTML del anuncio en string.
:return: True si esta dado de baja, False si no.
"""
try:
if ":-|" in html or "El anunciante lo dio de baja" in html:
return True
else:
return False
except TypeError:
if "anunciante" in html and "baja" in html:
return True
else:
return False