diff --git a/utils/datasets.py b/utils/datasets.py index 8d5fbb6a4a16..86a63786e17e 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -276,7 +276,7 @@ def __init__(self, sources='streams.txt', img_size=640, stride=32): # Start the thread to read frames from the video stream print(f'{i + 1}/{n}: {s}... ', end='') url = eval(s) if s.isnumeric() else s - if 'youtube.com/' in url or 'youtu.be/' in url: + if 'youtube.com/' in url or 'youtu.be/' in url: # if source is YouTube video check_requirements(file=None, include=('pafy', 'youtube_dl')) import pafy url = pafy.new(url).getbest(preftype="mp4").url