fix proxychains ffprobe
This commit is contained in:
parent
0627cb817f
commit
f9d9dc2eb9
@ -113,7 +113,8 @@ class Audio(discord.AudioSource):
|
|||||||
if url in self._durations:
|
if url in self._durations:
|
||||||
return
|
return
|
||||||
self._durations.setdefault(url, "")
|
self._durations.setdefault(url, "")
|
||||||
args = []
|
internal = url.startswith("http://adaas:5000/cachedx/")
|
||||||
|
args = [] if internal else ["proxychains"]
|
||||||
args += [
|
args += [
|
||||||
"ffprobe",
|
"ffprobe",
|
||||||
*("-i", url),
|
*("-i", url),
|
||||||
@ -129,6 +130,8 @@ class Audio(discord.AudioSource):
|
|||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
assert ap.stdout is not None
|
assert ap.stdout is not None
|
||||||
|
if not internal:
|
||||||
|
await ap.stdout.readline()
|
||||||
self._durations[url] = (
|
self._durations[url] = (
|
||||||
(await ap.stdout.read()).decode().strip().split(".")[0]
|
(await ap.stdout.read()).decode().strip().split(".")[0]
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user