mirror of
https://github.com/bellingcat/youtube-comment-scraper.git
synced 2026-06-08 03:28:32 +03:00
Create main.py
This commit is contained in:
20
youtube_comment_scraper/main.py
Normal file
20
youtube_comment_scraper/main.py
Normal file
@@ -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)
|
||||
Reference in New Issue
Block a user