Skip to content

Commit

Permalink
Fix slow video downloads
Browse files Browse the repository at this point in the history
Youtube-DL downloads videos with 50-70Kb/s speed, while previously
it used to have much higher speed (up to 10MB/s). A possible root
cause is new google services restrictions. Migrating from youtube-dl
to the lates yt-dlp version resolves this problem.

See ytdl-org/youtube-dl#30102 for details
  • Loading branch information
stepan-anokhin committed Feb 8, 2022
1 parent 78c2f6a commit f08e23a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion environment-gpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencies:
- inquirer
- pytimeparse
- annoy
- youtube-dl
- yt-dlp
- dacite
- deprecation
- torch
Expand Down
6 changes: 3 additions & 3 deletions winnow/utils/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from pathlib import Path
from typing import Iterable, List

import youtube_dl
import yt_dlp
from tqdm import tqdm
from youtube_dl.utils import YoutubeDLError
from yt_dlp.utils import YoutubeDLError

from winnow.pipeline.progress_monitor import ProgressMonitor, BaseProgressMonitor

Expand Down Expand Up @@ -129,7 +129,7 @@ def download_video(
"outtmpl": output_template,
}

with youtube_dl.YoutubeDL(ydl_opts) as ydl:
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
# Determine destination file name
video_info = ydl.extract_info(video_url, download=False)
file_name = ydl.prepare_filename(video_info)
Expand Down

0 comments on commit f08e23a

Please sign in to comment.