Skip to main content

Scrape videos from YouTube channels.

Project description

YouTube Channel Scraper

Scrapes videos from a YouTube channel using Python.

It takes a YouTube channel URL as an input and produces a list of videos as an output.

Video attributes:

  • url
  • title
  • description
  • author
  • published_at
  • thumbnail

Requirements

Install

pip install youtube-channel-scraper

Usage

from youtube_channel_scraper.scraper import YoutubeScraper

scraper = YoutubeScraper(channel_url)
crawled_videos = scraper.scrape()

Optional parameters

  • stop_id: stop scraping when this video ID is encountered. Older videos are always scraped first.
  • max_videos: maximum amount of videos to scrape
  • proxy_ip: proxy IP with port

CLI usage

youtube-channel-scraper "https://www.youtube.com/channel/CHANNEL_ID"

Available arguments

positional arguments:
  channel_url           Youtube channel URL

optional arguments:
  -h, --help            show this help message and exit
  --filename FILENAME   Output file
  --stop_video_id STOP_VIDEO_ID
                        Youtube video ID that indicates to stop crawling
  --max_videos MAX_VIDEOS
                        Max videos to crawl
  --proxy PROXY         Proxy IP
  --screenshot_filename SCREENSHOT_FILENAME
                        Path to exceptions screenshot

Usage with Docker

Why?

When running youtube-channel-scraper in a Docker container there is no need to manually install chrome driver in your environment.

How?

git clone https://github.com/hajkr/youtube-channel-scraper.git
cd youtube_channel_scraper

# Builds the container when running for the first time
make run

# Enter the container
make to_container

python youtube_channel_scraper "https://www.youtube.com/channel/CHANNEL_ID"

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

youtube-channel-scraper-0.1.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

youtube_channel_scraper-0.1.1-py2.py3-none-any.whl (5.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file youtube-channel-scraper-0.1.1.tar.gz.

File metadata

  • Download URL: youtube-channel-scraper-0.1.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.9.5 Linux/5.10.25-linuxkit

File hashes

Hashes for youtube-channel-scraper-0.1.1.tar.gz
Algorithm Hash digest
SHA256 549e7c8b6ccce2c80e7e7f60ea88b5f8facb3e2549982413ced566fc480bc72a
MD5 83d07ce91338ef3f0295c6659e6ee400
BLAKE2b-256 7453d92e3e9d614fec6dfe6ee7569643584362fa7ad504e676089cee48d52824

See more details on using hashes here.

File details

Details for the file youtube_channel_scraper-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for youtube_channel_scraper-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b59cadcc72a12ab7436b34743d8fc5b06cfccd708c2892d603015093dea71031
MD5 faae4dde3b6eb8f1c6403ba7d26f5f0f
BLAKE2b-256 18160380515e5b5b0b31d9e0507229b6419e69a6d4b840ed84f0df26f6849f4f

See more details on using hashes here.

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