I am trying to fetch a remote video file and save it through cURL
and PHP. The file opens fine on the remote site. It opens with HTML5 player if I directly open the file URL in browser. This happens in incognito mode too.
But when I try to fetch it via cURL
, the remote server returns
403 forbidden error
I checked the Firefox addon "Live HTTP Headers" and tracked each cookie the site is setting and I have tried sending those different cookies, user agents in HTTP headers. But no luck. I think it is not cookie issue because the file is opening directly in the browser in the incognito window. Any help would be appreciated.
Note: The file URL changes dynamically after a certain time.