Browse Source

Fix YouTube dislike button bug in `pafy` package (#6603)

Per https://github.com/ultralytics/yolov5/issues/6583#issuecomment-1034421945 by @alicera
modifyDataloader
Glenn Jocher GitHub 2 years ago
parent
commit
364b7c5111
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      utils/datasets.py

+ 1
- 1
utils/datasets.py View File

@@ -301,7 +301,7 @@ class LoadStreams:
# 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(('pafy', 'youtube_dl'))
check_requirements(('git+https://github.com/Cupcakus/pafy', 'youtube_dl'))
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

Loading…
Cancel
Save