Skip to content

Commit d21077a

Browse files
committed
修改为联通配置,测试
1 parent 8eb638d commit d21077a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/app/iptv/hwctc/authenticator.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ func (c *Client) authLoginHWCTC(ctx context.Context, referer string) (string, er
131131
for i := range matches {
132132
c.logger.Info("EncryptToken " + strconv.Itoa(i) + ": " + string(matches[i]))
133133
}
134-
if len(matches) != 1 {
134+
if len(matches) != 2 {
135135
return "", errors.New("failed to parse EncryptToken")
136136
}
137-
return string(matches[0]), nil
137+
return string(matches[1]), nil
138138
}
139139

140140
// validAuthenticationHWCTC 认证第三步,获取UserToken和cookie中的JSESSIONID
@@ -239,8 +239,8 @@ func (c *Client) validAuthenticationHWCTC(ctx context.Context, encryptToken stri
239239
regex := regexp.MustCompile("(?s)<input type=\"hidden\" name=\"UserToken\" value=\"(.*?)\".*<input type=\"hidden\" name=\"tempKey\" value=\"(.*?)\".*<input type=\"hidden\" name=\"stbid\" value=\"(.*?)\">")
240240
matches := regex.FindSubmatch(result)
241241
c.logger.Info(fmt.Sprintf("matches: %d", len(matches)))
242-
for match := range matches {
243-
c.logger.Info(string(matches[match]))
242+
for i := range matches {
243+
c.logger.Info("matches " + strconv.Itoa(i) + ": " + string(matches[i]))
244244
}
245245
if len(matches) != 3 {
246246
return nil, errors.New("failed to parse userToken")

0 commit comments

Comments
 (0)