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
- 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)
- 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 (seungguini@gmail.com). Contributions and feedback are more than welcome.
Credits
- Author: Seunggun Lee
- Languages/Tools: Python3, Selenium
Metadata
Release files for youcos 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| youcos-0.0.6.tar.gz | 9.5 kB | Without provenance | Details for youcos-0.0.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| youcos-0.0.6-py3-none-any.whl | Python 3 | none | any | Details for youcos-0.0.6-py3-none-any.whl |
Total release size: 18.3 kB
Release files / youcos-0.0.6.tar.gz
| Download URL | youcos-0.0.6.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
38fedb01a1572174c4d8c87b8524115f59b7f86cb4682ca40d05bd4207f35552
|
|
BLAKE2b-256 checksum How to use checksums |
3e6a760d5e5f84d4a21bddb0053e13ac3500838018f67cb0245b96fb589e06b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.1
|
Release files / youcos-0.0.6-py3-none-any.whl
| Download URL | youcos-0.0.6-py3-none-any.whl |
|---|---|
| Size | 8.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a83b397745d7d37042ea58e868c885bc2bbfe9ea080bf2a85c91cdca37ecab06
|
|
BLAKE2b-256 checksum How to use checksums |
8c6d64a80c6a5744f46f6ba4b2ef01c34e144be55a917069d807dcaaf4906e83
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.1
|
Security for youcos 0.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.