glenn-jocher commited on
Commit
37675e1
1 Parent(s): 71621df

Fix `www.youtube.com` hostname (#7242)

Browse files

* Fix `www.youtube.com` hostname

* Update datasets.py

Files changed (1) hide show
  1. utils/datasets.py +1 -1
utils/datasets.py CHANGED
@@ -316,7 +316,7 @@ class LoadStreams:
316
  for i, s in enumerate(sources): # index, source
317
  # Start thread to read frames from video stream
318
  st = f'{i + 1}/{n}: {s}... '
319
- if urlparse(s).hostname in ('youtube.com', 'youtu.be'): # if source is YouTube video
320
  check_requirements(('pafy', 'youtube_dl==2020.12.2'))
321
  import pafy
322
  s = pafy.new(s).getbest(preftype="mp4").url # YouTube URL
 
316
  for i, s in enumerate(sources): # index, source
317
  # Start thread to read frames from video stream
318
  st = f'{i + 1}/{n}: {s}... '
319
+ if urlparse(s).hostname in ('www.youtube.com', 'youtube.com', 'youtu.be'): # if source is YouTube video
320
  check_requirements(('pafy', 'youtube_dl==2020.12.2'))
321
  import pafy
322
  s = pafy.new(s).getbest(preftype="mp4").url # YouTube URL