Skip to content

Commit

Permalink
自动保存channel.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankHan1233 committed Jan 31, 2025
1 parent 61a98ae commit a3e1e51
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 297 deletions.
2 changes: 1 addition & 1 deletion cmd/iptv/cmds/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type HttpConfig struct {
func NewServeCLI() *cobra.Command {
serveCmd := &cobra.Command{
Use: "serve",
Short: "启动HTTP服务,提供直播源、EPG等查询接口。",
Short: "启动HTTP服务,提供直播源等查询接口。",
RunE: func(cmd *cobra.Command, args []string) error {
// 读取直播配置
if httpConfig.LiveFile != "" {
Expand Down
7 changes: 1 addition & 6 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,4 @@ hwctc:
userField:
softwareVersion:
isSmartStb:
vip:

# 获取EPG信息的API
# 目前支持3种:"liveplay_30","gdhdpublic"或"vsp"
# 未设置时,将自动进行尝试。
channelProgramAPI:
vip:
3 changes: 1 addition & 2 deletions internal/app/iptv/hwctc/hwctc_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import (
type Config struct {
InterfaceName string `json:"interfaceName" yaml:"interfaceName"` // 网络接口的名称。若配置则生成Authenticator时,优先使用该接口对应的IPv4地址,而不使用`ip`字段的值。
// 以下信息均可通过抓包获取
IP string `json:"ip" yaml:"ip"` // 生成Authenticator所需的IP地址。可随便一个地址,或者通过配置`interfaceName`动态获取
ChannelProgramAPI string `json:"channelProgramAPI,omitempty" yaml:"channelProgramAPI,omitempty"` // 请求频道节目信息(EPG)的API接口,目前只支持两种:liveplay_30或者gdhdpublic。
IP string `json:"ip" yaml:"ip"` // 生成Authenticator所需的IP地址。可随便一个地址,或者通过配置`interfaceName`动态获取
// 以下信息均可通过抓包请求ValidAuthenticationHWCTC.jsp的参数拿到
UserID string `json:"userID" yaml:"userID"`
Lang string `json:"lang,omitempty" yaml:"lang,omitempty"` // 如果没有可以不填
Expand Down
1 change: 0 additions & 1 deletion internal/app/router/config_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ type Live struct {
Name string `json:"name"` // 配置名称
Boot bool `json:"boot"` // 是否自启动
Url string `json:"url"` // 直播源地址
Epg string `json:"epg,omitempty"` // 节目地址
Logo string `json:"logo,omitempty"` // 台标地址
Pass bool `json:"pass,omitempty"` // 是否免密码
Ua string `json:"ua,omitempty"` // 用户代理
Expand Down
277 changes: 0 additions & 277 deletions internal/app/router/epg_controller.go

This file was deleted.

5 changes: 0 additions & 5 deletions internal/app/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@ func initData(ctx context.Context, iptvClient iptv.Client) error {
if err := updateChannelsWithRetry(ctx, iptvClient, 3); err != nil {
return err
}

// 更新节目单
if err := updateEPG(ctx, iptvClient); err != nil {
return err
}
return nil
}

Expand Down
5 changes: 0 additions & 5 deletions internal/app/router/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ func Schedule(ctx context.Context, iptvClient iptv.Client, duration time.Duratio
logger.Error("Failed to update channel list.", zap.Error(err))
}

// 更新节目单数据
if err := updateEPG(ctx, iptvClient); err != nil {
logger.Error("Failed to update EPG.", zap.Error(err))
}

logger.Info("The scheduling task has been completed.")
}
}
Expand Down

0 comments on commit a3e1e51

Please sign in to comment.