Skip to content

Commit c1fcfe8

Browse files
authored
YouTube Usage example comments (#10106)
* YouTube Usage example comments Signed-off-by: Glenn Jocher <[email protected]> * Update dataloaders.py Signed-off-by: Glenn Jocher <[email protected]> Signed-off-by: Glenn Jocher <[email protected]>
1 parent 892c4cd commit c1fcfe8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

utils/dataloaders.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ def __init__(self, sources='streams.txt', img_size=640, stride=32, auto=True, tr
353353
# Start thread to read frames from video stream
354354
st = f'{i + 1}/{n}: {s}... '
355355
if urlparse(s).hostname in ('www.youtube.com', 'youtube.com', 'youtu.be'): # if source is YouTube video
356+
# YouTube format i.e. 'https://www.youtube.com/watch?v=Zgi9g1ksQHc' or 'https://youtu.be/Zgi9g1ksQHc'
356357
check_requirements(('pafy', 'youtube_dl==2020.12.2'))
357358
import pafy
358359
s = pafy.new(s).getbest(preftype="mp4").url # YouTube URL

0 commit comments

Comments
 (0)