ffprobe disaster
This commit is contained in:
parent
8a97216d88
commit
550d937a39
@ -78,17 +78,20 @@ class YTAudio(discord.AudioSource):
|
||||
if url in self._durations:
|
||||
return
|
||||
self._durations.setdefault(url, '')
|
||||
prompt = ''
|
||||
if self.tor:
|
||||
prompt = 'torify '
|
||||
prompt += (
|
||||
f'ffprobe -i {shlex.quote(url)}'
|
||||
' -show_entries format=duration -v quiet -of csv="p=0" -sexagesimal'
|
||||
)
|
||||
args = ['torify']
|
||||
else:
|
||||
args = []
|
||||
args += [
|
||||
'ffprobe', '-i', url,
|
||||
'-show_entries', 'format=duration',
|
||||
'-v', 'quiet',
|
||||
'-of', 'default=noprint_wrappers=1:nokey=1',
|
||||
'-sexagesimal'
|
||||
]
|
||||
p = subprocess.Popen(
|
||||
prompt,
|
||||
stdout=subprocess.PIPE,
|
||||
shell=True
|
||||
args,
|
||||
stdout=subprocess.PIPE
|
||||
)
|
||||
with Benchmark('FFP'):
|
||||
code = await self.loop.run_in_executor(None, p.wait)
|
||||
|
Loading…
Reference in New Issue
Block a user