Skip to content

Commit 5d32ff8

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

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

internal/app/iptv/hwctc/authenticator.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,19 +236,19 @@ func (c *Client) validAuthenticationHWCTC(ctx context.Context, encryptToken stri
236236
if err != nil {
237237
return nil, err
238238
}
239-
regex := regexp.MustCompile("(?s)<input type=\"hidden\" name=\"UserToken\" value=\"(.*?)\".*<input type=\"hidden\" name=\"tempKey\" value=\"(.*?)\".*<input type=\"hidden\" name=\"stbid\" value=\"(.*?)\">")
239+
regex := regexp.MustCompile("\"UserToken\" value=\"(.+?)\"")
240240
matches := regex.FindSubmatch(result)
241241
c.logger.Info(fmt.Sprintf("matches: %d", len(matches)))
242242
for i := range matches {
243243
c.logger.Info("matches " + strconv.Itoa(i) + ": " + string(matches[i]))
244244
}
245-
if len(matches) != 3 {
245+
if len(matches) != 2 {
246246
return nil, errors.New("failed to parse userToken")
247247
}
248248
return &Token{
249-
UserToken: string(matches[0]),
250-
TempKey: string(matches[1]),
251-
Stbid: string(matches[2]),
249+
UserToken: string(matches[1]),
250+
TempKey: "",
251+
Stbid: "370007",
252252
JSESSIONID: jsessionID,
253253
}, nil
254254
}

0 commit comments

Comments
 (0)