3

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.

3
  • How are you downloading in the first place? Commented May 2, 2012 at 5:56
  • i am not downloading anything before. In first place using their api documentation i just broadcast the video. After that they provide a link of that particular video
    – Code Prank
    Commented May 2, 2012 at 6:03
  • I guess it may be a cross-domain issue.. You may need to use proxies in PHP
    – Jaya Mayu
    Commented May 2, 2012 at 6:06

2 Answers 2

5

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:"

2

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.

2
  • Not handy, no. But he internetz is riddled with cURL tutorials. This one in particular should be pretty helpful: phpsense.com/2007/php-curl-functions Commented May 2, 2012 at 6:13
  • yeah the link is really helpful and i achieved my goal... Thanx a lot :)
    – Code Prank
    Commented May 2, 2012 at 8:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.