Advertisement
Guest User

multiload

a guest
Mar 9th, 2019
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.26 KB | None | 0 0
  1. <?php
  2. require_once 'cleanstring.php';
  3. $loop = 1;
  4. $user = $_GET['user'];
  5. $permlink = $_GET['permlink'];
  6. $jsid = rand(1,90);
  7. $content = "{
  8. \"id\":\"$jsid\",
  9. \"jsonrpc\":\"2.0\",
  10. \"method\":\"get_content\",
  11. \"params\":[\"$user\",\"$permlink\"]
  12. }";
  13.  
  14. $url = "http://steemd.privex.io/";
  15.  
  16. $curl = curl_init($url);
  17. curl_setopt($curl, CURLOPT_HEADER, false);
  18. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  19. curl_setopt($curl, CURLOPT_HTTPHEADER,
  20.     array("Content-type: application/json"));
  21. curl_setopt($curl, CURLOPT_POST, true);
  22. curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
  23.  
  24. $json_response = curl_exec($curl);
  25.  
  26. $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
  27.  
  28. if ( $status != 200 ) {
  29.     $url = "https://api.steemit.com/";
  30.     $curl = curl_init($url);
  31.     curl_setopt($curl, CURLOPT_HEADER, false);
  32.     curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  33.     curl_setopt($curl, CURLOPT_HTTPHEADER,
  34.         array("Content-type: application/json"));
  35.     curl_setopt($curl, CURLOPT_POST, true);
  36.     curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
  37.    
  38.     $json_response = curl_exec($curl);
  39.    
  40.     $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
  41.    
  42.     if ( $status != 200 )
  43.     {
  44.         die("No Steem Api response, please try again.");
  45.     }
  46.    
  47. }
  48.  
  49. curl_close($curl);
  50.  
  51.  
  52. $response = json_decode($json_response, true);
  53.  
  54. $compbody = $response['result']['body'];
  55.  
  56.  
  57.  
  58.  
  59. $teile = explode("base64filename", $compbody);
  60.  
  61. $filename = $teile['1'];
  62. $filebodyprep = $teile['2'];
  63. $teile = explode("base64file",$filebodyprep);
  64. $filebody = $teile['1'];
  65. $filename = removespace($filename);
  66.  
  67. $tempdir = sys_get_temp_dir();
  68. $tmpName = "$tempdir/$filename";
  69.  
  70. $filebodyprep = $teile['2'];
  71. $teile = explode("base64chunks",$filebodyprep);
  72.  
  73. $chunkcount = $teile['1'];
  74. $chunkcount = removespace($chunkcount);
  75. $parentlink = $permlink;
  76. $chunkcount = $chunkcount -1;
  77. while ($loop <= $chunkcount)
  78. {
  79.        $sublink = "$parentlink subpost $loop";
  80.     $sublink = removespace($sublink);
  81.    
  82.     $permlink = $sublink;
  83.     $jsid = rand(1,90);
  84.     $content = "{
  85. \"id\":\"$jsid\",
  86. \"jsonrpc\":\"2.0\",
  87. \"method\":\"get_content\",
  88. \"params\":[\"$user\",\"$permlink\"]
  89. }";
  90.     $url = "http://steemd.privex.io/";
  91.    
  92.     $curl = curl_init($url);
  93.     curl_setopt($curl, CURLOPT_HEADER, false);
  94.     curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  95.     curl_setopt($curl, CURLOPT_HTTPHEADER,
  96.         array("Content-type: application/json"));
  97.     curl_setopt($curl, CURLOPT_POST, true);
  98.     curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
  99.    
  100.     $json_response = curl_exec($curl);
  101.    
  102.     $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
  103.    
  104.     if ( $status != 200 ) {
  105.         $url = "https://api.steemit.com/";
  106.         $curl = curl_init($url);
  107.         curl_setopt($curl, CURLOPT_HEADER, false);
  108.         curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  109.         curl_setopt($curl, CURLOPT_HTTPHEADER,
  110.             array("Content-type: application/json"));
  111.         curl_setopt($curl, CURLOPT_POST, true);
  112.         curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
  113.        
  114.         $json_response = curl_exec($curl);
  115.        
  116.         $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
  117.        
  118.         if ( $status != 200 )
  119.         {
  120.             die("No Steem Api response, please try again.");
  121.         }
  122.        
  123.     }
  124.    
  125.     curl_close($curl);
  126.    
  127.    
  128.     $response = json_decode($json_response, true);
  129.    
  130.    
  131.     $compbody = $response['result']['body'];
  132.    
  133.    
  134.    
  135.    
  136.     $teile = explode("base64filename", $compbody);
  137.    
  138.     $filename = $teile['1'];
  139.     $filebodyprep = $teile['2'];
  140.     $teile = explode("base64file",$filebodyprep);
  141.     $filepart = $teile['1'];
  142.     $filebody = "$filebody $filepart";
  143.     $filebody = removespace($filebody);
  144.     $loop++;
  145.    
  146. }
  147.  
  148.  
  149. $filebody = base64_decode($filebody);
  150.  
  151. $file = fopen($tmpName, 'w');
  152.  
  153. fwrite($file, $filebody);
  154. fclose($file);
  155.  
  156.  
  157. header('Content-Description: File Transfer');
  158. header('Content-Type: application/octet-stream');
  159. header('Content-Disposition: attachment; filename="'.basename($tmpName).'"');
  160. header('Pragma: public');
  161. header('Content-Length: ' . filesize($tmpName));
  162. readfile($tmpName);
  163.  
  164.  
  165.  
  166. ob_clean();
  167. flush();
  168. unlink($tmpName);
  169.  
  170.  
  171.  
  172.  
  173.  
  174. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement