From 8be7011f3f8469b7e3dd73278d2ca7556116f2d0 Mon Sep 17 00:00:00 2001 From: Bryan Chiang Date: Wed, 21 Jul 2021 19:48:59 -0700 Subject: [PATCH] Fixed parsing --- loconotion/__main__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/loconotion/__main__.py b/loconotion/__main__.py index 87446ab..306adde 100644 --- a/loconotion/__main__.py +++ b/loconotion/__main__.py @@ -1,3 +1,4 @@ +from notionparser import Parser import os import sys import logging @@ -11,11 +12,10 @@ try: import requests import toml except ModuleNotFoundError as error: - log.critical(f"ModuleNotFoundError: {error}. have your installed the requirements?") + log.critical( + f"ModuleNotFoundError: {error}. have your installed the requirements?") sys.exit() -from notionparser import Parser - def main(): # set up argument parser @@ -78,7 +78,8 @@ def main(): log.addHandler(log_screen_handler) log.propagate = False try: - import colorama, copy + import colorama + import copy LOG_COLORS = { logging.DEBUG: colorama.Fore.GREEN, @@ -117,7 +118,7 @@ def main(): if urllib.parse.urlparse(args.target).scheme: try: response = requests.get(args.target) - if "notion.so" in args.target: + if "notion.so" in args.target or "notion.site" in args.target: log.info("Initialising parser with simple page url") config = {"page": args.target} Parser(config=config, args=vars(args))