Skip to content

Commit

Permalink
Merge pull request #422 from Darock-Studio/fix/banned-request
Browse files Browse the repository at this point in the history
fix: Some requests were banned
  • Loading branch information
Mark Chan authored Oct 19, 2024
2 parents 7e87a2b + 9374530 commit 622024e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 37 deletions.
Binary file removed .github/.DS_Store
Binary file not shown.
34 changes: 1 addition & 33 deletions Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -4732,35 +4732,6 @@
}
}
},
"Home.update.%@.%@" : {
"extractionState" : "stale",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "v%1$@ build %2$@ had released"
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
"value" : "v%1$@ ビルド %2$@がリリースされました"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "v%1$@ Build %2$@已推出"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "v%1$@ Build %2$@已經推出"
}
}
}
},
"Home.update.skip" : {
"localizations" : {
"en" : {
Expand Down Expand Up @@ -9731,7 +9702,7 @@
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "MeowBili\nBuild Beta. Build %[email protected]_verd.%2$@"
"value" : "MeowBili\nDebug Build. Build %[email protected]_verd.%2$@"
}
},
"zh-Hans" : {
Expand Down Expand Up @@ -10256,9 +10227,6 @@
}
}
}
},
"手记建议" : {

},
"扩展的触感反馈" : {
"localizations" : {
Expand Down
1 change: 1 addition & 0 deletions MeowBili/InMain/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ struct ContentView: View {
getBuvid(url: "https://api.bilibili.com/x/space/wbi/acc/info".urlEncoded()) { buvid3, buvid4, _uuid, _ in
let headers: HTTPHeaders = [
"cookie": "SESSDATA=\(sessdata); innersign=0; buvid3=\(buvid3); b_nut=1704873471; i-wanna-go-back=-1; b_ut=7; b_lsid=9910433CB_18CF260AB89; _uuid=\(_uuid); enable_web_push=DISABLE; header_theme_version=undefined; home_feed_column=4; browser_resolution=3440-1440; buvid4=\(buvid4);",
"referer": "https://message.bilibili.com/", // rdar://gh/SocialSisterYi/bilibili-API-collect/issues/631#issuecomment-2099276628
"User-Agent": "Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
]
biliWbiSign(paramEncoded: "mid=\(dedeUserID)".base64Encoded()) { signed in
Expand Down
5 changes: 3 additions & 2 deletions MeowBili/InMain/MainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ struct MainView: View {
.onAppear {
if username == "" {
let headers: HTTPHeaders = [
"cookie": "SESSDATA=\(sessdata); innersign=0; buvid3=\(globalBuvid3); b_nut=1704873471; i-wanna-go-back=-1; b_ut=7; b_lsid=9910433CB_18CF260AB89; enable_web_push=DISABLE; header_theme_version=undefined; home_feed_column=4; browser_resolution=3440-1440; buvid4=\(globalBuvid4); bili_ticket=\(cachedBiliTicket)",
"cookie": "SESSDATA=\(sessdata)",
"referer": "https://message.bilibili.com/", // rdar://gh/SocialSisterYi/bilibili-API-collect/issues/631#issuecomment-2099276628
"User-Agent": "Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
]
biliWbiSign(paramEncoded: "mid=\(dedeUserID)".base64Encoded()) { signed in
Expand Down Expand Up @@ -179,7 +180,7 @@ struct MainView: View {
Section {
if debug {
Button(action: {

tipWithText("Test")
}, label: {
Text("Home.debug")
})
Expand Down
5 changes: 3 additions & 2 deletions MeowBili/PersonalCenter/PersonAccountView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,16 @@ struct PersonAccountView: View {
}
}
.onAppear {
getAccountInfos()
getAccountInfo()
}
.sheet(isPresented: $isNetworkFixPresented, content: { NetworkFixView() })
}
func getAccountInfos() {
func getAccountInfo() {
if username == "" {
getBuvid(url: "https://api.bilibili.com/x/space/wbi/acc/info".urlEncoded()) { buvid3, buvid4, _uuid, _ in
let headers: HTTPHeaders = [
"cookie": "SESSDATA=\(sessdata); innersign=0; buvid3=\(buvid3); b_nut=1704873471; i-wanna-go-back=-1; b_ut=7; b_lsid=9910433CB_18CF260AB89; _uuid=\(_uuid); enable_web_push=DISABLE; header_theme_version=undefined; home_feed_column=4; browser_resolution=3440-1440; buvid4=\(buvid4);",
"referer": "https://message.bilibili.com/", // rdar://gh/SocialSisterYi/bilibili-API-collect/issues/631#issuecomment-2099276628
"User-Agent": "Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
]
biliWbiSign(paramEncoded: "mid=\(dedeUserID)".base64Encoded()) { signed in
Expand Down
1 change: 1 addition & 0 deletions MeowBili/PersonalCenter/UserDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ struct UserDetailView: View {
.onAppear {
let headers: HTTPHeaders = [
"cookie": "SESSDATA=\(sessdata); buvid3=\(globalBuvid3); bili_ticket=\(cachedBiliTicket)",
"referer": "https://message.bilibili.com/", // rdar://gh/SocialSisterYi/bilibili-API-collect/issues/631#issuecomment-2099276628
"User-Agent": "Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
]
biliWbiSign(paramEncoded: "mid=\(uid)".base64Encoded()) { signed in
Expand Down

0 comments on commit 622024e

Please sign in to comment.