Add Request Headers (User-Agent, Referer, Origin) to Prevent 403 Errors on Some Web Servers #165
+15
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I know that a similar PR was submitted before (#163) and was closed, but can this be reconsidered?
Some web servers enforce strict header policies to protect their content. In our case, using the default Apache HttpClient headers resulted in errors, as evidenced by the following log entry:
xxx.xxx.xx.xx - - [04/Mar/2025:03:40:44 +0700] "GET /source.mp3 HTTP/1.1" 403 3444 "-" "Apache-HttpClient/4.5.14 (Java/17.0.14)"
This indicates that the default headers are insufficient, leading to HTTP 403 errors when accessing audio content.
Changes: