mirror of
https://github.com/pierre-emmanuelJ/iptv-proxy.git
synced 2026-03-16 17:42:48 +01:00
Adding argument to set custom anti-collision ID (#146)
This commit is contained in:
@@ -84,6 +84,7 @@ var rootCmd = &cobra.Command{
|
|||||||
HTTPS: viper.GetBool("https"),
|
HTTPS: viper.GetBool("https"),
|
||||||
M3UFileName: viper.GetString("m3u-file-name"),
|
M3UFileName: viper.GetString("m3u-file-name"),
|
||||||
CustomEndpoint: viper.GetString("custom-endpoint"),
|
CustomEndpoint: viper.GetString("custom-endpoint"),
|
||||||
|
CustomId: viper.GetString("custom-id"),
|
||||||
XtreamGenerateApiGet: viper.GetBool("xtream-api-get"),
|
XtreamGenerateApiGet: viper.GetBool("xtream-api-get"),
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,6 +122,7 @@ func init() {
|
|||||||
rootCmd.Flags().StringP("m3u-url", "u", "", `Iptv m3u file or url e.g: "http://example.com/iptv.m3u"`)
|
rootCmd.Flags().StringP("m3u-url", "u", "", `Iptv m3u file or url e.g: "http://example.com/iptv.m3u"`)
|
||||||
rootCmd.Flags().StringP("m3u-file-name", "", "iptv.m3u", `Name of the new proxified m3u file e.g "http://poxy.com/iptv.m3u"`)
|
rootCmd.Flags().StringP("m3u-file-name", "", "iptv.m3u", `Name of the new proxified m3u file e.g "http://poxy.com/iptv.m3u"`)
|
||||||
rootCmd.Flags().StringP("custom-endpoint", "", "", `Custom endpoint "http://poxy.com/<custom-endpoint>/iptv.m3u"`)
|
rootCmd.Flags().StringP("custom-endpoint", "", "", `Custom endpoint "http://poxy.com/<custom-endpoint>/iptv.m3u"`)
|
||||||
|
rootCmd.Flags().StringP("custom-id", "", "", `Custom anti-collison ID for each track "http://proxy.com/<custom-id>/..."`)
|
||||||
rootCmd.Flags().Int("port", 8080, "Iptv-proxy listening port")
|
rootCmd.Flags().Int("port", 8080, "Iptv-proxy listening port")
|
||||||
rootCmd.Flags().Int("advertised-port", 0, "Port to expose the IPTV file and xtream (by default, it's taking value from port) useful to put behind a reverse proxy")
|
rootCmd.Flags().Int("advertised-port", 0, "Port to expose the IPTV file and xtream (by default, it's taking value from port) useful to put behind a reverse proxy")
|
||||||
rootCmd.Flags().String("hostname", "", "Hostname or IP to expose the IPTVs endpoints")
|
rootCmd.Flags().String("hostname", "", "Hostname or IP to expose the IPTVs endpoints")
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ type ProxyConfig struct {
|
|||||||
M3UCacheExpiration int
|
M3UCacheExpiration int
|
||||||
M3UFileName string
|
M3UFileName string
|
||||||
CustomEndpoint string
|
CustomEndpoint string
|
||||||
|
CustomId string
|
||||||
RemoteURL *url.URL
|
RemoteURL *url.URL
|
||||||
AdvertisedPort int
|
AdvertisedPort int
|
||||||
HTTPS bool
|
HTTPS bool
|
||||||
|
|||||||
@@ -64,6 +64,10 @@ func NewServer(config *config.ProxyConfig) (*Config, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if trimmedCustomId := strings.Trim(config.CustomId, "/"); trimmedCustomId != "" {
|
||||||
|
endpointAntiColision = trimmedCustomId
|
||||||
|
}
|
||||||
|
|
||||||
return &Config{
|
return &Config{
|
||||||
config,
|
config,
|
||||||
&p,
|
&p,
|
||||||
|
|||||||
Reference in New Issue
Block a user