From d2b887b576b157b6ec0001e3712478b3f0c6491e Mon Sep 17 00:00:00 2001 From: Richard Mwewa <74001397+rly0nheart@users.noreply.github.com> Date: Mon, 7 Nov 2022 22:41:08 +0200 Subject: [PATCH] Create main.py --- youtube_comment_scraper/main.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 youtube_comment_scraper/main.py diff --git a/youtube_comment_scraper/main.py b/youtube_comment_scraper/main.py new file mode 100644 index 0000000..683ade4 --- /dev/null +++ b/youtube_comment_scraper/main.py @@ -0,0 +1,20 @@ +import argparse +from youtube_comment_scraper.scraper import YouTubeCommentScraper + + +def create_parser(): + parser = argparse.ArgumentParser('YouTube-Comment-Scraper — by Richard Mwewa', epilog='scrapes youtube comments and checks whether a user commented on the given videos') + parser.add_argument('videos', nargs='+', help='list of youtube video urls') + return parser + + +def main(): + _parser = create_parser() + args = _parser.parse_args() + try: + YouTubeCommentScraper().find_multiple_authors(args.videos) + except KeyboardInterrupt: + print("[x] Process interrupted with Ctrl+C.") + + except Exception as e: + print("[!] An error occurred:", e)