Guest User

ninofrenn file decoded 2

a guest
Mar 13th, 2013
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.32 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 1.1.5.0
  8. * @ Author : DeZender
  9. * @ Release on : 30.07.2012
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class mp3models {
  15. function __construct() {
  16. $this->loadLib( );
  17. }
  18.  
  19. function loadLib() {
  20. SoapClient;
  21. $this->client = new ( 'http://api.4shared.com/jax3/DesktopApp?wsdl', array( 'cache_wsdl' => WSDL_CACHE_DISK, 'trace' => 1, 'exceptions' => 0 ) );
  22. }
  23.  
  24. function clearQuery($query) {
  25. $query = str_replace( array( '-', '_' ), ' ', stripslashes( $query ) );
  26. $query = preg_replace( '/\s+/', ' ', $query );
  27. $query = trim( $query, ' ' );
  28. $query = strtolower( $query );
  29. $query = str_replace( ' ', '+', $query );
  30. return $query;
  31. }
  32.  
  33. function clearQuery2($query) {
  34. $query = str_replace( array( '+', '_' ), ' ', stripslashes( $query ) );
  35. $query = preg_replace( '/\s+/', ' ', $query );
  36. $query = trim( $query, ' ' );
  37. $query = strtolower( $query );
  38. $query = str_replace( ' ', '-', $query );
  39. return $query;
  40. }
  41.  
  42. function grabBING($text = null, $count = null) {
  43. if (empty( $text )) {
  44. $query = QUERY;
  45. }
  46. else {
  47. $query = $text;
  48. }
  49.  
  50. $host = 'www.bing.com';
  51. $uri = 'search';
  52. $params['q'] = $this->clearQuery( $query ) . '+site:4shared.com/mp3';
  53. $params['go'] = '';
  54. $params['qs'] = 'n';
  55. $params['form'] = '';
  56. $params['pq'] = $this->clearQuery( $query ) . '+site:4shared.com/mp3';
  57. $params['sc'] = '0-0';
  58. $params['sp'] = '-1';
  59. $params['sk'] = '';
  60. $params['count'] = $count;
  61. $params['format'] = 'rss';
  62. $canonicalized_query = array( );
  63. foreach ($params as $param => $value) {
  64. $canonicalized_query[] = $param . '=' . $value;
  65. }
  66.  
  67. $canonicalized_query = implode( '&', $canonicalized_query );
  68. $request = 'http://' . $host . '/' . $uri . '?' . $canonicalized_query;
  69. $feed = rawurlencode( $request );
  70. $ip = $_SERVER['REMOTE_ADDR'];
  71. $url = 'http://ajax.googleapis.com/ajax/services/feed/load?v=2.0&q=' . $feed . '&num=' . $count . '&userip=' . $ip;
  72. include_once( BASEPATH . 'libs/curl.php' );
  73. cURL;
  74. $cURL = new ( );
  75. $return = $cURL->get( $url );
  76. $json = json_decode( $return, true );
  77. return $json;
  78. }
  79.  
  80. function grabMP3($text = null, $start = null) {
  81. if (empty( $text )) {
  82. $query = QUERY;
  83. }
  84. else {
  85. $query = $text;
  86. }
  87.  
  88. $ip = $_SERVER['REMOTE_ADDR'];
  89. $host = 'ajax.googleapis.com';
  90. $uri = 'ajax/services/search/web';
  91. $params['v'] = '1.0';
  92. $params['q'] = rawurlencode( $this->clearQuery( $query ) . '+"KB |"+site:4shared.com/mp3' );
  93. $params['rsz'] = '8';
  94. $params['start'] = $start;
  95. $params['userip'] = $ip;
  96. $canonicalized_query = array( );
  97. foreach ($params as $param => $value) {
  98. $canonicalized_query[] = $param . '=' . $value;
  99. }
  100.  
  101. $canonicalized_query = implode( '&', $canonicalized_query );
  102. $request = 'http://' . $host . '/' . $uri . '?' . $canonicalized_query;
  103. include_once( BASEPATH . 'libs/curl.php' );
  104. cURL;
  105. $cURL = new ( );
  106. $return = $cURL->get( $request );
  107. $json = json_decode( $return, true );
  108. return $json;
  109. }
  110.  
  111. function aasort($array, $key) {
  112. $sorter = array( );
  113. $ret = array( );
  114. reset( $array );
  115. foreach ($array as $ii => $va) {
  116. $sorter[$ii] = $va[$key];
  117. }
  118.  
  119. arsort( $sorter );
  120. foreach ($sorter as $ii => $va) {
  121. $ret[$ii] = $array[$ii];
  122. }
  123.  
  124. $array = $ret;
  125. return $array;
  126. }
  127.  
  128. function filterData($text = null, $count = null, $view = null) {
  129. $gets = $this->grabBING( $text, $count );
  130. $datamp3 = $gets['responseData']['feed']['entries'];
  131. foreach ($datamp3 as $value) {
  132. $title = $this->filterTitle( $value['title'] );
  133. $link = $value['link'];
  134. $id = $this->getidlink( $link );
  135. $date = strtotime( $value['publishedDate'] );
  136.  
  137. if (!empty( $title )) {
  138. $data[] = array( 'date' => $date, 'title' => $title, 'id' => $id, 'source' => '4shared.com' );
  139. continue;
  140. }
  141. }
  142.  
  143. return $data;
  144. }
  145.  
  146. function get4shared($query = null) {
  147. $host = 'search.4shared.com';
  148. $uri = 'network/searchXml.jsp';
  149. $params['q'] = $this->clearQuery2( $query );
  150. $params['searchExtention'] = 'mp3';
  151. $params['sortType'] = 3;
  152. $params['sortOrder'] = 1;
  153. $params['searchmode'] = 3;
  154. $canonicalized_query = array( );
  155. foreach ($params as $param => $value) {
  156. $canonicalized_query[] = $param . '=' . $value;
  157. }
  158.  
  159. $canonicalized_query = implode( '&', $canonicalized_query );
  160. $url = 'http://' . $host . '/' . $uri . '?' . $canonicalized_query;
  161. include_once( BASEPATH . 'libs/curl.php' );
  162. cURL;
  163. $cURL = new ( );
  164. $result = $cURL->get( $url );
  165. include_once( BASEPATH . 'libs/class_xml.php' );
  166. $alldata = xml2array( $result, 1 );
  167. $datamp3 = $alldata['search-result']['result-files']['file'];
  168.  
  169. if ($datamp3[0]['name']) {
  170. foreach ($datamp3 as $value) {
  171. $title = $this->filterTitle( $value['name'] );
  172. $link = $value['url'];
  173. $id = $this->getidlink( $link );
  174.  
  175. if (!empty( $title )) {
  176. $data[] = array( 'title' => $title, 'id' => $id );
  177. continue;
  178. }
  179. }
  180. }
  181. else {
  182. $title = $datamp3['name'];
  183. $link = $datamp3['url'];
  184. $id = $this->getidlink( $link );
  185.  
  186. if (!empty( $title )) {
  187. $data[] = array( 'title' => $title, 'id' => $id );
  188. }
  189. }
  190.  
  191. return $data;
  192. }
  193.  
  194. function filterTitle($title = null) {
  195. $title = str_replace( '4shared.com - free file sharing and storage', '', $title );
  196. $title = str_replace( ' ...', '', $title );
  197. $title = preg_replace( '/(.*) - 4shared(.*)/', '$1', $title );
  198. $title = str_replace( '4shared', '', $title );
  199. $title = trim( $title, ' ' );
  200. return $title;
  201. }
  202.  
  203. function getidlink($link = null) {
  204. $link = preg_replace( '/http:\/\/(.*).4shared.com\/mp3\/(.*)\/(.*)/', '$2', $link );
  205. return $link;
  206. }
  207.  
  208. function findmp3($query = null, $view = null) {
  209. $url = 'http://pipes.yahoo.com/pipes/pipe.run?_id=67f92d4dd91f40f0a1b44e7fb9fef3e2&_render=json&q=' . $this->clearQuery( $query );
  210. include_once( BASEPATH . 'libs/curl.php' );
  211. cURL;
  212. $cURL = new ( );
  213. $return = $cURL->get( $url );
  214. $json = json_decode( $return, true );
  215. foreach ($json['value']['items'] as $row) {
  216. $data[] = array( 'title' => $row['title'], 'id' => $row['id'], 'source' => $row['source'] );
  217. }
  218.  
  219. return $data;
  220. }
  221.  
  222. function sandboxfindmp3($query = null, $view = null) {
  223. $url = 'http://pipes.yahoo.com/pipes/pipe.run?_id=67f92d4dd91f40f0a1b44e7fb9fef3e2&_render=json&q=ari+lasso';
  224. include_once( BASEPATH . 'libs/curl.php' );
  225. cURL;
  226. $cURL = new ( );
  227. $return = $cURL->get( $url );
  228. $json = json_decode( $return, true );
  229. return $json;
  230. }
  231.  
  232. function login4shared() {
  233. global $core;
  234.  
  235. $url = 'http://m.4shared.com/login.jsp?login=' . $core->user_4shared . '&password=' . $core->pass_4shared . '&remember=true';
  236. include_once( BASEPATH . 'libs/curl.php' );
  237. cURL;
  238. $cURL = new ( );
  239. $cURL->get( $url );
  240. }
  241.  
  242. function getfile($id = null) {
  243. global $core;
  244.  
  245. $url = 'http://m.4shared.com/mp3/' . $id;
  246. $infomp3 = $this->client->getMp3FileInfo( $core->user_4shared, $core->pass_4shared, $url );
  247. $id_file = $infomp3->fileId;
  248. $infofile = $this->client->getFileInfo( $core->user_4shared, $core->pass_4shared, $id_file );
  249. $title = $infofile->name;
  250. $size = number_format( $infofile->size / 1048576, 3, ',', ' ' ) . ' KB';
  251. $preview = $this->client->getPreviewLink( $core->user_4shared, $core->pass_4shared, $id_file );
  252. $download = $this->client->getDirectLink( $core->user_4shared, $core->pass_4shared, $url );
  253. $date = strtotime( $infofile->date );
  254.  
  255. if ($core->adfly_view == 'yes') {
  256. $link = SITEURL . '/download/?url=' . urlencode( $download );
  257. $url = 'http://api.adf.ly/api.php?key=' . $core->adfly_key . '&uid=' . $core->adfly_uid . '&advert_type=int&domain=adf.ly&url=' . $link;
  258. $download = file_get_contents( $url );
  259. }
  260.  
  261. $data[] = array( 'preview' => $preview, 'download' => $download, 'title' => $title, 'size' => $size, 'date' => $date );
  262. return $data;
  263. }
  264.  
  265. function detailsoundcloud($id = null) {
  266. $url = 'http://api.soundcloud.com/tracks/' . $id . '.json?client_id=' . SOUNDCLOUD_ID;
  267. $file = file_get_contents( $url );
  268. $json = json_decode( $file );
  269. $title = $json->title . '.mp3';
  270. $size = number_format( $json->original_content_size / 1048576, 3, ',', ' ' ) . ' KB';
  271. $download = SITEURL . '/downloadsc/?url=' . base64_encode( $json->stream_url . '?client_id=' . SOUNDCLOUD_ID ) . '&name=' . $title;
  272. $date = strtotime( $json->created_at );
  273. $data[] = array( 'preview' => $json->uri, 'download' => $download, 'title' => $title, 'size' => $size, 'date' => $date );
  274. return $data;
  275. }
  276.  
  277. function infosc($id = null) {
  278. $url = 'http://api.soundcloud.com/tracks/' . $id . '.json?client_id=' . SOUNDCLOUD_ID;
  279. $file = file_get_contents( $url );
  280. $json = json_decode( $file );
  281. return $json;
  282. }
  283.  
  284. function infofile($id = null) {
  285. global $core;
  286.  
  287. $url = 'http://m.4shared.com/mp3/' . $id;
  288. $infomp3 = $this->client->getMp3FileInfo( $core->user_4shared, $core->pass_4shared, $url );
  289. $id_file = $infomp3->fileId;
  290. $infofile = $this->client->getFileInfo( $core->user_4shared, $core->pass_4shared, $id_file );
  291. $data = array( 'mp3' => $infomp3, 'file' => $infofile );
  292. return $data;
  293. }
  294.  
  295. function previewfile($id = null, $source = null) {
  296. global $core;
  297.  
  298. if ($source == '4s') {
  299. $url = 'http://m.4shared.com/mp3/' . $id;
  300. $infomp3 = $this->client->getMp3FileInfo( $core->user_4shared, $core->pass_4shared, $url );
  301. $id_file = $infomp3->fileId;
  302. $preview = $this->client->getPreviewLink( $core->user_4shared, $core->pass_4shared, $id_file );
  303. }
  304. else {
  305. $url = 'http://api.soundcloud.com/tracks/' . $id . '.json?client_id=' . SOUNDCLOUD_ID;
  306. $file = file_get_contents( $url );
  307. $json = json_decode( $file );
  308. $preview = $json->uri;
  309. }
  310.  
  311. return $preview;
  312. }
  313.  
  314. function saveKeyword($keyword) {
  315. global $core;
  316. global $db;
  317.  
  318. if (!empty( $keyword )) {
  319. $info = $this->checkKeyword( $keyword );
  320. $info_id = $info[0]['keyword_id'];
  321. $info_count = $info[0]['keyword_count'];
  322.  
  323. if (empty( $info_count )) {
  324. $data = array( 'keyword_name' => $keyword, 'keyword_date' => strtotime( NOW ), 'keyword_count' => $info_count + 1 );
  325.  
  326. if ($this->countKeyword( ) < $core->countkeyword) {
  327. $id = $db->insert( 'tb_keywords', $data );
  328. return null;
  329. }
  330.  
  331. $expkws = $db->query( 'SELECT keyword_id FROM tb_keywords' . '
  332. ORDER BY keyword_count,keyword_date ASC LIMIT 1' );
  333.  
  334. while ($row = $db->fetch( $expkws )) {
  335. $kwidexp = $row['keyword_id'];
  336. }
  337.  
  338. $db->update( 'tb_keywords', $data, 'keyword_id=' . $kwidexp );
  339. return null;
  340. }
  341.  
  342. $data = array( 'keyword_date' => strtotime( NOW ), 'keyword_count' => $info_count + 1 );
  343. $db->update( 'tb_keywords', $data, 'keyword_id=' . $info_id );
  344. }
  345.  
  346. }
  347.  
  348. function countKeyword() {
  349. global $db;
  350.  
  351. $sql = $db->query( 'select keyword_id from tb_keywords' );
  352. return $db->numrows( $sql );
  353. }
  354.  
  355. function checkKeyword($keyword) {
  356. global $db;
  357.  
  358. $sql = $db->query( '' . 'SELECT keyword_id,keyword_count from tb_keywords WHERE keyword_name=\'' . $keyword . '\'' );
  359.  
  360. while ($row = $db->fetch( $sql )) {
  361. $record[] = $row;
  362. }
  363.  
  364. return $record;
  365. }
  366.  
  367. function getChart() {
  368. $url = 'http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/topsongs/limit=24/xml';
  369. include_once( BASEPATH . 'libs/curl.php' );
  370. cURL;
  371. $cURL = new ( );
  372. $result = $cURL->get( $url );
  373. include_once( BASEPATH . 'libs/class_xml.php' );
  374. $data = xml2array( $result, 1 );
  375. $charts = $data['feed']['entry'];
  376. foreach ($charts as $chart) {
  377. $title = $chart['title'];
  378. $img = $chart['im:image'][2];
  379. $datachart[] = array( 'title' => $title, 'img' => $img );
  380. }
  381.  
  382. return $datachart;
  383. }
  384.  
  385. function getHomeLatest() {
  386. global $db;
  387. global $core;
  388.  
  389. $sql = $db->query( 'SELECT keyword_name FROM tb_keywords' . '
  390. ORDER BY keyword_date DESC' . ( '' . '
  391. LIMIT ' . $core->countlatest ) );
  392.  
  393. while ($row = $db->fetch( $sql )) {
  394. $record[] = $row['keyword_name'];
  395. }
  396.  
  397. return $record;
  398. }
  399. }
  400.  
  401. ?>
Add Comment
Please, Sign In to add comment