aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2021-10-29 08:44:27 +0000
committerterminaldweller <thabogre@gmail.com>2021-10-29 08:44:27 +0000
commit3ba9d5cfb25ad4f77d018f448b623475bc84008e (patch)
tree902095cbf12b11973b282ff42b007a8a2f28ee97
parenta little fix (diff)
downloadkaminokumo-3ba9d5cfb25ad4f77d018f448b623475bc84008e.tar.gz
kaminokumo-3ba9d5cfb25ad4f77d018f448b623475bc84008e.zip
black
-rwxr-xr-xkaminokumo51
1 files changed, 33 insertions, 18 deletions
diff --git a/kaminokumo b/kaminokumo
index e8cbfce..9feb77a 100755
--- a/kaminokumo
+++ b/kaminokumo
@@ -22,20 +22,33 @@ class Argparser(object):
def __init__(self):
parser = argparse.ArgumentParser()
parser.add_argument("--url", type=str, nargs="+", help="url to scrape")
- parser.add_argument("--name", type=str, nargs="+",
- help="url to scrape")
- parser.add_argument("--dbg", action="store_true",
- help="debug", default=False)
- parser.add_argument("--demon", action="store_true",
- help="run as daemon", default=False)
- parser.add_argument("--manga", action="store_true",
- help="run manga scraper", default=False)
- parser.add_argument("--anime", action="store_true",
- help="run anime scraper", default=False)
- parser.add_argument("--cb", action="store_true",
- help="run cb scraper", default=False)
- parser.add_argument("--slumber", type=int,
- help="how long the demon sleeps", default=60)
+ parser.add_argument(
+ "--name", type=str, nargs="+", help="url to scrape"
+ )
+ parser.add_argument(
+ "--dbg", action="store_true", help="debug", default=False
+ )
+ parser.add_argument(
+ "--demon", action="store_true", help="run as daemon", default=False
+ )
+ parser.add_argument(
+ "--manga",
+ action="store_true",
+ help="run manga scraper",
+ default=False,
+ )
+ parser.add_argument(
+ "--anime",
+ action="store_true",
+ help="run anime scraper",
+ default=False,
+ )
+ parser.add_argument(
+ "--cb", action="store_true", help="run cb scraper", default=False
+ )
+ parser.add_argument(
+ "--slumber", type=int, help="how long the demon sleeps", default=60
+ )
self.args = parser.parse_args()
@@ -77,7 +90,7 @@ def manga_scrape():
else:
path = sys.argv[0]
- urls = json.load(open(os.path.dirname(path)+"/manga.json"))
+ urls = json.load(open(os.path.dirname(path) + "/manga.json"))
requests.packages.urllib3.disable_warnings()
result = str()
for name, url in urls.items():
@@ -102,7 +115,7 @@ def anime_scrape():
else:
path = sys.argv[0]
- urls = json.load(open(os.path.dirname(path)+"/anime.json"))
+ urls = json.load(open(os.path.dirname(path) + "/anime.json"))
requests.packages.urllib3.disable_warnings()
result = str()
for name, url in urls.items():
@@ -113,12 +126,14 @@ def anime_scrape():
for thing in search:
re_res.append(re.findall("Episode [0-9]*$", thing.text))
# print(name+":"+repr(max(re_res)))
- result += name+":"+repr(max(re_res)) + "\n"
+ result += name + ":" + repr(max(re_res)) + "\n"
print(result, end="")
def vocalize(sound):
- subprocess.call([os.path.expanduser("~")+"/scripts/voice.sh", sound])
+ subprocess.call([os.path.expanduser("~") + "/scripts/voice.sh", sound])
+
+
###############################################################################