Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Fix `www.youtube.com` hostname

* Update datasets.py
  • Loading branch information
glenn-jocher committed Apr 1, 2022
1 parent 5714073 commit 23c28ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def __init__(self, sources='streams.txt', img_size=640, stride=32, auto=True):
for i, s in enumerate(sources): # index, source
# Start thread to read frames from video stream
st = f'{i + 1}/{n}: {s}... '
if urlparse(s).hostname in ('youtube.com', 'youtu.be'): # if source is YouTube video
if urlparse(s).hostname in ('www.youtube.com', 'youtube.com', 'youtu.be'): # if source is YouTube video
check_requirements(('pafy', 'youtube_dl==2020.12.2'))
import pafy
s = pafy.new(s).getbest(preftype="mp4").url # YouTube URL
Expand Down

0 comments on commit 23c28ff

Please sign in to comment.