Skip to content

🚀 A simple Python package for scraping YouTube videos and comments!

License

Notifications You must be signed in to change notification settings

seungguini/youcos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CURRENTLY REQUIRES HEAVY REWORK

GitHub PyPI

youcos

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

🍀 Lightweight YouTube v3 API Wrapper - Simply provide your YouTube v3 API Key, and youcos will take care of the rest! No additional code needed to configure API and process fetched JSON data.

🌏 Diverse Language Support - Search, scrape, and save videos & comments in different languges with youcos.

🚀 Fast Performance - Request and write approximately 4,000 comments, just within 1 minute.

📈 Minimized Quota Usage - Scrape comments without exhausting YouTube v3 quota through the built-in Selenium module with youcos!

Table of Contents

Demo

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

KEY = 'YOUR_YOUTUBE_V3_API_KEY'

# Call YouTube v3 API to request the first 30 videos search results for 'stocks'
# and scrape each video's top __ comments
scrape_youtube('stocks', KEY)
  1. Scraping video titles and comments separately
from youcos import scrape_videos, scrape_comments

KEY = 'YOUR_YOUTUBE_V3_API_KEY'

# Call YouTube v3 API to request the first 30 videos search results for 'stocks'
videos = scrape_videos("stocks", KEY)

# Filter videos to avoid re-scraping comments
filtered_videos = foo(videos)

# Scrape comments for filtered videos
scrape_comments(filtered_videos)

def foo(videos):
    # function to filter videos

Installation

pip install youcos

Features

  • Collected Data
Video Data Comment Data
URL text
title author
channel name date
upload date no. of replies
no. of likes no. of upvotes
no. of dislikes # of comments

Dependencies

pip install --upgrade selenium google-api-python-client

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.

Contributing

Package author and maintainer is Seunggun Lee ([email protected]). Contributions and feedback are more than welcome.

Credits

  • Author: Seunggun Lee
  • Languages/Tools: Python3, Selenium

About

🚀 A simple Python package for scraping YouTube videos and comments!

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages