From a2dfce31ad4da975e1062797dba2bbd61e56a80a Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Fri, 12 Mar 2021 09:02:21 +0330 Subject: fixed a bug where if you symlnked kaminokumo, it wouldnt work properly --- kaminokumo | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/kaminokumo b/kaminokumo index 9328720..2832098 100755 --- a/kaminokumo +++ b/kaminokumo @@ -13,6 +13,7 @@ from time import sleep from bs4 import BeautifulSoup import subprocess import re +from pathlib import Path def SigHandler_SIGINT(signum, frame): @@ -71,7 +72,13 @@ def run_cb_scrape(): def manga_scrape(): - urls = json.load(open("/home/bloodstalker/extra/kaminokumo/manga.json")) + path = str() + if Path(sys.argv[0]).is_symlink(): + path = os.readlink(sys.argv[0]) + else: + path = sys.argv[0] + + urls = json.load(open(os.path.dirname(path)+"/manga.json")) requests.packages.urllib3.disable_warnings() result = str() for name, url in urls.items(): -- cgit v1.2.3