From 221ff7043b88dbf63defb279f9e2eba51b04e81d Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Fri, 11 Feb 2022 13:45:42 +0100 Subject: [PATCH] YouTube dependency fix `youtube_dl==2020.12.2` Per https://github.com/ultralytics/yolov5/issues/5860#issuecomment-1035320018 by @hdnh2006 --- utils/datasets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/datasets.py b/utils/datasets.py index 9eba83dd425c..e132e04f6d9d 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -301,7 +301,7 @@ def __init__(self, sources='streams.txt', img_size=640, stride=32, auto=True): # Start thread to read frames from video stream st = f'{i + 1}/{n}: {s}... ' if 'youtube.com/' in s or 'youtu.be/' in s: # if source is YouTube video - check_requirements(('git+https://github.com/Cupcakus/pafy', 'youtube_dl')) + check_requirements(('pafy', 'youtube_dl==2020.12.2')) import pafy s = pafy.new(s).getbest(preftype="mp4").url # YouTube URL s = eval(s) if s.isnumeric() else s # i.e. s = '0' local webcam