Fix YouTube dislike button bug in `pafy` package (#6603)
Browse filesPer https://github.com/ultralytics/yolov5/issues/6583#issuecomment-1034421945 by
@alicera
- 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(('pafy', 'youtube_dl'))
|
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(('git+https://github.com/Cupcakus/pafy', 'youtube_dl'))
|
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
|