From db06f2f10e3eb3c9c46191b5131145b294862cee Mon Sep 17 00:00:00 2001 From: YangXu <2945065490@qq.com> Date: Sat, 23 Nov 2024 22:25:08 +0800 Subject: [PATCH] fix(123&123share): update version --- drivers/123/driver.go | 8 +++++++- drivers/123/meta.go | 2 +- drivers/123/util.go | 8 ++++---- drivers/123_share/driver.go | 8 +++++++- drivers/123_share/meta.go | 2 +- drivers/123_share/util.go | 8 ++++---- 6 files changed, 24 insertions(+), 12 deletions(-) diff --git a/drivers/123/driver.go b/drivers/123/driver.go index 7bfe14421c4d..c88d72e13e0c 100644 --- a/drivers/123/driver.go +++ b/drivers/123/driver.go @@ -6,10 +6,12 @@ import ( "encoding/base64" "encoding/hex" "fmt" + "github.com/google/uuid" "golang.org/x/time/rate" "io" "net/http" "net/url" + "strings" "sync" "time" @@ -56,10 +58,14 @@ func (d *Pan123) Init(ctx context.Context) error { d.params.AppVersion = TVAndroidAppVer } + if d.Addition.LoginUuid == "" { + d.Addition.LoginUuid = strings.ReplaceAll(uuid.New().String(), "-", "") + } + d.params.OsVersion = d.OsVersion - d.params.LoginUuid = d.LoginUuid d.params.DeviceName = d.DeviceName d.params.DeviceType = d.DeiveType + d.params.LoginUuid = d.Addition.LoginUuid _, err := d.request(UserInfo, http.MethodGet, nil, nil) return err diff --git a/drivers/123/meta.go b/drivers/123/meta.go index 4694f5857764..c6ef8affc682 100644 --- a/drivers/123/meta.go +++ b/drivers/123/meta.go @@ -18,7 +18,7 @@ type Addition struct { DeviceName string `json:"devicename" default:"Xiaomi"` DeiveType string `json:"devicetype" default:"M1810E5A"` OsVersion string `json:"osversion" default:"Android_8.1.0"` - LoginUuid string `json:"loginuuid" default:"66a4c82756134af2a57d323fd7a5e58c"` + LoginUuid string `json:"loginuuid" default:""` } var config = driver.Config{ diff --git a/drivers/123/util.go b/drivers/123/util.go index 13c3c7de0c37..a500df78ff6c 100644 --- a/drivers/123/util.go +++ b/drivers/123/util.go @@ -53,11 +53,11 @@ const ( ) const ( - AndroidUserAgentPrefix = "123pan/v2.4.7" // 123pan/v2.4.7(Android_14;XiaoMi) + AndroidUserAgentPrefix = "123pan/v2.4.8" // 123pan/v2.4.8(Android_14;XiaoMi) AndroidPlatformParam = "android" - AndroidAppVer = "69" - AndroidXAppVer = "2.4.7" - AndroidXChannel = "1002" + AndroidAppVer = "70" + AndroidXAppVer = "2.4.8" + AndroidXChannel = "1001" TVUserAgentPrefix = "123pan_android_tv/1.0.0" // 123pan_android_tv/1.0.0(14;samsung SM-X800) TVPlatformParam = "android_tv" TVAndroidAppVer = "100" diff --git a/drivers/123_share/driver.go b/drivers/123_share/driver.go index 7f8b2541fca4..03b4999cbaed 100644 --- a/drivers/123_share/driver.go +++ b/drivers/123_share/driver.go @@ -4,9 +4,11 @@ import ( "context" "encoding/base64" "fmt" + "github.com/google/uuid" "golang.org/x/time/rate" "net/http" "net/url" + "strings" "sync" "time" @@ -50,10 +52,14 @@ func (d *Pan123Share) Init(ctx context.Context) error { d.params.AppVersion = TVAndroidAppVer } + if d.Addition.LoginUuid == "" { + d.Addition.LoginUuid = strings.ReplaceAll(uuid.New().String(), "-", "") + } + d.params.OsVersion = d.OsVersion - d.params.LoginUuid = d.LoginUuid d.params.DeviceName = d.DeviceName d.params.DeviceType = d.DeiveType + d.params.LoginUuid = d.LoginUuid _, err := d.request(UserInfo, http.MethodGet, nil, nil) return err diff --git a/drivers/123_share/meta.go b/drivers/123_share/meta.go index 7da542395ddd..874658edb310 100644 --- a/drivers/123_share/meta.go +++ b/drivers/123_share/meta.go @@ -20,7 +20,7 @@ type Addition struct { DeviceName string `json:"devicename" default:"Xiaomi"` DeiveType string `json:"devicetype" default:"M1810E5A"` OsVersion string `json:"osversion" default:"Android_8.1.0"` - LoginUuid string `json:"loginuuid" default:"66a4c82756134af2a57d323fd7a5e58c"` + LoginUuid string `json:"loginuuid" default:""` } var config = driver.Config{ diff --git a/drivers/123_share/util.go b/drivers/123_share/util.go index 87a6a89d8460..aa835f3d159a 100644 --- a/drivers/123_share/util.go +++ b/drivers/123_share/util.go @@ -39,11 +39,11 @@ const ( ) const ( - AndroidUserAgentPrefix = "123pan/v2.4.7" // 123pan/v2.4.7(Android_14;XiaoMi) + AndroidUserAgentPrefix = "123pan/v2.4.8" // 123pan/v2.4.8(Android_14;XiaoMi) AndroidPlatformParam = "android" - AndroidAppVer = "69" - AndroidXAppVer = "2.4.7" - AndroidXChannel = "1002" + AndroidAppVer = "70" + AndroidXAppVer = "2.4.8" + AndroidXChannel = "1001" TVUserAgentPrefix = "123pan_android_tv/1.0.0" // 123pan_android_tv/1.0.0(14;samsung SM-X800) TVPlatformParam = "android_tv" TVAndroidAppVer = "100"