Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send request without user-agent header

I have a project of video broadcasting in which I need to provide the downloading option. I have used Justin.tv api they send a URL to download the video file when i hit that URL I got 403 forbidden error. I have discussed this problem with their concerned person he replied:

Browsers will get the 403 error, you need to either proxy the file through your server (by removing the User-Agent header) or tell users to use a download manager.

Definitely the latter one is not good idea. Now I am stuck with sending request without user agent headers. How can I do this (using PHP)? I have Googled it but did not find anything helpful.

like image 385
Code Prank Avatar asked Jun 23 '26 08:06

Code Prank


2 Answers

Necromancing this old thread, I dunno if the info in the comment by @ayman-safadi was accurate at the time it was posted. That was a quote from some other location. But now,to remove the user agent header you do this:

-H "User-Agent:"

like image 100
TonyG Avatar answered Jun 24 '26 22:06

TonyG


Maybe you can have the "download" link point to an internal page that will make a cURL call to the actual Justin.tv link.

According to one of the comments:

FYI... unless you specifically set the user agent, no user agent will be sent in your request as there is no default value like some of the other options.

There are a lot more comments that might help.

like image 24
Ayman Safadi Avatar answered Jun 24 '26 22:06

Ayman Safadi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!