Skip to main content

Python script to scan YouTube channel playlists and detect unlisted videos

Project description

YouTube Channel Scanner

PyPI version Python Versions License: MIT

Python script to scan YouTube channel playlists and detect unlisted videos.

Description

This script analyzes a YouTube channel by:

  1. Retrieving all public videos from the channel
  2. Listing all public playlists
  3. Extracting videos from each playlist
  4. Comparing both lists to identify videos present in playlists but missing from public videos (= potentially unlisted)

Installation

Requirements

  • Python 3.7+
  • yt-dlp

Installing yt-dlp

pip install yt-dlp

Or with pipx:

pipx install yt-dlp

Usage

Basic command

python youtube_scanner.py "https://www.youtube.com/@ChannelName"

Available options

Option Description
-o, --output Output JSON filename (default: youtube_scan_YYYY-MM-DD_HHMMSS.json)
--playlists-only Scan playlists only (faster, skips public videos)
--detailed Fetch detailed metadata for each unlisted video (slower but accurate dates)

Examples

Full scan:

python youtube_scanner.py "https://www.youtube.com/@IronKingLoL"

Quick scan (playlists only):

python youtube_scanner.py "https://www.youtube.com/@IronKingLoL" --playlists-only

With accurate dates (slower):

python youtube_scanner.py "@IronKingLoL" --detailed

With custom filename:

python youtube_scanner.py "https://www.youtube.com/@IronKingLoL" -o ironking_scan.json

Supported URL formats

  • https://www.youtube.com/@username
  • https://www.youtube.com/c/ChannelName
  • https://www.youtube.com/channel/UCxxxxx

Output files

The script generates two files:

1. JSON file (youtube_scan_YYYY-MM-DD_HHMMSS.json)

Contains all structured data:

{
  "channel_url": "https://www.youtube.com/@example",
  "scan_date": "2025-11-29T14:30:52.123456",
  "public_videos": [],
  "playlist_videos": [],
  "playlists": [],
  "potentially_unlisted": [
    {
      "id": "dQw4w9WgXcQ",
      "title": "Video title",
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
      "availability": "unlisted",
      "upload_date": "2024-03-15",
      "found_in_playlist": "Playlist name"
    }
  ]
}

2. Text file (youtube_scan_YYYY-MM-DD_HHMMSS_links.txt)

Simple list of links with dates:

# Potentially unlisted videos

[2025-03-16] https://www.youtube.com/watch?v=xxxxx - Video title
[2025-02-11] https://www.youtube.com/watch?v=yyyyy - Another video

# All playlist videos

[2025-03-16] https://www.youtube.com/watch?v=xxxxx - Video title
...

How it works

Unlisted videos on YouTube:

  • Are not visible on the channel page
  • Are not indexed by YouTube search
  • But can be added to public playlists

This script exploits this behavior: if a video appears in a channel's playlist but not in its public videos, it's likely unlisted.

Limitations

  • Private videos: Inaccessible (different from "unlisted")
  • Private playlists: Not scanned
  • Possible false positives: A video can be in a playlist without belonging to the channel
  • Deleted videos: Sometimes appear in playlists but are no longer accessible
  • Rate limiting: YouTube may throttle requests if too frequent
  • Approximate dates: By default, dates are approximate (extracted from "X months ago"). Use --detailed for exact dates (slower)
  • Availability field: May show as "NA" in fast mode; use --detailed to get accurate availability status

Troubleshooting

"yt-dlp is not installed"

pip install yt-dlp

Timeout on large channels

The script has a 5-minute timeout per command. For very large channels, use --playlists-only to reduce scan time.

No unlisted videos found

This is normal if:

  • The channel has no unlisted videos in its playlists
  • All playlists are private
  • The channel has no playlists

Author

Thomas Lamarche - Initial work - OloZ17

License

MIT License - Free to use and modify.

Contributing

Contributions are welcome! Feel free to open an issue or pull request.

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

yt_scanner-0.1.1.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

yt_scanner-0.1.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file yt_scanner-0.1.1.tar.gz.

File metadata

  • Download URL: yt_scanner-0.1.1.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for yt_scanner-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8760fb01438807b01a61bc2e1555471d4a58cd751957927db23bcb7e08d9689f
MD5 7a8e49fe0a56411ea327e1b35deaee71
BLAKE2b-256 582bb33772d7d4d431c7fd73920a64d24f6deb8493de6611bcf350625b9ed4b0

See more details on using hashes here.

File details

Details for the file yt_scanner-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: yt_scanner-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for yt_scanner-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9d821eb10d1723a9ec146a54ad064c8b10967b787a35c8d8f0e7748a5a65f502
MD5 d1d3922aa850c6b998fb6de78803a97c
BLAKE2b-256 92556581f7b9305d6a4ecda593441c675a1370581e7c2a9576c4eeaa4597fa43

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