fix vk headless parser
This commit is contained in:
1 parent
265da4579c
commit
77d4ffe098
2 files changed
+2
-2
No files matched your search
@@ -43,7 +43,7 @@ func fetchConfig() (VKConfig, error) {
|
|||||||
chunksBase := bundleURL[:strings.LastIndex(bundleURL, "core_spa_vk.")] + "chunks/"
|
chunksBase := bundleURL[:strings.LastIndex(bundleURL, "core_spa_vk.")] + "chunks/"
|
||||||
|
|
||||||
// Extract app_id and API version from the main bundle
|
// Extract app_id and API version from the main bundle
|
||||||
if m := regexp.MustCompile(`[,;]u=(\d{7,8}),_=\d{7,8},p=\d{8,9}`).FindStringSubmatch(bundleStr); m != nil {
|
if m := regexp.MustCompile(`[,;]u=(\d{7,8}),[a-z]=\d{7,9}`).FindStringSubmatch(bundleStr); m != nil {
|
||||||
cfg.AppID = m[1]
|
cfg.AppID = m[1]
|
||||||
} else {
|
} else {
|
||||||
return cfg, fmt.Errorf("app_id not found in bundle")
|
return cfg, fmt.Errorf("app_id not found in bundle")
|
||||||
|
|||||||
@@ -333,7 +333,7 @@ func fetchVKConfig(httpGet func(string) ([]byte, error), logFn func(string, ...a
|
|||||||
chunksBase := bundleURL[:strings.LastIndex(bundleURL, "core_spa_vk.")] + "chunks/"
|
chunksBase := bundleURL[:strings.LastIndex(bundleURL, "core_spa_vk.")] + "chunks/"
|
||||||
|
|
||||||
cfg := &vkConfig{}
|
cfg := &vkConfig{}
|
||||||
if m := regexp.MustCompile(`[,;]u=(\d{7,8}),_=\d{7,8},p=\d{8,9}`).FindStringSubmatch(bundleStr); m != nil {
|
if m := regexp.MustCompile(`[,;]u=(\d{7,8}),[a-z]=\d{7,9}`).FindStringSubmatch(bundleStr); m != nil {
|
||||||
cfg.AppID = m[1]
|
cfg.AppID = m[1]
|
||||||
} else {
|
} else {
|
||||||
return nil, fmt.Errorf("appID not found")
|
return nil, fmt.Errorf("appID not found")
|
||||||
|
|||||||
Reference in new issue
Block a user