diff --git a/utils/datasets.py b/utils/datasets.py index 0cdc72c..b6bb8b0 100644 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -282,7 +282,7 @@ class LoadStreams: # multiple IP or RTSP cameras # 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 source is YouTube video + if 'youtube.com/' in str(url) or 'youtu.be/' in str(url): # if source is YouTube video check_requirements(('pafy', 'youtube_dl')) import pafy url = pafy.new(url).getbest(preftype="mp4").url