Skip to main content

youtube_extract

Codacy Badge Build Status codecov

Extract metadata for all videos from a youtube channel and exports it into a csv or xlsx file.

Be sure to read the csv file using the tab character \t as field separator in your spreadsheet software of choice.

As of now it's quite slow and unpredictable, expect ~400 seconds for extracting all videos metadata from a channel containing 400 videos.

Fields extracted

Field Description
author Channel Name
channel_url Channel URL
title Video Title
webpage_url Video URL
view_count View Count
like_count Like Count
duration Duration in seconds
upload_date Upload Date in YYYYMMDD Format
tags Tags
categories Categories
description Description
thumbnail Thumbnail URL
best_format Highest Format Available
filesize_bytes Filesize in bytes

Requirements

  • python >=3.8
  • yt-dlp
  • pandas
  • openpyxl

Installation

Preferred install method

pip install youtube_extract

If you are an Archlinux user, you can install the AUR package youtube_extract-git.

Run from source

First method (installing the youtube_extract package)

git clone https://github.com/dbeley/youtube_extract
cd youtube_extract
python setup.py install
youtube_extract -h

Second method (installing only the dependencies)

git clone https://github.com/dbeley/youtube_extract
cd youtube_extract
pip install -r requirements.txt
python -m youtube_extract -h

Third method (installing the youtube_extract package with pipenv)

git clone https://github.com/dbeley/youtube_extract
cd youtube_extract
pipenv install '-e .'
pipenv run youtube_extract -h

Usage

If installed :

youtube_extract CHANNEL_URL
# or xlsx format
youtube_extract CHANNEL_URL -e xlsx

Otherwise, in the directory containing the source code :

python -m youtube_extract CHANNEL_URL
# or xlsx format
python -m youtube_extract CHANNEL_URL -e xlsx

Help

youtube_extract -h
usage: youtube_extract [-h] [--debug] [-e EXPORT_FORMAT] [channel_url]

Extract metadata for all videos from a youtube channel into a csv or xlsx
file.

positional arguments:
  channel_url           Youtube channel url.

optional arguments:
  -h, --help            show this help message and exit
  --debug               Display debugging information.
  -e EXPORT_FORMAT, --export_format EXPORT_FORMAT
                        Export format (csv or xlsx). Default : csv.

Metadata

Release files for youtube-extract 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for youtube-extract 1.4.0
File Size Uploaded Provenance Actions
youtube_extract-1.4.0.tar.gz 6.6 kB Without provenance Details for youtube_extract-1.4.0.tar.gz

Release files / youtube_extract-1.4.0.tar.gz

Download URL youtube_extract-1.4.0.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2fe2f9b2762ebeadcf2073fbd6b47a6d1b719fa23cf192250519d3cafd62a9dd
BLAKE2b-256 checksum
How to use checksums
cfc9cd49c81708d7ba880594b7fd59f09a991bd6aab995626a35bc5b29dc064c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Security for youtube-extract 1.4.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page