Skip to main content

Library GoLD YouTube downloader (video / audio / shorts / playlists) with smart caching and auto quality handling

Project description

gold-dl — The simplest YouTube downloader (CLI + Python API)

Downloads Downloads month version Python Version License PyPI stats

gold-dl screenshot

Table of Contents

  • Installation
  • Upgrade
  • Quick Start (CLI)
  • Options
  • Examples
  • Python API
  • Screenshots
  • Todo
  • Contributing
  • License
  • Badges / Usage

Channel Library : https://t.me/Source_Goldd Contact / Developer : @CB6BB

Installation

  1. Verify you have Python 3.x:
python --version
  1. Install gold-dl:
pip install gold-dl --break-system-packages

(If your environment does not require --break-system-packages, you may omit it.)

Upgrade

pip install --upgrade gold-dl --break-system-packages

Quick Start (CLI)

gold-dl "YOUTUBE_LINK" [PATH]
  • "YOUTUBE_LINK" (required) the YouTube video or playlist URL (wrap in quotes).
  • [PATH] (optional) destination folder; defaults to the current working directory.

Common options

  • -v, --version
    • Show current version and exit.
  • -a, --audio
    • Download audio only (skip video selection).
  • -f, --footage
    • Download video only (skip audio-only flows).

Icons used in this README

  • Download
  • Audio
  • Video
  • Folder

Examples

# Download a video (interactive selection if needed)
gold-dl "https://www.youtube.com/watch?v=VIDEO_ID"

# Download audio only
gold-dl "https://www.youtube.com/watch?v=VIDEO_ID" --audio

# Download to a specific folder
gold-dl "https://www.youtube.com/watch?v=VIDEO_ID" ./downloads

# Download a playlist (you can select items or download all)
gold-dl "https://www.youtube.com/playlist?list=PLAYLIST_ID"

Python API (async) Use the async DownloadService to integrate gold-dl into bots and other apps.

import os
import asyncio
from typing import Union
from gold_dl import DownloadService

async def download(bot_username, link, video: Union[bool, str] = None):
    link = link
    loop = asyncio.get_running_loop()   
    def audio_dl():
        try:
            service = DownloadService(url=link, path="downloads/%(id)s.%(ext)s", quality="best", is_audio=True)
            result = service.download()
            return result
        except Exception:
            return None   
    def video_dl():
        try:          
            service = DownloadService(url=link, path="downloads/%(id)s.%(ext)s", quality="360p", is_audio=False)          
            result = service.download()
            return result
        except Exception:
            return None  
    if video:
        downloaded_file = await loop.run_in_executor(None, video_dl)
        return downloaded_file
    else:
        downloaded_file = await loop.run_in_executor(None, audio_dl)
        return downloaded_file

# Example runner:
# asyncio.run(download("botname", "https://www.youtube.com/watch?v=VIDEO_ID", video=None))

Direct Link (New) Use the async DownloadService to integrate gold-dl into bots and other apps.

import os
import asyncio
from typing import Union
from gold_dl import DownloadService

async def download(bot_username, link, video: Union[bool, str] = None):
    link = link
    loop = asyncio.get_running_loop()   
    def audio_dl():
        try:
            service = DownloadService(url=link, quality="best", is_audio=True)
            stream_url = service.get_direct_url(is_audio=True)
            if stream_url:
                return stream_url          
        except Exception:
            return None   
    def video_dl():
        try:
            service = DownloadService(url=link, quality="360p", is_audio=False)
            stream_url = service.get_direct_url(is_audio=False)
            if stream_url:
                return stream_url        
        except Exception:
            return None
    if video:  
        stream_url = await loop.run_in_executor(None, video_dl)
        return stream_url
    else:
        stream_url = await loop.run_in_executor(None, audio_dl)
        return stream_url

# Example runner:
# asyncio.run(download("botname", "https://www.youtube.com/watch?v=VIDEO_ID", video=None))

Screenshots

  • Download video and choose save location
  • Choose download type (audio / video)
  • Select resolution when downloading video
  • Playlist selection UI (pick single video(s) or download all)

Todo

  • Notification System
  • Auto Update package if new version available
  • Support Optional Numbering for Downloaded Playlist Videos
  • Improve code health
  • API (Python)
  • Download Playlist
  • Support setting for default download folder
  • Download thumbnails with videos and audio

Contributing

  • Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
  • Ensure code follows the existing style and add tests where applicable.
  • Update the README and other documentation as necessary.

License

  • See the LICENSE file in the project root (and the PyPI license badge above).

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

gold_dl-2026.1.20.1.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

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

gold_dl-2026.1.20.1-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

Details for the file gold_dl-2026.1.20.1.tar.gz.

File metadata

  • Download URL: gold_dl-2026.1.20.1.tar.gz
  • Upload date:
  • Size: 21.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for gold_dl-2026.1.20.1.tar.gz
Algorithm Hash digest
SHA256 d92e92d482e17218723d6082185692a86a28034e4b344ab856fcc688f0eb2538
MD5 718e0aaeec814fde1bcfb4a4ae1b003d
BLAKE2b-256 ec2b89e536032d95b1eadcf37c66ad505d6ece5ccf00f5e647d231cc72907d95

See more details on using hashes here.

File details

Details for the file gold_dl-2026.1.20.1-py3-none-any.whl.

File metadata

  • Download URL: gold_dl-2026.1.20.1-py3-none-any.whl
  • Upload date:
  • Size: 23.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for gold_dl-2026.1.20.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0fdddca01a1e2b2f2a5ec158b12fb9195224e30725b9cd1b89dcf9f1076f2889
MD5 0eb9f1c0adc2b81629d3d958d4e19f39
BLAKE2b-256 1fdf7620c9868f298a0e952d91df4450b3e54a96fbac65db937e802866cdc5bf

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