diff --git a/scrapthechan/cli/scraper.py b/scrapthechan/cli/scraper.py index c52f900..3b84ab0 100644 --- a/scrapthechan/cli/scraper.py +++ b/scrapthechan/cli/scraper.py @@ -9,7 +9,8 @@ from scrapthechan import VERSION from scrapthechan.parser import Parser, ParserThreadNotFoundError from scrapthechan.parsers import get_parser_by_url, get_parser_by_site, \ SUPPORTED_IMAGEBOARDS -from scrapthechan.scrapers.basicscraper import BasicScraper +#from scrapthechan.scrapers.basicscraper import BasicScraper +from scrapthechan.scrapers.threadedscraper import ThreadedScraper __all__ = ["main"] @@ -105,7 +106,9 @@ def main() -> None: if not args["no-op"]: print("Writing OP... ", end='') - if not exists(join(save_dir, "!op.txt")): + if parser.op is None: + print("No text's there.") + elif not exists(join(save_dir, "!op.txt")): with open(join(save_dir, "!op.txt"), 'w') as opf: opf.write(f"{parser.op}\n") print("Done.") @@ -113,7 +116,7 @@ def main() -> None: print("Exists.") - scraper = BasicScraper(save_dir, parser.files, \ + scraper = ThreadedScraper(save_dir, parser.files, \ lambda i: print(f"{i}/{flen}", end="\r")) scraper.run()