From 3ba9d5cfb25ad4f77d018f448b623475bc84008e Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Fri, 29 Oct 2021 12:14:27 +0330 Subject: black --- kaminokumo | 51 +++++++++++++++++++++++++++++++++------------------ 1 file 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]) + + ############################################################################### -- cgit v1.2.3