Unverified 提交 b40bdd6b authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

YouTube dependency fix `youtube_dl==2020.12.2` (#6612)

上级 cb2ad9f6
...@@ -301,7 +301,7 @@ class LoadStreams: ...@@ -301,7 +301,7 @@ class LoadStreams:
# Start thread to read frames from video stream # Start thread to read frames from video stream
st = f'{i + 1}/{n}: {s}... ' st = f'{i + 1}/{n}: {s}... '
if 'youtube.com/' in s or 'youtu.be/' in s: # if source is YouTube video if 'youtube.com/' in s or 'youtu.be/' in s: # if source is YouTube video
check_requirements(('git+https://github.com/Cupcakus/pafy', 'youtube_dl')) check_requirements(('pafy', 'youtube_dl==2020.12.2'))
import pafy import pafy
s = pafy.new(s).getbest(preftype="mp4").url # YouTube URL s = pafy.new(s).getbest(preftype="mp4").url # YouTube URL
s = eval(s) if s.isnumeric() else s # i.e. s = '0' local webcam s = eval(s) if s.isnumeric() else s # i.e. s = '0' local webcam
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论