소스 검색

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

* Fix `www.youtube.com` hostname

* Update datasets.py
modifyDataloader
Glenn Jocher GitHub 2 년 전
부모
커밋
37675e110f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. +1
    -1
      utils/datasets.py

+ 1
- 1
utils/datasets.py 파일 보기

@@ -316,7 +316,7 @@ class LoadStreams:
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

Loading…
취소
저장