initrd0

Untitled

Oct 16th, 2021
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.66 KB | None | 0 0
  1. <?php
  2.  
  3. function dd($data)
  4. {
  5.     echo '<pre>';
  6.     var_dump($data);
  7.     echo '</pre>';
  8.     exit();
  9. }
  10.  
  11. $opts = [
  12.     "http" => [
  13.         "method" => "GET",
  14.         "header" => "Accept: */*\r\n
  15. Accept-encoding: gzip, deflate, br\r\n
  16. Accept-language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7\r\n
  17. Origin: https://vk.com\r\n
  18. Referer: https://vk.com/\r\n
  19. Sec-ch-ua: \"Chromium\";v=\"94\", \"Google Chrome\";v=\"94\", \";Not A Brand\";v=\"99\"\r\n
  20. Sec-ch-ua-mobile: ?0\r\n
  21. Sec-ch-ua-platform: \"Windows\"\r\n
  22. Sec-fetch-dest: empty\r\n
  23. Sec-fetch-mode: cors\r\n
  24. Sec-fetch-site: cross-site\r\n
  25. User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36"
  26.     ]
  27. ];
  28. $context = stream_context_create($opts);
  29.  
  30. $ee = file_get_contents("https://psv4.vkuseraudio.net/audio/ee/s4_jzslYORe-63YTHpOJ4Moky6jGN5g4eYFfIA/c9Oj4_MDA2MDMx/5dN1RWUWlkYUVKUnM/index.m3u8?extra=gVaP4SWomDKiSZP84WiL6vyytBKbVRbFHhqi7Z3345oEfEzNqURU2e5GFocslJsirVHx9tg8pLDloKoY7HXiNoRTa45FJS8xAaeJ1t3sAUnD3GpBeChHPKYiP9tIuxoqURoK_2VjpTd4n2QG8Z8", false, $context);
  31. $playlist = explode("\n", $ee);
  32. $file = '';
  33. $enc = null;
  34. $passphrase = null;
  35. for ($i = 0; $i < count($playlist); $i++) {
  36.     if (preg_match("/URI/si", $playlist[$i]))
  37.         $file = preg_replace("/(.*)URI=\"(.*)key.pub(.*)/si", "$2", $playlist[$i]);
  38.     if (preg_match("/#EXT-X-KEY:METHOD=/si", $playlist[$i])) {
  39.         if (preg_match("/NONE/si", $playlist[$i])) $enc = null;
  40.         else {
  41.             $enc = 'aes';
  42.             if (!$passphrase) {
  43.                 $passphrase = file_get_contents(
  44.                     trim(str_replace('#EXT-X-KEY:METHOD=AES-128,URI=', "", $playlist[$i]), '"'),
  45.                     false,
  46.                     $context
  47.                 );
  48.             }
  49.         }
  50.     }
  51.     if (preg_match("/#EXTINF:/si", $playlist[$i])) {
  52.         $tmpfile = $file . $playlist[$i + 1];
  53.         $partfile = file_get_contents($tmpfile, false, $context);
  54.         $partname = explode("?", basename($tmpfile))[0];
  55.         file_put_contents('./test/' . $partname, $partfile);
  56.         if ($enc) {
  57.             $cypher = 'AES-128-CBC';
  58.             $ivSize = openssl_cipher_iv_length($cypher);
  59.             $handle = fopen('./test/' . $partname, "rb");
  60.             $iv = fread($handle, $ivSize);
  61.             $ciphered_data = fread($handle, filesize('./test/' . $partname));
  62.             fclose($handle);
  63.             file_put_contents('./test/d_' . $partname, openssl_decrypt(
  64.                 $ciphered_data,
  65.                 $cypher,
  66.                 $passphrase,
  67.                 OPENSSL_RAW_DATA,
  68.                 $iv
  69.             ));
  70.             break;
  71.         }
  72.     }
  73. }
  74.  
Add Comment
Please, Sign In to add comment