Skip to content

Commit

Permalink
fix: 请问如何搜索非大陆地区番剧? #41
Browse files Browse the repository at this point in the history
  • Loading branch information
msojocs committed Aug 31, 2022
1 parent c6e7d72 commit e4aa4cd
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion extensions/area_unlimit/hook/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,24 @@ class BiliBiliApi {
return Promise.resolve(access_key)
})
}

// searchBangumi(params, area) {
// return new Promise(async (resolve, reject)=>{
// let path = "x/web-interface/search/type"
// sessionStorage.access_key = sessionStorage.access_key || await this.getAccessToken()
// if(area === "th")path = "intl/gateway/v2/app/search/type"
// const url = `https://${this.server}/${path}?${params}&area=${area}&access_key=${sessionStorage.access_key}${area === "th"?'&type=7':''}`
// return HTTP.get(url).then(res => {
// const resp = JSON.parse(res.responseText)
// console.log("searchBangumi: ", resp)
// if(area === "th")
// resolve(UTILS.handleTHSearchResult(resp.data.items || []))
// else
// resolve(resp.data?.result || [])
// })
// })
// }

searchBangumi(params, area) {
let path = "x/web-interface/search/type"
if(area === "th")path = "intl/gateway/v2/app/search/type"
Expand All @@ -112,7 +130,7 @@ class BiliBiliApi {
if(area === "th")
return Promise.resolve(UTILS.handleTHSearchResult(resp.data.items || []))
else
return Promise.resolve(resp.data.result || [])
return Promise.resolve(resp.data?.result || [])
})
}
}
Expand Down

0 comments on commit e4aa4cd

Please sign in to comment.