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