Skip to main content

youcos is a simple Python package for collecting YouTube videos and comments

Project description

GitHub PyPI

youcos

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

:four_leaf_clover: 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.

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

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

:chart_with_upwards_trend: 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| - |

Dependencies

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

## Documentation
Check ___ for specific API documentation. This project was documented following the [numpy docstring conventions](https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt),
which are supported by common documentation tools like [Sphynx](https://www.sphinx-doc.org/) while also maintaining readability.

## Contributing
Package author and maintainer is Seunggun Lee ([seungguini@gmail.com](mailto:seungguini@gmail.com)).
Contributions and feedback are more than welcome.

## Credits
- Author: Seunggun Lee
- Languages/Tools: Python3, [Selenium](https://www.selenium.dev/)

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.3.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

youcos-0.0.3-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file youcos-0.0.3.tar.gz.

File metadata

  • Download URL: youcos-0.0.3.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.12

File hashes

Hashes for youcos-0.0.3.tar.gz
Algorithm Hash digest
SHA256 4f3a6b6c5a46d4b22b4349fa445f109bea03ff3fcebbe0549ce270700da8b73c
MD5 a7b00c644efc9a59e2a0c9abeea1f20c
BLAKE2b-256 e239220d3eb1a8d45bcdf4ff7db5822e79a31aa93ea22491a36d2e776c6d6c8e

See more details on using hashes here.

File details

Details for the file youcos-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: youcos-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.12

File hashes

Hashes for youcos-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2707a68294ac3146881f85482c56a1d5ca7ec9a66cb350fd055dc15d38dcbe86
MD5 ad55643c4fc6b26d21a94a671e96f615
BLAKE2b-256 bd6fe14c55b36f3fd5b5c8b280fcda2c3b8a2cafce8e0dcbfacab29116c85fdd

See more details on using hashes here.

Supported by

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