added proxy config for ffmpeg
This commit is contained in:
parent
a3f0c662eb
commit
0c760a08e5
@ -63,13 +63,21 @@ class FFmpegAudioPlayer():
|
|||||||
if self.Playing:
|
if self.Playing:
|
||||||
self.Stop()
|
self.Stop()
|
||||||
|
|
||||||
|
proxy_url = ""
|
||||||
|
if uri.startswith("http://") or uri.startswith("https://"):
|
||||||
|
proxy_url = self.Torchlight().Config["Proxy"]
|
||||||
|
|
||||||
if position:
|
if position:
|
||||||
PosStr = str(datetime.timedelta(seconds = position))
|
PosStr = str(datetime.timedelta(seconds=position))
|
||||||
#Command = ["/usr/bin/ffmpeg", "-ss", PosStr, "-i", uri, "-acodec", "pcm_s16le", "-ac", "1", "-ar", str(int(self.SampleRate)), "-f", "s16le", "-vn", *args]
|
Command = ["/usr/bin/ffmpeg"]
|
||||||
Command = ["/usr/bin/ffmpeg", "-ss", PosStr, "-i", uri, "-acodec", "pcm_s16le", "-ac", str(self.Channels), "-ar", str(int(self.SampleRate)), "-f", "s16le", "-vn"]
|
if proxy_url:
|
||||||
|
Command += ["-http_proxy", proxy_url]
|
||||||
|
Command += ["-ss", PosStr, "-i", uri, "-acodec", "pcm_s16le", "-ac", str(self.Channels), "-ar", str(int(self.SampleRate)), "-f", "s16le", "-vn"]
|
||||||
else:
|
else:
|
||||||
#Command = ["/usr/bin/ffmpeg", "-i", uri, "-acodec", "pcm_s16le", "-ac", "1", "-ar", str(int(self.SampleRate)), "-f", "s16le", "-vn", *args]
|
Command = ["/usr/bin/ffmpeg"]
|
||||||
Command = ["/usr/bin/ffmpeg", "-i", uri, "-acodec", "pcm_s16le", "-ac", str(self.Channels), "-ar", str(int(self.SampleRate)), "-f", "s16le", "-vn"]
|
if proxy_url:
|
||||||
|
Command += ["-http_proxy", proxy_url]
|
||||||
|
Command += ["-i", uri, "-acodec", "pcm_s16le", "-ac", str(self.Channels), "-ar", str(int(self.SampleRate)), "-f", "s16le", "-vn"]
|
||||||
|
|
||||||
if args:
|
if args:
|
||||||
Command += list(args)
|
Command += list(args)
|
||||||
|
|||||||
@ -58,5 +58,6 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
"WolframAPIKey": "",
|
"WolframAPIKey": "",
|
||||||
"OpenWeatherAPIKey": ""
|
"OpenWeatherAPIKey": "",
|
||||||
|
"Proxy": ""
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user