Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

youtube-dl taking long time to download audio #30262

Closed
1 task
GarRudnyai opened this issue Nov 23, 2021 · 2 comments
Closed
1 task

youtube-dl taking long time to download audio #30262

GarRudnyai opened this issue Nov 23, 2021 · 2 comments

Comments

@GarRudnyai
Copy link

GarRudnyai commented Nov 23, 2021

Checklist

  • I'm reporting a broken site support issue
  • [ x] I've verified that I'm running youtube-dl version 2021.06.06
  • [ x] I've checked that all provided URLs are alive and playable in a browser
  • [ x] I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • [ x] I've searched the bugtracker for similar bug reports including closed ones
  • [ x] I've read bugs section in FAQ

Verbose log

[youtube] y97gX9QSwZk: Downloading webpage
[download] Destination: y97gX9QSwZk.wav
[download] 100% of 4.47MiB in 01:13
[ffmpeg] Post-process file y97gX9QSwZk.wav exists, skipping

Code (embedded in python)

video_id = get_yt_video_id(url) # this method works; returns a youtube video id given its url
    ydl_opts = {
        'format': 'bestaudio/best',
        'nocheckcertificate': True,
        'outtmpl': (video_id + ".wav"),
        'postprocessors': [{
            'key': 'FFmpegExtractAudio',
            'preferredcodec': 'wav',
            'preferredquality': '192',
        }],
    }
    with youtube_dl.YoutubeDL(ydl_opts) as ydl:
        info_dict = ydl.extract_info(url, download=True)

Description

I am trying to just download the audio from a YouTube video using youtube-dl, but it is taking me as long as one to two minutes while it should be no more than 20 seconds for short videos (under five mins). I am running the code above in a heroku app, and when I try to download youtube videos to the server in production the app almost always times out (heroku waits 55 seconds before timing out). I only want to download the audio, so if my code downloads the video as well, please let me know how I can download only audio. Besides that, why are my speeds so slow and how can I get them to more reasonable levels? Thanks!

@dirkf
Copy link
Contributor

dirkf commented Nov 23, 2021

Duplicate of #29326: TL;DR.

@dirkf
Copy link
Contributor

dirkf commented Jan 31, 2022

Closed in af9e725.

@dirkf dirkf closed this as completed Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants