YouTube dependency fix `youtube_dl==2020.12.2` (#6612)
Browse filesPer https://github.com/ultralytics/yolov5/issues/5860#issuecomment-1035320018 by
@hdnh2006
- utils/datasets.py +1 -1
utils/datasets.py
CHANGED
@@ -301,7 +301,7 @@ class LoadStreams:
|
|
301 |
# Start thread to read frames from video stream
|
302 |
st = f'{i + 1}/{n}: {s}... '
|
303 |
if 'youtube.com/' in s or 'youtu.be/' in s: # if source is YouTube video
|
304 |
-
check_requirements(('
|
305 |
import pafy
|
306 |
s = pafy.new(s).getbest(preftype="mp4").url # YouTube URL
|
307 |
s = eval(s) if s.isnumeric() else s # i.e. s = '0' local webcam
|
|
|
301 |
# Start thread to read frames from video stream
|
302 |
st = f'{i + 1}/{n}: {s}... '
|
303 |
if 'youtube.com/' in s or 'youtu.be/' in s: # if source is YouTube video
|
304 |
+
check_requirements(('pafy', 'youtube_dl==2020.12.2'))
|
305 |
import pafy
|
306 |
s = pafy.new(s).getbest(preftype="mp4").url # YouTube URL
|
307 |
s = eval(s) if s.isnumeric() else s # i.e. s = '0' local webcam
|