aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2021-03-12 05:32:21 +0000
committerterminaldweller <thabogre@gmail.com>2021-03-12 05:32:21 +0000
commita2dfce31ad4da975e1062797dba2bbd61e56a80a (patch)
tree76578456e4b4b325439ef364958c5449b5667a67
parentprinting with defualt end added and extra option (diff)
downloadkaminokumo-a2dfce31ad4da975e1062797dba2bbd61e56a80a.tar.gz
kaminokumo-a2dfce31ad4da975e1062797dba2bbd61e56a80a.zip
fixed a bug where if you symlnked kaminokumo, it wouldnt work properly
Diffstat (limited to '')
-rwxr-xr-xkaminokumo9
1 files changed, 8 insertions, 1 deletions
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():