Archived
Added new feature to add http proxy.
This commit is contained in:
@@ -11,16 +11,28 @@ public class StreamOpener extends Thread {
|
||||
private Config c;
|
||||
private String streamName;
|
||||
private String quality;
|
||||
private String proxy;
|
||||
private String proxyParam;
|
||||
public StreamOpener(Config c, int streamIndex, String quality) {
|
||||
this.c = c;
|
||||
this.streamName = c.getStreamName(streamIndex);
|
||||
this.quality = quality;
|
||||
this.proxy = c.getProxy();
|
||||
}
|
||||
public void run() {
|
||||
try {
|
||||
Logger.print("Starting stream livestreamer for "+this.streamName+" at "+this.quality+" quality");
|
||||
Runtime rt = Runtime.getRuntime();
|
||||
Process pr = rt.exec(this.c.getLSPath()+" twitch.tv/"+this.streamName+" "+this.quality);
|
||||
// TODO: all this needs clean up
|
||||
if (!this.proxy.equals("")) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(" --http-proxy ");
|
||||
sb.append(this.proxy);
|
||||
this.proxyParam = sb.toString();
|
||||
} else {
|
||||
this.proxyParam = "";
|
||||
}
|
||||
Process pr = rt.exec(this.c.getLSPath()+" twitch.tv/"+this.streamName+" "+this.quality+this.proxyParam);
|
||||
|
||||
BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user