Advertisement
Guest User

hayday.php

a guest
May 22nd, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.38 KB | None | 0 0
  1. <?php
  2. define('TW_PATH', str_replace('leech','', dirname(__FILE__)));
  3. define('URL_POST', 'http://up/zink.php');//link đến file zink
  4. define('AUTOLOGIN', 'http://xtgem.com/autologin/79d6666090fb74130f8d58938038ed76/dGFpdm5uLndhcC5zaA==');
  5. session_start();
  6. set_time_limit(0);
  7. $tit = 'Tool leech hayday';
  8. $key = 'Tool leech hayday';
  9. $des = 'tool leech hayday';
  10. include 'head.php';
  11. $cat = explode(',',file_get_contents(TW_PATH .'/luu.zink'));
  12. $option = '';
  13. foreach($cat as $k =>$c){
  14. $option .= '<option value="'.$k.'">'.$c.'</option>';
  15. }
  16. echo '<div class="list1">';
  17. if(!isset($_SESSION['auto']) && !isset($_SESSION['dir'])){
  18. echo '<font color="red">Bạn cần cài đặt một số thông tin trước khi leech</font><br/>
  19. <a href="set.php" class="button">Bấm vào đây để cài đặt</a>';
  20. }
  21. else
  22. {
  23. if(!isset($_POST['url']) && !isset($_POST['idcm'])){
  24. echo '<form action="" method="post">
  25. Chuyên mục <select name="category">'.$option.'</select><br/>
  26. Title <input type="text" name="title" value="game"><br/>
  27. Link<br/>
  28. <input name="url" type="url" value="" focus="focus"/><br/>
  29. <input type="submit" value="Leech"/>';
  30. }
  31. else
  32. {
  33. $url = $_POST['url'];
  34. $curl = curl_init();
  35. $ua = 'Mozilla firefox';
  36. curl_setopt($curl, CURLOPT_USERAGENT, $ua);
  37. curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  38. curl_setopt($curl, CURLOPT_COOKIEJAR, 'cookie.txt');
  39. curl_setopt($curl, CURLOPT_COOKIEFILE, 'cookie.txt');
  40. curl_setopt($curl, CURLOPT_TIMEOUT, 30);
  41. curl_setopt($curl, CURLOPT_URL, $url);
  42. $full_content = curl_exec($curl);
  43. $title = $_POST['title'];
  44. preg_match("/<\/span><\/span><\/div>(.*?)<div style=\"clear:both\" id=\"comment\">/is", $full_content, $content);
  45. $content = str_replace("\r", '', $content[1]);
  46. $content = str_replace('</div></div><', '<', $content);
  47. $content = str_replace("\n", '', $content);
  48. $content = str_replace('<br />', '<br/>', $content) . '</div></div>';
  49. preg_match_all('/src="(.*?)"/is', $content, $img);
  50. $img = array_unique($img[1]);
  51. $i = 1;
  52. $ua = 'Opera/9.80 (Series 60; Opera Mini/7.0.32400/28.3392; U; vi) Presto/2.8.119 Version/11.10';
  53. $cookie = 'cookiext.txt';
  54. $ch = curl_init();
  55. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  56. curl_setopt($ch, CURLOPT_USERAGENT, $ua);
  57. if (!file_exists($cookie) || (filemtime($cookie) < time() - 3600)){
  58. curl_setopt($ch, CURLOPT_URL, AUTOLOGIN);
  59. curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
  60. curl_exec($ch);
  61. }
  62. curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
  63. curl_setopt($ch, CURLOPT_URL, 'http://xtgem.com/filebrowser?a=&f=&file=/images');
  64. $html = curl_exec($ch);
  65. preg_match('#token=(.*?)&#is', $html, $matches);
  66. $token = @$matches[1];
  67. if(!isset($token))
  68. {
  69. @unlink($cookie);
  70. die('Đăng nhập thất bại!');
  71. }
  72. $imgn = $img;
  73. foreach ($img as $j => $image) {
  74. if($image == 'http://ngheocophongcach.hayday.mobi/android/images/icon_download_light.png'){
  75. unset($imgn[$j]);
  76. continue;
  77. }
  78. sleep(3);
  79. $source = file_get_contents($image);
  80. $ex = end(explode('.', $image));
  81. $name = rwurl($title) . '-'.$i.'.' . $ex;
  82. file_put_contents(TW_PATH.'/images/'.$name, $source);
  83. $images[] = 'http://taivnn.wap.sh/images/' . $name;
  84. $file = TW_PATH.'/images/'.$name;
  85. curl_setopt($ch, CURLOPT_URL, 'http://xtgem.com/filebrowser/file_upload?file=/images');
  86. $html = curl_exec($ch);
  87. preg_match('#<input type="file" name="filext([a-z0-9]+)" \/>#', $html, $m);
  88. $filename = 'filext'.$m[1];
  89. curl_setopt($ch, CURLOPT_URL, 'http://xtgem.com/filebrowser/file_upload_save?__token='.$token.'&file=/images');
  90. curl_setopt($ch, CURLOPT_POSTFIELDS, array('MAX_FILE_SIZE' => '2097152', $filename => '@'.$file, 'upload_more' => 'y', 'submit' => 'OK'));
  91. curl_exec($ch);
  92. $i++;
  93. }
  94. $content = str_replace($imgn, $images, $content);
  95. $content = preg_replace('/<img(.*?)src="(.*?)"(.*?)>/is', "[img]$2[/img]", $content);
  96. $content = str_replace('[img]http://ngheocophongcach.hayday.mobi/android/images/icon_download_light.png[/img]', '<img src="http://ngheocophongcach.hayday.mobi/android/images/icon_download_light.png" alt="Download"/>', $content);
  97. $content = preg_replace('/<p class="tags">(.*?)<\/p>/is', '', $content);
  98. $content = preg_replace('/<div class="content-img"><a(.*?)>\[img\](.*?)\[\/img\]<\/a><\/div>/is', "<div class='content-img'>[img]$2[/img]", $content);
  99. curl_setopt($curl, CURLOPT_URL, URL_POST);
  100. curl_setopt($curl, CURLOPT_POSTFIELDS, array('title' => $title, 'text' => $content, 'idc' => $_POST['category'],'page' => '','show' => '1'));
  101. curl_exec($curl);
  102. echo 'Leech <b><font color="green">'.$title.'</font></b> thành công<form action="" method="post">
  103. Chuyên mục <select name="category">'.$option.'</select><br/>
  104. Title <input type="text" name="title" value="game"><br/>
  105. Link<br/>
  106. <input name="url" type="url" value="" focus="focus"/><br/>
  107. <input type="submit" value="Leech"/>';
  108. }
  109. echo '</form>';
  110. include 'end.php';
  111. }
  112. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement