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 chromedriver at
/chromedriver
. For more details refer to scripts/install_chromedriver.sh
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
Built Distribution
Close
Hashes for youtube-channel-scraper-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e47e2ae467fdd9d1723484b4b8a805b62df82c1004a2fe96e63362139728715d |
|
MD5 | 1984701458080152da2581f42758017e |
|
BLAKE2b-256 | a9e8288a7ab8265f2090793368216135568c87fcf79a50181d00fe57958f1eb2 |
Close
Hashes for youtube_channel_scraper-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d12b552dbdb27c6f1f61b44d746d0203ba99ecbaa6575b470a66d9fbeab5934b |
|
MD5 | c619d4bd7e01e2ae13efe73e62cf6c9d |
|
BLAKE2b-256 | 5da8c1a1a22be8949cfb91c894ee5d05845e49c053686aeeb6809785b9952410 |