From 7b5af420826a9744bb3ff0ec3031ffbbefdacc63 Mon Sep 17 00:00:00 2001 From: tema Date: Mon, 14 Nov 2022 17:53:04 +0200 Subject: [PATCH 1/3] Fix --- parser/utils.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/parser/utils.py b/parser/utils.py index 6733995..4c829dd 100644 --- a/parser/utils.py +++ b/parser/utils.py @@ -1,4 +1,5 @@ from bs4 import BeautifulSoup +from typing import Any def table_parser(soup: BeautifulSoup, output): #Date parser @@ -24,8 +25,10 @@ def table_parser(soup: BeautifulSoup, output): def image_parser(soup: BeautifulSoup): + image: Any + extension = ('png', 'jpg') main = soup.find("main") - image = main.select('img[src$=".png"]') - output = image[0]['src'] - - return output + for ext in extension: + image = main.select(f'img[src$=".{ext}"]') + if image: + return image[0]['src'] -- 2.45.2 From fe26afd2fcbbf4a6522b2e1e82fc5ffcb8cd23f8 Mon Sep 17 00:00:00 2001 From: tema Date: Mon, 14 Nov 2022 17:56:38 +0200 Subject: [PATCH 2/3] Volume use --- start.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/start.sh b/start.sh index dabf310..d6fc97a 100644 --- a/start.sh +++ b/start.sh @@ -1,6 +1,5 @@ docker build -t replace-bot . -docker run --net=br0 \ +docker run --net=host \ --name=replacebot \ ---mount type=bind,source="$(pwd)",target=/app $@ \ ---ip=10.0.0.3 --restart=unless-stopped \ +-v "$(pwd)":/app $@ \ replace-bot -- 2.45.2 From 507877096f86b715fdafa8f32ff9250288c88839 Mon Sep 17 00:00:00 2001 From: tema Date: Mon, 14 Nov 2022 18:00:56 +0200 Subject: [PATCH 3/3] New configuration --- start.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/start.sh b/start.sh index d6fc97a..f0d9216 100644 --- a/start.sh +++ b/start.sh @@ -1,5 +1,6 @@ docker build -t replace-bot . -docker run --net=host \ +docker run --net=br0 \ --name=replacebot \ -v "$(pwd)":/app $@ \ +--ip=10.0.0.3 --restart=unless-stopped \ replace-bot -- 2.45.2