Skip to content

Commit

Permalink
fix: download video need Referrer, close #50
Browse files Browse the repository at this point in the history
  • Loading branch information
cssxsh committed Sep 11, 2023
1 parent 0d50423 commit 3e4a1bb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main/kotlin/xyz/cssxsh/weibo/Load.kt
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ public suspend fun WeiboClient.download(
val limit = (offset + video.buffer).coerceAtMost(video.size) - 1
emit(useHttpClient { client ->
client.prepareGet(video.url) {
header(HttpHeaders.Referrer, INDEX_PAGE)
header(HttpHeaders.Range, "bytes=${offset}-${limit}")
}.body()
})
Expand Down

0 comments on commit 3e4a1bb

Please sign in to comment.