diff options
author | terminaldweller <thabogre@gmail.com> | 2021-03-12 05:32:21 +0000 |
---|---|---|
committer | terminaldweller <thabogre@gmail.com> | 2021-03-12 05:32:21 +0000 |
commit | a2dfce31ad4da975e1062797dba2bbd61e56a80a (patch) | |
tree | 76578456e4b4b325439ef364958c5449b5667a67 | |
parent | printing with defualt end added and extra option (diff) | |
download | kaminokumo-a2dfce31ad4da975e1062797dba2bbd61e56a80a.tar.gz kaminokumo-a2dfce31ad4da975e1062797dba2bbd61e56a80a.zip |
fixed a bug where if you symlnked kaminokumo, it wouldnt work properly
Diffstat (limited to '')
-rwxr-xr-x | kaminokumo | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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(): |