0

I want to pull video url from some website

I write code and modified to select that i want like this

<?php
$ch = curl_init("  http://somewebsite.com/  ");
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$ret = curl_exec($ch);
$str_replace = str_replace("\\", "", $ret);
$link_url = substr($str_replace,66,99);
curl_close($ch);
?>

It can get link but when click that link. It's show error like this

Forbidden

You don't have permission to access

I think that website maybe block access

How can I fix it, Can I get video url from that web?

  • Forbidden probably means that your IP address is blocked on the server where the site is hosted. For obvious reasons probably. If that is the case, there is nothing you can do about it. Another possibility is that site blocks request without proper agent header (to stop the automated requests). You can read more about that here: http://stackoverflow.com/questions/1926876/can-a-curl-based-http-request-imitate-a-browser-based-request-completely – dkasipovic Mar 26 '14 at 09:19
  • @D.Kasipovic Do you have free time? I want to contact you a private, I will take you to see my code. Please see it and help me please, I really don't know how to fix it. – user3458660 Mar 26 '14 at 12:28
  • Not at the moment, but I will be glad to help when I have time. Where is this script running? On hosting? On your local computer? – dkasipovic Mar 26 '14 at 12:36
  • @D.Kasipovic When my script run on local computer it can get link and that link can open (not show error forbidden), But when I upload script to hosting it can get link too, but that link can't open and show error Forbidden like that – user3458660 Mar 26 '14 at 17:03
  • Then unfortunately, it is most likely that your hosting IP has been blocked by the site's administrator. There is nothing you can do about it. – dkasipovic Mar 26 '14 at 17:06
  • @D.Kasipovic Yes, I think same you that my hosting IP has been blocked, I want to know If I change hosting and upload this script again. It can be use? – user3458660 Mar 26 '14 at 17:17
  • It should be usable if you put it on some other server, but it can be blocked again. – dkasipovic Mar 26 '14 at 17:18
  • @D.Kasipovic Hello, When I change hosting it can't be use too, It have another way? – user3458660 Mar 26 '14 at 17:47

0 Answers0