{"library":"pytubefix","title":"pytubefix","description":"Python3 library for downloading YouTube Videos. Current version is 10.3.8. It's a lightweight, Pythonic, dependency-free, library (and command-line utility) for downloading YouTube Videos. pytubefix is an actively maintained fork of pytube that solves broken functionality and adds new features, regularly addressing YouTube's continuous changes. It supports progressive and DASH streams, callback functions for download progress, and caption extraction.","language":"python","status":"active","last_verified":"Mon May 18","install":{"commands":["pip install pytubefix"],"cli":{"name":"pytubefix","version":"pytubefix 10.7.1"}},"imports":["from pytubefix import YouTube","from pytubefix import Playlist","from pytubefix import Search","from pytubefix.cli import on_progress","from pytubefix.exceptions import VideoUnavailable"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom pytubefix import YouTube\n\ndef on_progress(stream, chunk, bytes_remaining):\n    total_size = stream.filesize\n    bytes_downloaded = total_size - bytes_remaining\n    percentage_of_completion = bytes_downloaded / total_size * 100\n    print(f\"\\rDownloading: {percentage_of_completion:.2f}%\", end='')\n\nvideo_url = os.environ.get('YOUTUBE_VIDEO_URL', 'https://www.youtube.com/watch?v=dQw4w9WgXcQ') # Rick Astley - Never Gonna Give You Up\n\ntry:\n    yt = YouTube(video_url, on_progress_callback=on_progress)\n    print(f\"\\nTitle: {yt.title}\")\n    print(f\"Author: {yt.author}\")\n    print(f\"Views: {yt.views}\")\n\n    # Get the highest resolution progressive stream\n    # Progressive streams contain both video and audio\n    stream = yt.streams.get_highest_resolution()\n    if stream:\n        print(f\"Downloading '{yt.title}' in {stream.resolution}...\")\n        stream.download(output_path='./downloads')\n        print(\"\\nDownload complete!\")\n    else:\n        print(\"No suitable progressive stream found.\")\n\nexcept Exception as e:\n    print(f\"\\nAn error occurred: {e}\")","lang":"python","description":"This quickstart example demonstrates how to download a YouTube video using `pytubefix`. It initializes a `YouTube` object with a video URL, registers a progress callback for real-time updates, retrieves the video's metadata, and then downloads the highest resolution progressive stream to a 'downloads' directory. It handles a placeholder URL and basic error reporting.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-18","installed_version":"10.7.2","pypi_latest":"10.7.2","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":6.6,"avg_import_s":0.72,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pytubefix","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.64,"mem_mb":16.7,"disk_size":"246.5M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pytubefix","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":7.5,"import_time_s":0.46,"mem_mb":16.7,"disk_size":"238M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pytubefix","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.76,"mem_mb":18.1,"disk_size":"250.0M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pytubefix","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":6.3,"import_time_s":0.67,"mem_mb":18.1,"disk_size":"242M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pytubefix","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.92,"mem_mb":18.3,"disk_size":"241.6M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pytubefix","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5.4,"import_time_s":0.87,"mem_mb":18.3,"disk_size":"234M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pytubefix","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.93,"mem_mb":19.4,"disk_size":"241.0M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pytubefix","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5.4,"import_time_s":0.86,"mem_mb":19.4,"disk_size":"233M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pytubefix","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.52,"mem_mb":16.3,"disk_size":"246.7M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pytubefix","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":8.5,"import_time_s":0.56,"mem_mb":16.3,"disk_size":"239M"}]}}