Status
Not open for further replies.

warezrock

Active Member
704
2009
23
0
I need the HTTP header of this link
Code:
http://www.dailymotion.com/cdn/H264-320x240/video/xucehg.mp4?auth=1350479679.4161f93bd3590e4816bddb233bd025df

Here is the code i used..
PHP:
function curlheaders($link)
{
	$ch = curl_init($link);
	curl_setopt($ch, CURLOPT_HEADER, 1);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_NOBODY, 1);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
	curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4');
	$headers = array(
		'Connection: keep-alive', 
		'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
		'Accept-Encoding: gzip,deflate,sdch',
		'Accept-Language: en-US,en;q=0.8',
		'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3'
	);
	curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
	$page = curl_exec($ch);
	return($page);
	curl_close($ch);
}

echo curlheaders('http://www.dailymotion.com/cdn/H264-320x240/video/xucehg.mp4?auth=1350479679.4161f93bd3590e4816bddb233bd025df');

When i run the above code it give me a 403 forbidden response from dailmotion.. Any Idea ?
 
Last edited:
10 comments
^
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($your_resource, CURLOPT_HTTPHEADER, $headers);

These variables are not defined, it should be $ch

As for forbidden, the response headers are same when viewed through browser. Check the url / you probably need to send some cookies / login before
 
^
Sorry, code updated.Still doesn't work.

Ok, looking the site for cookies but i think its not needed to access that page because it return a 302 redirect .
 
Check the link properly, it has "auth=1350479679.4161f93bd3590e4816bddb233bd025df"

That means the link also checks for your session. In this case, it just shows me a blank page if I try to visit that link via Firefox.
 
[slide]http://rapidimg.org/server/files/507c7bddb4aabrZibIA.png[/slide]
Forbidden here

By chrome, same:
[slide]http://www.rapidimg.org/server/files/507c7cbec20b7wzhEV2.png[/slide]
 
Check the link properly, it has "auth=1350479679.4161f93bd3590e4816bddb233bd025df"

That means the link also checks for your session. In this case, it just shows me a blank page if I try to visit that link via Firefox.

Yeah, But it's loading fine in chrome

---------- Post added at 09:15 PM ---------- Previous post was at 09:12 PM ----------

[slide]http://rapidimg.org/server/files/507c7bddb4aabrZibIA.png[/slide]
Forbidden here

ops it seem that it need some divix code to load in browser :facepalm:

---------- Post added at 09:32 PM ---------- Previous post was at 09:15 PM ----------

[slide]http://rapidimg.org/server/files/507c7bddb4aabrZibIA.png[/slide]
Forbidden here

By chrome, same:
[slide]http://www.rapidimg.org/server/files/507c7cbec20b7wzhEV2.png[/slide]

In chrome i am getting this

[SLIDE]http://i.imgur.com/2fqmF.png[/SLIDE]
 
Coz you've not closed the browser + cleared your cookies.

Also, in the response there's a link re-director "Location" which gives you the new link that you need to curl to.
 
Coz you've not closed the browser + cleared your cookies.

Also, in the response there's a link re-director "Location" which gives you the new link that you need to curl to.

Maybe.

Yes i need that link that is in "Location"

---------- Post added at 10:47 PM ---------- Previous post was at 09:45 PM ----------

Problem solved, it was a cookie issue.
Thanks Halcyon


mod please closed this topic.
 
Status
Not open for further replies.
Back
Top