added proxy config for ffmpeg

This commit is contained in:
jenz 2026-04-30 23:05:41 +02:00
parent a3f0c662eb
commit 0c760a08e5
2 changed files with 16 additions and 7 deletions

View File

@ -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)

View File

@ -58,5 +58,6 @@
},
"WolframAPIKey": "",
"OpenWeatherAPIKey": ""
"OpenWeatherAPIKey": "",
"Proxy": ""
}