Skip to content

Commit 6a014f2

Browse files
committed
自动保存channel.txt
1 parent 7febdbf commit 6a014f2

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

internal/app/iptv/hwctc/authenticator.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,15 +248,10 @@ func (c *Client) validAuthenticationHWCTC(ctx context.Context, encryptToken stri
248248
if err != nil {
249249
return nil, err
250250
}
251-
c.logger.Info(string(result))
252251

253252
// 匹配UserToken
254253
regex := regexp.MustCompile(`"UserToken" value="(.+?)"`)
255254
matches := regex.FindSubmatch(result)
256-
c.logger.Info(fmt.Sprintf("matches: %d", len(matches)))
257-
for i := range matches {
258-
c.logger.Info("matches " + strconv.Itoa(i) + ": " + string(matches[i]))
259-
}
260255
if len(matches) != 2 {
261256
return nil, errors.New("failed to parse userToken")
262257
}

internal/app/iptv/hwctc/channel.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ func (c *Client) GetAllChannelList(ctx context.Context) ([]iptv.Channel, error)
7878
if err != nil {
7979
return nil, err
8080
}
81-
chRegex := regexp.MustCompile("ChannelID=\"(.+?)\",ChannelName=\"(.+?)\",UserChannelID=\"(.+?)\",ChannelURL=\"(.+?)\",TimeShift=\"(.+?)\",TimeShiftLength=\"(\\d+?)\".+?,ChannelSDP=\"(.+?)\",TimeShiftURL=\"(.+?)\"")
81+
chRegex := regexp.MustCompile("ChannelID=\"(.+?)\",ChannelName=\"(.+?)\",UserChannelID=\"(.+?)\",ChannelURL=\"(.+?)\",TimeShift=\"(.+?)\",TimeShiftLength=\"(\\d+?)\".+?,TimeShiftURL=\"(.+?)\"")
8282
matchesList := chRegex.FindAllSubmatch(result, -1)
83+
c.logger.Info("matchesList cnt: " + strconv.Itoa(len(matchesList)))
8384
if matchesList == nil {
8485
return nil, fmt.Errorf("failed to extract channel list")
8586
}

0 commit comments

Comments
 (0)