Skip to content

Commit

Permalink
YouTube dependency fix youtube_dl==2020.12.2 (ultralytics#6612)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher authored and eladco committed Mar 10, 2022
1 parent e93b6b9 commit 5696886
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5696886

Please sign in to comment.