{"id":15145983,"url":"https://github.com/vasysik/yt-dlp-host-api","last_synced_at":"2026-01-26T02:34:43.069Z","repository":{"id":255063187,"uuid":"848464313","full_name":"Vasysik/yt-dlp-host-api","owner":"Vasysik","description":"A simple python library for sending requests to your yt-dlp-host API","archived":false,"fork":false,"pushed_at":"2024-11-03T18:39:45.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-30T22:07:08.873Z","etag":null,"topics":["api","docker","docker-compose","library","python","python-library","server","youtube","youtube-downloader","yt-dlp","yt-dlp-api","yt-dlp-host","yt-dlp-server"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vasysik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-27T20:06:15.000Z","updated_at":"2024-11-03T18:39:48.000Z","dependencies_parsed_at":"2024-09-26T12:00:35.981Z","dependency_job_id":null,"html_url":"https://github.com/Vasysik/yt-dlp-host-api","commit_stats":null,"previous_names":["vasysik/yt-dlp-host-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vasysik%2Fyt-dlp-host-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vasysik%2Fyt-dlp-host-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vasysik%2Fyt-dlp-host-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vasysik%2Fyt-dlp-host-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vasysik","download_url":"https://codeload.github.com/Vasysik/yt-dlp-host-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237896873,"owners_count":19383601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","docker","docker-compose","library","python","python-library","server","youtube","youtube-downloader","yt-dlp","yt-dlp-api","yt-dlp-host","yt-dlp-server"],"created_at":"2024-09-26T12:00:30.506Z","updated_at":"2025-10-24T01:30:28.414Z","avatar_url":"https://github.com/Vasysik.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [yt-dlp-host](https://github.com/Vasysik/yt-dlp-host) API Client\n\nThis is a Python library for interacting with the [yt-dlp-host](https://github.com/Vasysik/yt-dlp-host) API.\n\n## Installation\n\nYou can install the library using pip:\n\n```\npip install yt-dlp-host-api\n```\n\n## Usage\n\nHere's a basic example of how to use the library:\n\n```python\nimport yt_dlp_host_api\n\n# Initialize the API client\napi = yt_dlp_host_api.api('http://your-api-url.com')\nclient = api.get_client('YOUR_API_KEY')\n\n# Download a complete video in MP4 format\nclient.get_video(url='https://youtu.be/1FPdtR_5KFo', output_format='mp4').save_file(\"test_video.mp4\")\nprint(\"Video saved to test_video.mp4\")\n\n# Download a video in WebM format\nclient.get_video(url='https://youtu.be/1FPdtR_5KFo', output_format='webm').save_file(\"test_video.webm\")\nprint(\"Video saved to test_video.webm\")\n\n# Download video without audio (animation/GIF friendly)\nclient.get_video(\n    url='https://youtu.be/1FPdtR_5KFo',\n    audio_format=None\n).save_file(\"video_no_audio.mp4\")\nprint(\"Video without audio saved to video_no_audio.mp4\")\n\n# Download a video segment with precise cutting\nclient.get_video(\n    url='https://youtu.be/1FPdtR_5KFo',\n    output_format='mkv',\n    start_time=\"00:05:00\",\n    end_time=\"00:10:00\",\n    force_keyframes=True\n).save_file(\"precise_cut.mkv\")\nprint(\"Precisely cut segment saved to precise_cut.mkv\")\n\n# Download a video segment with faster cutting at keyframes\nclient.get_video(\n    url='https://youtu.be/1FPdtR_5KFo',\n    output_format='mp4',\n    start_time=\"00:05:00\",\n    end_time=\"00:10:00\",\n    force_keyframes=False\n).save_file(\"keyframe_cut.mp4\")\nprint(\"Keyframe-cut segment saved to keyframe_cut.mp4\")\n\n# Download a complete audio in MP3 format\nclient.get_audio(url='https://youtu.be/1FPdtR_5KFo', output_format='mp3').save_file(\"test_audio.mp3\")\nprint(\"Audio saved to test_audio.mp3\")\n\n# Download audio in FLAC format (lossless)\nclient.get_audio(url='https://youtu.be/1FPdtR_5KFo', output_format='flac').save_file(\"test_audio.flac\")\nprint(\"Audio saved to test_audio.flac\")\n\n# Get info\ninfo_json = client.get_info(url='https://youtu.be/1FPdtR_5KFo').get_json(['qualities', 'title'])\nprint(\"Video info:\", info_json)\n\n# Admin operations (requires admin API key)\nnew_key = client.create_key(\"user_key\", [\"get_video\", \"get_audio\", \"get_info\"])\nkeys = client.get_keys()\nkey = client.get_key(\"user_key\")\nclient.delete_key(\"user_key\")\n```\n\n## Features\n\n- Download YouTube videos\n  - Download complete videos\n  - Download video without an audio track\n  - Download specific time segments\n    - Precise cutting with frame re-encoding\n    - Fast cutting at keyframes\n  - Choose video and audio quality\n  - Choose output format (MP4, MKV, WebM, AVI, MOV, FLV)\n- Download YouTube audio\n  - Download complete audio\n  - Download specific time segments\n  - Choose audio quality\n  - Choose output format (MP3, M4A, Opus, FLAC, WAV, AAC, OGG)\n- Extract live stream segments\n- Retrieve video information\n- Checking client permissions\n- Admin operations:\n  - Create new API keys\n  - List existing API keys\n  - Get API key by key name\n  - Delete API keys\n\n## API Reference\n\n### Client\n\n- `client.get_video(url, video_format=\"bestvideo\", audio_format=\"bestaudio\", output_format=\"mp4\", start_time=None, end_time=None, force_keyframes=False)`: Get video with optional time segment selection. To download video without audio, set `audio_format=None`.\n- `client.get_audio(url, audio_format=\"bestaudio\", output_format=None, start_time=None, end_time=None, force_keyframes=False)`: Get audio with optional time segment selection.\n- `client.get_live_video(url, duration, start=0, video_format=\"bestvideo\", audio_format=\"bestaudio\", output_format=\"mp4\")`: Get live video segment.\n- `client.get_live_audio(url, duration, start=0, audio_format=\"bestaudio\", output_format=None)`: Get live audio segment.\n- `client.get_info(url)`: Get video information.\n- `client.send_task.get_video(url, video_format=\"bestvideo\", audio_format=\"bestaudio\", output_format=\"mp4\", start_time=None, end_time=None, force_keyframes=False)`: Initiate a video download task. Set `audio_format=None` for video without audio.\n- `client.send_task.get_audio(url, audio_format=\"bestaudio\", output_format=None, start_time=None, end_time=None, force_keyframes=False)`: Initiate an audio download task.\n- `client.send_task.get_live_video(url, duration, start=0, video_format=\"bestvideo\", audio_format=\"bestaudio\", output_format=\"mp4\")`: Initiate a live video download task.\n- `client.send_task.get_live_audio(url, duration, start=0, audio_format=\"bestaudio\", output_format=None)`: Initiate a live audio download task.\n- `client.send_task.get_info(url)`: Initiate an info retrieval task.\n- `client.check_permissions(permissions)`: Check for all permissions in the list.\n\n### Supported Output Formats\n\n#### Video Formats\n- **mp4** - MPEG-4 Part 14 (recommended)\n- **mkv** - Matroska\n- **webm** - WebM\n- **avi** - Audio Video Interleave\n- **mov** - QuickTime File Format\n- **flv** - Flash Video\n\n#### Audio Formats\n- **mp3** - MPEG Audio Layer III\n- **m4a** - MPEG-4 Audio\n- **opus** - Opus Audio\n- **flac** - Free Lossless Audio Codec\n- **wav** - Waveform Audio File Format\n- **aac** - Advanced Audio Coding\n- **ogg** - Ogg Vorbis\n\nNote: If `output_format` is not specified for audio, the original format will be used.\n\n### Time Format\n\nTime parameters (`start_time` and `end_time`) should be provided in the following format:\n- \"HH:MM:SS\" (hours:minutes:seconds)\nExamples:\n- \"00:05:00\" - 5 minutes\n- \"01:30:45\" - 1 hour, 30 minutes, and 45 seconds\n\n### Cutting Modes\n\nThe `force_keyframes` parameter determines how video/audio segments are cut:\n- `force_keyframes=False` (default): Faster cutting that aligns to nearest keyframes. May not be exactly at specified timestamps but is much faster as it avoids re-encoding.\n- `force_keyframes=True`: Precise cutting at exact timestamps. This requires re-encoding which takes longer but provides exact cuts.\n\n### Task\n\n- `task.get_status()`: Get the current status of a task\n- `task.get_result()`: Wait for and return the result of a task\n\n### TaskResult\n\n- `result.get_file()`: Get the file\n- `result.get_file_url()`: Get the URL of the downloaded file\n- `result.save_file(path)`: Save the downloaded file to the specified path\n- `result.get_json(fields=None)`: Get the JSON data for info tasks (optionally filtered by fields)\n\n### Admin\n\n- `client.create_key(name, permissions)`: Create a new API key\n- `client.get_keys()`: List all existing API keys\n- `client.get_key(name)`: Get API key by key name\n- `client.delete_key(name)`: Delete an API key\n\n## Error Handling\n\nThe library uses exceptions to handle errors. Catch `yt_dlp_host_api.exceptions.APIError` to handle API-related errors.\n\n## Contributing\n\nContributions to yt-dlp-host-api are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue on the GitHub repository. Pull requests are also encouraged.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvasysik%2Fyt-dlp-host-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvasysik%2Fyt-dlp-host-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvasysik%2Fyt-dlp-host-api/lists"}