Skip to content

Commit

Permalink
森空岛请求支持使用代理
Browse files Browse the repository at this point in the history
  • Loading branch information
IJNKAWAKAZE committed Aug 13, 2024
1 parent d23d72a commit eb7ab4a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
5 changes: 4 additions & 1 deletion arknights.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,7 @@ headhunt:
recruit:
missing:
jp: 酸糖/芳汀/燧石/四月/森蚺/史尔特尔
tags: 高级资深干员-高资/资深干员-资深/新手-新手/近卫干员-近卫干员/近卫千员-近卫干员/狙击干员-狙击干员/狙击千员-狙击干员/重装干员-重装干员/重装千员-重装干员/医疗干员-医疗干员/医疗千员-医疗干员/辅助干员-辅助干员/辅助千员-辅助干员/术师干员-术师干员/术师千员-术师干员/特种干员-特种干员/特种千员-特种干员/先锋干员-先锋干员/先锋千员-先锋干员/近战位-近战位/远程位-远程位/支援机械-机械/控场-控场/爆发-爆发/治疗-治疗/支援-支援/费用回复-费用回复/發用回复-费用回复/输出-输出/生存-生存/群攻-群攻/防护-防护/减速-减速/削弱-削弱/快速复活-快速复活/位移-位移/召唤-召唤/元素-元素/上級エリート-高资/上級工リート-高资/エリート-资深/工リート-资深/初期-新手/前衛タイプ-近卫干员/狙撃タイプ-狙击干员/重装タイプ-重装干员/医療タイプ-医疗干员/補助タイプ-辅助干员/術師タイプ-术师干员/特殊タイプ-特种干员/先鋒タイプ-先锋干员/近距離-近战位/遠距離-远程位/远程位-机械/ロポット-机械/牽制-控场/爆発力-爆发/治療-治疗/COST回復-费用回复/火力-输出/範囲攻撃-群攻/防御-防护/減速-减速/弱化-削弱/高速再配置-快速复活/強制移動-位移/召喚-召唤
tags: 高级资深干员-高资/资深干员-资深/新手-新手/近卫干员-近卫干员/近卫千员-近卫干员/狙击干员-狙击干员/狙击千员-狙击干员/重装干员-重装干员/重装千员-重装干员/医疗干员-医疗干员/医疗千员-医疗干员/辅助干员-辅助干员/辅助千员-辅助干员/术师干员-术师干员/术师千员-术师干员/特种干员-特种干员/特种千员-特种干员/先锋干员-先锋干员/先锋千员-先锋干员/近战位-近战位/远程位-远程位/支援机械-机械/控场-控场/爆发-爆发/治疗-治疗/支援-支援/费用回复-费用回复/發用回复-费用回复/输出-输出/生存-生存/群攻-群攻/防护-防护/减速-减速/削弱-削弱/快速复活-快速复活/位移-位移/召唤-召唤/元素-元素/上級エリート-高资/上級工リート-高资/エリート-资深/工リート-资深/初期-新手/前衛タイプ-近卫干员/狙撃タイプ-狙击干员/重装タイプ-重装干员/医療タイプ-医疗干员/補助タイプ-辅助干员/術師タイプ-术师干员/特殊タイプ-特种干员/先鋒タイプ-先锋干员/近距離-近战位/遠距離-远程位/ロポット-机械/牽制-控场/爆発力-爆发/治療-治疗/COST回復-费用回复/火力-输出/範囲攻撃-群攻/防御-防护/減速-减速/弱化-削弱/高速再配置-快速复活/強制移動-位移/召喚-召唤

# 森空岛请求代理 不填就不使用代理
proxy: http://localhost:1234
4 changes: 2 additions & 2 deletions src/plugins/skland/generate_sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
)

func addSign(r *resty.Request, method, path string, skland AccountSkland) {
ts := strconv.FormatInt(time.Now().Unix(), 10)
ts := strconv.FormatInt(time.Now().Unix()-7, 10)

headers := signHeaders{Platform: "1", Timestamp: ts, DId: "743a446c83032899", VName: "1.5.1"}
headers := signHeaders{Platform: "1", Timestamp: ts, DId: "743a446c83032899", VName: "1.21.0"}

r.SetHeaders(tom(headers))

Expand Down
8 changes: 7 additions & 1 deletion src/plugins/skland/skland_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package skland

import (
"fmt"
"github.com/spf13/viper"
"github.com/starudream/go-lib/resty/v2"
)

Expand All @@ -22,7 +23,12 @@ func (t *SKBaseResp[T]) String() string {
}

func SKR() *resty.Request {
return resty.R().SetHeader("User-Agent", "Skland/1.5.1 (com.hypergryph.skland; build:100501001; Android 33; ) Okhttp/4.11.0").SetHeader("Accept-Encoding", "gzip")
r := resty.New()
proxy := viper.GetString("proxy")
if proxy != "" {
r.SetProxy(proxy)
}
return r.R().SetHeader("User-Agent", "Skland/1.21.0 (com.hypergryph.skland; build:102100065; iOS 17.6.0; ) Alamofire/5.7.1").SetHeader("Accept-Encoding", "gzip").SetHeader("Connection", "close").SetHeader("Content-Type", "application/json")
}

func SklandRequest[T any](r *resty.Request, method, path string, vs ...any) (t T, _ error) {
Expand Down

0 comments on commit eb7ab4a

Please sign in to comment.