From ee00869a5dbb3f5d0768eb2ade697ce762412963 Mon Sep 17 00:00:00 2001 From: Richard Mwewa <74001397+rly0nheart@users.noreply.github.com> Date: Fri, 30 Sep 2022 22:43:10 +0200 Subject: [PATCH] Updated scraper.py, Updated README.md, Added requirements.txt --- README.md | 47 ++++++++++++++++++++++++++++++++++++++++++++++- requirements.txt | 1 + scraper.py | 7 +------ 3 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 requirements.txt diff --git a/README.md b/README.md index b350b78..c871d5c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,47 @@ # YouTube-Comment-Scraper -A script to scrape youtube comments and checks whether a user commented on two or all of the given videos +A script to scrape youtube comments and checks whether a user commented on the given videos + +# Installation +**1. Clone the project** +``` +git clone https://github.com/rly0nheart/YouTube-Comment-Scraper.git +``` + +**2. Move to YouTube-Comment-Scraper directory** +``` +cd YouTube-Comment-Scraper +``` + +**3. Install dependencies** +## Note +``` +pip install -r requirements.txt +``` + +# Usage +``` +python scraper.py +``` + +> *Alternatively, you could grant execution permission to the downloader and run it as shown below* + +**1. Grant execution permission** +``` +chmod +x scraper.py +``` + +**2. Run scraper.py** +``` +./scraper.py +``` + +## Note +> Upon run, the scraper will first check for updates. If found, users will be prompted to download the updates + +# Donations +If you would like to donate, you could Buy A Coffee for the developer using the button below + +Buy Me A Coffee + +Your support will be much appreciated! + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..21c2162 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +youtube-comment-downloader \ No newline at end of file diff --git a/scraper.py b/scraper.py index c3c475d..b6c8602 100644 --- a/scraper.py +++ b/scraper.py @@ -53,12 +53,7 @@ def find_multiple_authors(video_urls): if __name__ == '__main__': parser = argparse.ArgumentParser(prog='scraper.py') - parser.add_argument('videos', choices=['youtube_video_url_1', 'youtube_video_url_2', 'youtube_video_url_3']) + parser.add_argument('videos', nargs='+', help='List of YouTube video urls') args = parser.parse_args() - vids = [ - 'https://www.youtube.com/watch?v=C1Gn85NKrCU', - 'https://www.youtube.com/watch?v=UMzKD73cs3c', - 'https://www.youtube.com/watch?v=e7VOQ1l20eo' - ] find_multiple_authors(args.videos)