This commit is contained in:
Ben Raymond
2022-07-22 03:07:49 +10:00
committed by GitHub
parent dc3e04087d
commit 894a93e318
+1 -1
View File
@@ -282,7 +282,7 @@ class LoadStreams: # multiple IP or RTSP cameras
# Start the thread to read frames from the video stream # Start the thread to read frames from the video stream
print(f'{i + 1}/{n}: {s}... ', end='') print(f'{i + 1}/{n}: {s}... ', end='')
url = eval(s) if s.isnumeric() else s 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')) check_requirements(('pafy', 'youtube_dl'))
import pafy import pafy
url = pafy.new(url).getbest(preftype="mp4").url url = pafy.new(url).getbest(preftype="mp4").url