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:
- Scraping video titles and comments together
from youcos import scrape_youtube
KEY = 'YOUR_YOUTUBE_V3_API_KEY'
scrape_youtube('stocks', KEY)
- 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 callingscrape video
andscrape_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
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for YOUCOS-0.0.1.dev1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 988ff494d155b36a4719235ae025daff213ba27abdff9803364d14d34641b410 |
|
MD5 | e2c8c22d96e6542e06b4e1cda18b7438 |
|
BLAKE2b-256 | 10b0a57015084ab15a9a642d56700730cb6392268c1853361f75d148aed997a8 |