User-Agent for FFmpeg and VLC
This commit is contained in:
@@ -366,7 +366,7 @@
|
|||||||
},
|
},
|
||||||
"userAgent": {
|
"userAgent": {
|
||||||
"title": "User Agent",
|
"title": "User Agent",
|
||||||
"description": "User Agent for HTTP requests. Only used if xTeVe is selected as the buffer.",
|
"description": "User Agent for HTTP requests. For every HTTP connection, this value is used for the user agent. Should only be changed if xTeVe is blocked.",
|
||||||
"placeholder": "xTeVe"
|
"placeholder": "xTeVe"
|
||||||
},
|
},
|
||||||
"backupPath": {
|
"backupPath": {
|
||||||
|
|||||||
@@ -1418,8 +1418,38 @@ func thirdPartyBuffer(streamID int, playlistID string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var args = strings.Replace(options, "[URL]", url, -1)
|
//args = strings.Replace(args, "[USER-AGENT]", Settings.UserAgent, -1)
|
||||||
var cmd = exec.Command(path, strings.Split(args, " ")...)
|
|
||||||
|
// User-Agent setzen
|
||||||
|
var args []string
|
||||||
|
|
||||||
|
for i, a := range strings.Split(options, " ") {
|
||||||
|
|
||||||
|
fmt.Println(a)
|
||||||
|
switch bufferType {
|
||||||
|
case "FFMPEG":
|
||||||
|
a = strings.Replace(a, "[URL]", url, -1)
|
||||||
|
if i == 0 {
|
||||||
|
args = []string{"-user-agent", Settings.UserAgent}
|
||||||
|
}
|
||||||
|
|
||||||
|
args = append(args, a)
|
||||||
|
|
||||||
|
case "VLC":
|
||||||
|
if a == "[URL]" {
|
||||||
|
a = strings.Replace(a, "[URL]", url, -1)
|
||||||
|
args = append(args, a)
|
||||||
|
args = append(args, fmt.Sprintf(":http-user-agent=%s", Settings.UserAgent))
|
||||||
|
|
||||||
|
} else {
|
||||||
|
args = append(args, a)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var cmd = exec.Command(path, args...)
|
||||||
|
|
||||||
debug = fmt.Sprintf("%s:%s %s", bufferType, path, args)
|
debug = fmt.Sprintf("%s:%s %s", bufferType, path, args)
|
||||||
showDebug(debug, 1)
|
showDebug(debug, 1)
|
||||||
|
|||||||
74
src/webUI.go
74
src/webUI.go
File diff suppressed because one or more lines are too long
2
xteve.go
2
xteve.go
@@ -48,7 +48,7 @@ const DBVersion = "2.1.0"
|
|||||||
const APIVersion = "1.1.0"
|
const APIVersion = "1.1.0"
|
||||||
|
|
||||||
// Dev : Aktiviert den Entwicklungsmodus. Für den Webserver werden dann die lokalen Dateien verwendet.
|
// Dev : Aktiviert den Entwicklungsmodus. Für den Webserver werden dann die lokalen Dateien verwendet.
|
||||||
const Dev = false
|
const Dev = true
|
||||||
|
|
||||||
var homeDirectory = fmt.Sprintf("%s%s.%s%s", src.GetUserHomeDirectory(), string(os.PathSeparator), strings.ToLower(Name), string(os.PathSeparator))
|
var homeDirectory = fmt.Sprintf("%s%s.%s%s", src.GetUserHomeDirectory(), string(os.PathSeparator), strings.ToLower(Name), string(os.PathSeparator))
|
||||||
var samplePath = fmt.Sprintf("%spath%sto%sxteve%s", string(os.PathSeparator), string(os.PathSeparator), string(os.PathSeparator), string(os.PathSeparator))
|
var samplePath = fmt.Sprintf("%spath%sto%sxteve%s", string(os.PathSeparator), string(os.PathSeparator), string(os.PathSeparator), string(os.PathSeparator))
|
||||||
|
|||||||
Reference in New Issue
Block a user