-5

There's a lots of websites out there, sharing grabber scripts. I meant just install a script and you can have someones whole data. My personal site is based on Youtube API3 and our developer designed it to download videos from youtube.

But, the problem is, If someone wrote another script to stole my data, I mean grab my site's content with php curl or something, how can I stop him?

I can detect and block a single IP, but that's not the best solution. Please help me with some code's what we can put directly into our .htaccess file or somewhere to stop grabbing our content.

  • CURL, Firefox, IE.. all are clients, which are designed to grab content, which you are providing.. some of them to store, some of them to display. Blocking access it's against the basics of serving content. Only possibility here is to handle such request outside the web server, by some soft, which will detect suspicious activity. I mean on lower, thank web application (server) level. – Ivan May 31 '16 at 23:11
  • 1
    But *your* data is actually Youtube's data, since you're using their API to populate your site with their videos. – mferly May 31 '16 at 23:15
  • Marcus, the fact is they are serving from my side, including html, styles, other images everything. Killing my bandwidth and also a big reason for high cpu usage. – Shimul SHahriar May 31 '16 at 23:19

1 Answers1

1

as mentioned here you can check if user use curl then deny access for this user

if(stripos($_SERVER['HTTP_USER_AGENT'],'curl') !== false) {
    http_response_code(403); //FORBIDDEN
    exit;
}
Community
  • 1
  • 1
Ahmed farag mostafa
  • 2,802
  • 2
  • 14
  • 33