vimeocaption.php 959 B

123456789101112131415161718192021222324
  1. <?php
  2. function curlGet($url) {
  3. if(in_array('curl', get_loaded_extensions())){
  4. $appSettings = parse_ini_file('../config/config.ini',true);
  5. $ch = curl_init($url);
  6. curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0');
  7. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  8. curl_setopt($ch, CURLOPT_HEADER, 0);
  9. //curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
  10. if($appSettings["Proxy"]["type"]) {
  11. curl_setopt($ch, CURLOPT_PROXY, $appSettings["Proxy"]["type"]."://".$appSettings["Proxy"]["domain"].":".$appSettings["Proxy"]["port"]);
  12. curl_setopt($ch, CURLOPT_PROXYUSERPWD, $appSettings["Proxy"]["username"].":".$appSettings["Proxy"]["password"]);
  13. }
  14. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  15. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  16. $result = curl_exec($ch);
  17. curl_close($ch);
  18. return $result;
  19. }
  20. return FALSE;
  21. }
  22. echo str_replace("<i>","",str_replace("</i>","",curlGet("http://vimeo.com".$_GET["url"])));
  23. ?>