Skip to main content

YOUCOS is a simple Python package for scraping YouTube videos and comments

Project description

youcos

youcos (youtube comment scraper) is a simple Python package for scraping YouTube comments!

:page_facing_up: save the following data into a csv file: each row corresponds to a comment

  • Url
  • Title
  • Channel name
  • No. of views
  • Date Uploaded
  • No. of likes
  • No. of dislikes
  • Comment Text
  • Comment Author
  • Comment Date
  • No. of replies to comment
  • No. of upvotes for comments

Demo

There are two main ways to scrape comments:

  1. Scraping video titles and comments together
from youcos import scrape_youtube

KEY = 'YOUR_YOUTUBE_V3_API_KEY'

scrape_youtube('stocks', KEY)
  1. Scraping video titles and comments separately If you call youcos often on the same query, you may wish to avoid duplicating data by re-scraping comments. By calling scrape video and scrape_comments separately, you can filter and choose the particular videos to scrape comments from!
from youcos import scrape_videos, scrape_comments

KEY = 'YOUR_YOUTUBE_V3_API_KEY'

videos = scrape_videos("stocks", KEY)

filtered_videos = foo(videos)

scrape_comments(filtered_videos)

def foo(videos):
    # function to filter videos

Installation

Install with pip: pip install youcos

Dependencies

Documentation

Check ___ for specific API documentation. This project was documented following the numpy docstring conventions, which are supported by common documentation tools like Sphynx while also maintaining readability.

To Do

Functionalities

  • search based on different filters
  • selenium dependency support for all drivers
  • choose to filter comments based on relevancy & top comments
  • headless browser scraping (option)
  • maximum number of videos to scrape
  • maximum number of comments to scrape
  • method to skip video authentication

Deployment

  • use Sphynx to build documentation

Credits

  • Author: Seunggun Leez`
  • Languages/Tools: Python3, Selenium

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

YOUCOS-0.0.1.dev1.tar.gz (5.7 kB view hashes)

Uploaded Source

Built Distribution

YOUCOS-0.0.1.dev1-py3-none-any.whl (7.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page