Questions tagged [yt-dlp]

yt-dlp is a command-line program, written in Python, that lets you easily download videos and audio from more than a thousand websites. It is a youtube-dl fork based on the now inactive youtube-dlc.

100 questions
7
votes
1 answer

Download video with yt-dlp using format id

How can I download a specific format without using options like "best video", using the format ID... example: 139, see the picture ❯ yt-dlp --list-formats https://www.youtube.com/watch?v=BaW_jenozKc [youtube] Extracting URL:…
GHOST
  • 159
  • 1
  • 9
6
votes
1 answer

How can I return progress_hook for yt_dlp using FastApi to end user?

Relevant portion of my code looks something like this: @directory_router.get("/youtube-dl/{relative_path:path}", tags=["directory"]) def youtube_dl(relative_path, url, name=""): """ Download """ relative_path, _ =…
ScipioAfricanus
  • 1,331
  • 6
  • 18
  • 39
5
votes
1 answer

Can I use yt-dlp to extract only one video info from a playlist?

Here's my code using Python (simplified version): import yt_dlp YDL_OPTIONS = { 'format': 'bestaudio*', 'noplaylist': True, } with yt_dlp.YoutubeDL(YDL_OPTIONS) as ydl: info = ydl.extract_info(url, download=False) The problem comes up…
sweetbrulee
  • 53
  • 1
  • 4
3
votes
0 answers

How to create search options

I'm currently working on having my Discord music bot create a keyword search menu, similar to the one depicted in the image. I'm utilizing the ytsearch from the ytdlp library to retrieve the top five results for a keyword search. The search process…
ParrotXray
  • 33
  • 4
3
votes
0 answers

discord.py music bot slowing down for longer audio queries

So I'm trying to make a music bot with discord.py. Shown below is a minimum working example of the bot with the problematic functions: import os import discord from discord.ext import commands from discord import player as p import yt_dlp as…
Bobluge
  • 31
  • 1
  • 3
3
votes
2 answers

Getting the file name of downloaded video using yt-dlp

I'm intending to use yt-dlp to download a video and then cut the video down afterward using ffmpeg. But to be able to use ffmpeg I am going to have to know the name of the file that yt-dlp produces. I have read through their documentation but I…
LT_Orange
  • 55
  • 2
  • 6
3
votes
1 answer

How to pass `--get-url` flag to youtube-dl or yt-dlp when embedded in code

Is there a way to only get the url when using youtube-dl or yt-dlp embedded in python code? It seems that --get-url is not in the YoutubeDL class' available options. I tried i think all logical way to pass --get-url, e.g. geturl, getUrl, get_url,…
5th
  • 99
  • 1
  • 7
3
votes
0 answers

Using yt-dlp in a Python script, how do I download a specific section of a video?

I'm trying to write a Python script that downloads specific sections of videos using yt-dlp. import yt_dlp yt_opts = { 'verbose': True, 'download_sections': [{ 'section': { 'start_time': 2, 'end_time': 7 …
zack fisher
  • 31
  • 1
  • 2
3
votes
1 answer

How to Make Python Module yt-dlp ignore Private Videos When Downloading A Playlist

I'm Downloading a Playlist which has some hidden Videos so python gives me DownloadError, I want to Download the Whole Playlist at once. Is there a fix for that. I'm trying to see if I can make it ignore those hidden videos My Code: from yt_dlp…
Sara
  • 33
  • 1
  • 3
2
votes
2 answers

Python yt-dlp and ffmpeg error "merging of multiple formats but ffmpeg is not installed"

I am using the latest version of yt-dlp with Python 3.9. I am trying to download a youtube video in mp4 format with outputname as the youtubeid.mp4 and with best resolution not more than 4K. This is my Python code: ytid = '4cDqaLxrt6Q' url =…
T Tea Tie
  • 21
  • 4
2
votes
1 answer

How to embed auto-generated English subtitles with either youtube-dl or yt-dlp?

The key here is to be able to embed the auto-generated subtitles. The tool can download the autogenerated subtitles but can only embed the real subtitle file, if it exists. I wondered if there would be a way to embed or capture in the video the…
Adel
  • 181
  • 2
  • 14
2
votes
1 answer

YT-DLP download range not working for youtube links

This is just a sample code, I was using range_func without any problems and then youtube links somehow starts from the the beginning of the video no matter what start time I gave. Odd thing is it was working perfect and somehow it's only gets end…
wutwut
  • 33
  • 7
2
votes
1 answer

How to download entire youtube playlist with embedded chapter information on ytdl / ytdlp?

I use this to download individual files with chapter information. ▶️ yt-dlp -f "bestvideo[height<=720]+bestaudio/best[height<=720]" -o "%USERPROFILE%\Desktop\%(title)s-%(id)s.%(ext)s" --embed-chapters https://www.youtube.com/watch?v= I tried doing…
Good Boy
  • 21
  • 1
  • 1
  • 3
2
votes
1 answer

pygame Error : Unknown WAVE format & mpg123_seek: Invalid RVA mode

So i was making an Audio Player, it downloads audio using YT-DLP and then plays it using pygame.mixer. the main problem, i am getting is that pygame Won't Run that Audio instead it would Just give Errors for Different Audio Formats like Wav, Ogg,…
iamDyeus
  • 21
  • 8
2
votes
0 answers

Download encrypted m3u8 with ffmpeg "HTTP error 403 Forbidden"

I have been using ffmepg and many tools to download online videos but I have the following case: The main m3u8 file from the streaming server shows different resolutions: #EXTM3U #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=133241,RESOLUTION=426x240,…
MTALY
  • 1,430
  • 2
  • 18
  • 26
1
2 3 4 5 6 7