PHP / Skip adf.ly, sh.st and more... https://redirect.hakase.app/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_function.php 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /**
  3. * Redirect Bypass Function PHP
  4. * any.gs and sh.st source by https://github.com/starbuck93/handy-link-skipper/blob/master/index.php
  5. * adf.ly source by http://skizzerz.net/scripts/adfly.php
  6. * Other source by Hakase ( contact@hakase.kr / https://hakase.kr/ )
  7. */
  8. class Redirect {
  9. private $httph = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36';
  10. public function splits($data, $first, $end, $num = 1)
  11. {
  12. $temp = explode($first, $data);
  13. $temp = explode($end, $temp[$num]);
  14. $temp = $temp[0];
  15. return $temp;
  16. }
  17. public function WEBParsing($url, $cookie = NULL, $postparam = NULL, $otherheader = NULL)
  18. {
  19. $uri = parse_url($url);
  20. if (!isset($uri['port'])) $uri['port'] = 80;
  21. if (!isset($uri['path'])) $uri['path'] = "/";
  22. $ch = curl_init();
  23. $opts = array(CURLOPT_RETURNTRANSFER => true,
  24. CURLOPT_URL => $url,
  25. CURLOPT_TIMEOUT => 10,
  26. CURLOPT_CONNECTTIMEOUT => 5,
  27. CURLOPT_SSL_VERIFYPEER => FALSE,
  28. CURLOPT_HEADER => 1,
  29. );
  30. curl_setopt_array($ch, $opts);
  31. if ($uri['host'] != 'sh.st') curl_setopt($ch, CURLOPT_USERAGENT, $this->httph);
  32. if ($otherheader) curl_setopt($ch, CURLOPT_HTTPHEADER, $otherheader);
  33. if ($cookie) curl_setopt($ch, CURLOPT_COOKIE, $cookie);
  34. if ($postparam)
  35. {
  36. curl_setopt($ch, CURLOPT_POST, 1);
  37. curl_setopt($ch, CURLOPT_POSTFIELDS, $postparam);
  38. }
  39. $data = curl_exec($ch);
  40. curl_close($ch);
  41. return ($data) ? $data : false;
  42. }
  43. /**
  44. * [decode_adfly adf.ly decode URL]
  45. * @param [string] $ysmm [adf.ly ysmm data]
  46. * @return [string] [Original URL]
  47. * Source by http://skizzerz.net/scripts/adfly.php
  48. */
  49. public function decode_adfly( $ysmm )
  50. {
  51. $left = '';
  52. $right = '';
  53. for ( $i = 0; $i < strlen( $ysmm ); $i++ )
  54. {
  55. if ( $i % 2 == 0 )
  56. {
  57. $left .= $ysmm[$i];
  58. }
  59. else
  60. {
  61. $right = $ysmm[$i] . $right;
  62. }
  63. }
  64. return substr( base64_decode( $left . $right ), 2 );
  65. }
  66. }