关于网易云音乐搜索api的返回结果问题


用php curl 请求


 <?php
header("Content-type:text/html;charset=utf-8");
//网易云音乐搜索api
//$url = "http://music.163.com/api/search/suggest/web?csrf_token=";
$url= "http://music.163.com/api/search/get/web?csrf_token=";
//搜索关键词
$s = urlencode($_REQUEST['s']);
//每次检索数量
$limit = urlencode($_REQUEST['limit']);



function curl($url,$s,$limit){
    $curl = curl_init();
    $post_data ="s=".$s."&limit=".$limit."&type=1&offset=0&total=true&hlpretag='<span class=\"s-fc7\">'&hlposttag='</span>'&#/outchain/2/28371369/m/use/html=";
    //$post_data = "s=".$s."&limit=".$limit;
    //$post_data = urlencode($post_data);
    //$psot_data = "hlpretag=%3Cspan%20class%3D%22s-fc7%22%3E&hlposttag=%3C%2Fspan%3E&%23%2Foutchain%2F2%2F28371369%2Fm%2Fuse%2Fhtml=&s=".$s."&type=1&offset=0&total=true&limit=30";
    curl_setopt($curl, CURLOPT_URL,$url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);
    //curl_setopt($curl, CURLOPT_CONNECTTIMEOUT,10); 
    //curl_setopt($curl, CURLOPT_REFERER, 'http://music.163.com/search/');
    //curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36');


    $header =array(
        'Host: music.163.com',
        'Origin: http://music.163.com',
        'User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36',
        'Content-Type: application/x-www-form-urlencoded',
        'Referer: http://music.163.com/search/',
    );

    curl_setopt($curl, CURLOPT_HTTPHEADER, $header);

    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    $src = curl_exec($curl);
    curl_close($curl);
    return $src;
}
if(!$s||!$limit){
    $tempArr = array("code"=>-1,"msg"=>"输入参数有误!");
    echo  json_encode($tempArr);
}else{
echo curl($url,$s,$limit);

}

?>

但是返回的结果


 {"result":"35b1748964afb6f6ab00803a0762fb42b1748964af8a7c1d883e3a6f3c773bf4ab232f7449bad4bbaf1fb194773bb1f3cd7f9272346d3f45a4ee567742b1a89e09ca6454cbbaac7dfd89a24d3aff3252e2e41f3b559f509f89d10df752edbd749c84d9b5a84ecf91295e675f4dafe8d76834730438bc2f7ae2569862cc6e8a4e48061068cbd0b023248974186e72002e3a17c68198a37ccf6383123692173b76c738260aa8527aa2eb46f1f85ba0ab22960db1ed031d8c7feffba17bff3a4095efa50a2a517aec39e8743c7f23b1294e12c831cc97f63cadb6777dbb1afb1f9b46af39cb8ce9580f41487c20fb6a018a97b03842126dded8a067022366a6d56d3b5fdcf6a7107887b33c302cdd1577ffc6bc3c5637200a030f85d8694faacc999639b08da2447a3a1eb43fede49c12ec6bbbd37a57d8e9f2553ad6d6b3552096af75f585e310347c1d570425220d868b48ece8f2bf001f07deb09cb68b8a440a02c89a219fc1b3d3fdfa67b26fca733396818eda92b83f042689c968077cf50ed2b187380e5f00eecf325f3e7f297c90a68c969cb5a5c26b17d19d9712de9b183a18a1016b2d81f2e7bf0bec7251bb9a71ddaeb9fae6d4e65dc8245bb8c10b97565fc72f8aad139ed70f4b0a4789760db0d2ac0d16ff3808577ecdc59832cc262f613e2146c275620425e0b65dc6579dbc0663a276819d954ba638c503c1b0e3d876781f53ed730f24de74a32da119ba57b8dd2d07dadacd0c9a3aa0fb0434f63ec05e1f7ab27b7b04dd7f4ed93a05fbac68a6ac32ebc74b8ccbf5a039f42f428ef4344ee796d399e03431e29148f55d0891413e79c598b41fdbe8be81970710c838f94b455e841e62cdb1bc1e07fb641f9c4095f1bc42241f96eef55f143ec1fb646296b39d04c9d7949fb36bba04d8392e54fd0331a681d9cd3abf7007a0e6727f20b29bc9cf018033af94681a87194ecc10e631cfde9568adfb85175f81c19c79a885162168489faaab2e5f92b262de5815dda604f1ec0819ecb1bcb0af33ef64d6150148e7ff950dbac917c5de37ddf9c985b31f630816fcf2d0ea723ec0c78bfbbead3ea859ed39aed61898b16205f5c5f948f05a9a8916442f01036dca22a0f9982d48cf9111b04c3368f920e876d8335f11558974f6bcb108a48707a838af1e365ee802c94d896af9019ff5c1ae20ef94a4e8176de0bb483a7f3a957479af507779643d9f976c884a4c468ccbeeb20cd4b8c6c7aa204e5749edf6c325b601db50d81ede74eaa082a86afd239c66ec402ea5cb16e889d118b15a4fa5e7328cf19aa8228ae91152a0ff3a5629424a9a7404a6f2c11211d9c6d958751fc4616487de652c5f0a4385041f5b31396110bcb2492133ec43a3cd89079e22cb74ec3e4d1095f126b26d58be4adbf9eb3a796b4562a542b25f166bff35c087b58585ba3acd45ae4601e7053ae9d9e03ca6d6b5e29ccb04bac7b77bbee2a1a895fb8cfdd510e69b4efd3b062356089cb2ec7f409652df327c19053425d3cb05fb5f1f87030b74ae518525dffd8f14518fca9c1fa7f6b463aaba60436e6f385ce350b7369bf235d976fceb4bbb90fb7311338051e208ea1dd8c5a2b1633874a5b49e77043e8a2c918d6d4e1e3fcfe3830f9ce6db4ac0d1de2d862d4014de7fad3d45d1628992625486643a40665750417c62bb6b5616bccfa3549589854fb362b56beafbd11fd62695482673d347514840c23d3442b490a3745eddde4bfb2079810432c1d9575bb36bab9f8d3ac68541030b670b2e85e47eaed757c2635107e77c0b818d8ee38eff624207c14682c18cf556aaec6209f66de4cf050c27148c697f74ec33eac6cd00833e093a090ede9c7c0640ddae622284a0041941c108a5b28edc85a1557e1866787b9f897495c0067ab353bac1afd834dd8e4018bac55942ee83405f9c10a225829db10b9e0323bd18d7c1a7102412d95f1f53c148f5e009ecf5f51f763bca133247cf02c05fb279a8af4d62e31436ce018584c58940b4b249a913c91ac915ed6b57a840eb8a394ea87e33d22b04f1bc2c658256193cde74bc3ce497bceba1012a7ecfde3ae95731ae4875747ea503b26d268504a2969a7c74afaea16b21684892ea69efddc799d9ec038538edb08dd0c295dc68eb6fc7bf2a09c0a9e6dd7373da0c752b5069926c43f27ed5b6ecdc4e3ad3744813f1e98e30ae4ab05ba08bcbc295f425fc48ad9cf9dd2d30b65e48f93a4e4c14724aa09977a89c3e9576eec1cd4be599c91710f52d9c22f5851e10dcfd8bea6a94ac632bb3d057dc91583cbe1223a2149f89fbd39038129a1020ab5b3c72f937d7b4afa37c1f1ada0ac1743f56f4cfa3956bc5ee02b83aa479c7106803cca45bbbdb52b70aadf2eeaf1c5c4e1de2f6f6b56e58c638a8e2af2e0448d5d3c16794c9f5918abc54adad49953b972c943d15624022250fd3a6633d2d5fa854cfc846819c2e4e1fba8778ebdb9e52e0042219f5222c3810d67848dd0a96249e83b67064cf89a60aa357167baebfdb99c586ccde790e62ba8ea5512a6a751375a7ffbb71ca696807aaa0a89e6bdbad4d0540e683790273b82ef5498ed14f73b5040d0ebbff996d3929d811034a2fc6a8a498f9d7d8dd89fbc81ffb89ddbf575de09a80675172f5299f5525dba67255bc630b4a3a327c3dd3c2f55907f4483b4e3ad93afb085eab9a232ce01f8202469538f60383eef453669599b66e2cc205c73637047b2024312d05bb0e372ff47c1d8cc718fd4e17c2a6a841cced62590ca06576258199616699d16d96b50eba9262c2846204783fe73ba50a30563bb2edf96311042c89485753a9e6793b97929463ae85cd9abc5f3a74ec3342360434cf5f422ca07c98967aeb835bfde6a0e6f685f7cfe0b61259657a0c203a0390332dfaeed139102d18c5625349ea81c685a58b69113501e4688142145f796d629745a395e3959e07f1143a5f8b666026cd1167d49fd446621848508ca0f6ba26a6c3304592be89db4f44ffad7496af83fdf14396bef6a2ef8713ff62459cfc047c6b3e6d4ad1a1622f4eec542dde0e95f998426415928562eb1447c221e4712d5585b5cf0980539c13bad3ba3011ebae66b331049719a835ae7f47b3229d2c0ab17a281c41f8944ddeba13a3570bc2ae8dac489586b805baff6238abaf51036a75ff97a7cb898dca07db3daa85a89edba44f1d0568e6b1fdc3ee4ba6ac6110dce4438a0785ea387934af5ee2b361a83a7510c77c50a786cc1186596b6b1beae00e86937d01609c3eb6307d96761fdba61172ae3e663b07322444a3f11f9c2ec538f212e23917b517a54abcba0aa00799a710dc87a1c8f6de6bd608132df2969c1c4e38cfe28d57ec50aa322e85e69cba04f1093cc14aedfdf5a48a3154ad6a922f1de99cb66587e9a5a307cad2216a152d5f37544da480f99c2e8c5fba87112edb1e4d31047568f59891a610b76f9d090ac011288341e1d0cfbba673a30903ad432bb1591635fb408aa5ed4245af51166a75b5752cff893fca69d92caaa0a8996bdba31d05d87b83b800bab80a40b829d1b3b0a204dda6a695806d5d80d6cb53799a07a86be2813fa61faa96334a310413da4ab15f30713b4c33d93b0155aab513cdaeaee23467e2e6f5aa66ec79e6019ee01dde79a10e0eb8c8788b8a2ca0e964fa3a39893a553cdea3d2623859a23e73a18cd1840aa80d9ee483df7c85de0d4e45eccfdee3958985e7af859ed8a0c8d2a61da1a885eb99e8a6a8e03e16e495389be0e83a093853e79590a8f5721f4a2f21dbd759778a3a260e2de7473706dd106856902c92bba02952df38cdeeafffee7c8a89a2b717c679d6e05136738c6287ecc00b0d40e60f90401b6859ca7f0714d4027c84bb8a69011ab040855f3e0b65a808aedef2c289fb628b663149df9abc471a8933195ce36adfab32e2a7aec0d1089295dd5bf4538596e03acda3ea951ac9ce1c09898a9cc8010390054b0953792d48cf17b47e8fd340537ae8566b0ada7b2989d1bebc0b522c66628597dbd5ad794f15cd264764dd10ffe8566a8cdfd1a4b2dbe2e08906a87f3a047406af9b9179643d112a1bce2220681ecbc94573601e13c7fceb4ec70eed92a402e2d99ddb36dc264b2df1cb839dfcdeb366ec3790a55e8e3c8974951f5a4fa5e7ff8ccc15a8228a89e0cad9fff1ab5e511ed5a692cab07a83a0d96a6071da529228257b014b36b622db76c77cc99e37fd10bc307f218eeccfa3d8bbd99e22cb74303ef92195f1263ec14c8d4ad8814b6b9826ff859c633c11126bff677872bc62dda2d300ff3c9411d9d704bf72596247d6b5e24dcb95ba6bb776bfeea1a895fb38fd9a21e69b4ed244060f5608afb2b421a066d64bd34e579d3425338ee7fb2432136bf151a2c37cf5084911eea8f9e99c1fa792b409aa8c60cf6eda385ce3504d36657435d976b8794b2d90fb2a113c6aedc1e78d1da004a2b1633874b3b43e9aac957cc7399b4d4abe5163f940ea9ce6db366dca59535e746814897fc53d457462bb3d6254865ea8406657500f7c57de34963ca2cfde3a8907924d38a60d6e53999deecf2f9f7b4ce8cd44305bb6d17a7267b259266b84d7ff161872f9eb7cf582995d3d385361d24962bb7cc8b6fbe907c369a5b4a7800fed98f52f1fa2146271d1512edef29e188c1e85caa8659c3cefd82f2115f498bb64c51876d374f97ce2af6165a6a3d54514b299f542b1b41e90abef7c81008ad62506d8fb9d4098ba2137b8b56be86beb3e681a5691d5975d6f34021362c05fdaab8537760fa1a00dd921f6af9c830369856506872d21851885ed3a22a62995bced79f55dca426e2f212faf292495a017f2bd46e4de658fdbb8e2c8a652b331c425a557d777cb4813eed63d024fec1295dde86eded62d13c9cb4227a5539f0409de1ed8c7a3fbeac321acd29abbc3aefd3003b3ab9019a05930c18c63b44f6ebafeae83c9629c61c98226d238a02c6bbb47bc5b320e6f071eef0ec801c7b805550670080e0dab19c736e1c0025d1e4d807fc2804f0d07e2f403ef8a74e3743c5e3474bbfbfbdbf40b10dd9ca87ccfb2b1b216247cd6b229d920ffa8af37afdf7e3a38a2d60548fdb30add8cd2c7f70595725ba61840394430f3615ba5160dc1daf890f9a2b821ffe0e0f971c8e8c103e46226c8172e0aa2d71532a8b0ecb0322c09e6402c1ffff50ff3341f1d05b39765b1ada5ad38f538a8b433561b0448bcea5016aa91e8de64bcb2e432a87bc96d67b33aba04c8d2794b541139a64d0067d66e483a8c18e7bf952c0c9963bbd16b3ba2b7403e4db307ec0385b8d1b08dd01ec5dcdb162ac75b2a07336c02f4ff432a1d0c0cae74f144c91890c4e3547948f11021b597be36800a740559915e2614a6bae4a0db31e2a5f9dd2d30455e48f9d996e9d91129bb594095578f119b248974a1baf5cb4d7e78410d2ede7972d895da163e4aa53c878ac810e2d8c78202ec8a2a52c2b8a2b26aaa316e853f64510b89f21e18c9020a6bd9c6f94b2e9091ffd8ff7ff54034bf94413ec3a325608907fcf681441377ff1f9cc6dead727948ded991763aca13a810eb4eea3ab519b80789b11a5e3111cb661e229aa629e21fb1722ca76035f6660e6297a6acba9a89e2366f553acac0e8e6ad5635b60b89741818c92f3979c61fcafcd979070aa8a26bdfbf16d90a04619618e2a16da882930d831abb2121bf96ec7f5463ecfd1a8955fce2d17be31df137149a14f10789c077018bb009a8bcc27a2c31f56810db2dbf06c3c5a8063a04e937ddd61ea8dfad782b56b8d8284d4ebc359df4e866c889f2e4bc765d3d99f57c9dbeb57c538f45bba0b75d89fb07c5d78ca8c09c2ec54863557e82ed79a86aaa5f54ad0dae17cf8baf3525722d4405074f0adacb94e9ae04dddb6f0809a6874d73b6d1767beb56e039e398b72455380e10d6789dddd796201e1cdfe1d04389a659a3098f531dd84e99b5e3fba078b7ed348a6b067536ac4bf289fba0de0ebb562f107e9b7e72f9480713c5e36e32b179c910346121dcac4d73076b62a613b0b7d76abe13855e7eab0a85dd724d446461a3b6cac4389c7e0c2ebcc278e6b276c3898d5f3ccf628396f6e0337910ec3c9e7285e64479a348cf9bb056b279a8afb132960915e2d0526a95dd17f48b859631620da47a2fcff90a4c6e7966a0fdd8859dae4601cfde40bbd824d3a6d6bab11a243ec1853c6d562e89d192ecaab7c8b16285a12642ad385215cd2647eddd105eb2552d5dc264da0f1e6f2f3a39b18e5ff2ae51858382a6ce14ed28ca9c6ddb68baeb792ec49accffc7fc9048db7351bea402e23acbdb36dc264b2df18c839d59bbf91337b3d7bc75ac7999a82f045545a7918d6dc9b015cfe3252a9ce6d59e42bf2ab6ae79ad61843a3589a0d8d3e9d1ec3e337795c99fee36ab6a4d97dd215b0a819dca38cf2a361ff40112d63920c13b5e39a4067104c7a62ddd097bea97ab3c396f12a7eb8cc2b6623aedf43d48213acad1386806e534ac6ea8a1689d3a90a0bb57b4da6b3c9a6b2ca6adb3a88c850d176638532c62a029aad748d8bcb5a202e8abc5f6b4baf957850daa313cf51f669ea710423e72e439a040a62dcafdc8480738c34720bf5789db8ab7df7f406dd6cc964ea1deb4a5a0ff6b3324aa6f3e1fbc79549aecfd3bbbb230c0f27a593ba6625ad425fd60bbdaaef43bb0a0eabcb2a125855257caf27498de5e2c660e3a9da485f74db5abbd331f4ef059bbab2f9973f575f369874353afdaefb1089c4fffa8f76462417f4ccda0dab6bfff14eda8891562f784400450eb170cf55699b60910edb1bc00b65709e37b85a1e88a131889bf042c3c1f6b8974373ba2d6c7b25dafa7ba629b7bfc786dc7bb0794fd8c403aada03b73d7157a4c990ad5511f7c950a03aa65a0f0f2e604766d017b6edfbe778039741af7bfcba765a6baea3a07311f3be4c1be0c941e3addfd6d12aaec8507a23e501d0573ea3573c7f9c177aa6d13047964e0b47a3a8c19ce476b86aca627202415c14c24848e8595d2664f3885180d104080cfe6090d6b478bafc2f5627510aca6cf8504254abfd708797e3e745700879a896d9c2a531644b29bcdae1262a61a0dc0d4b51a55856b7fde447f85c5e2e0a8baa7a0951a5b4477d256877f8e5f027ccf3e5f3e7fdab82eeed7b1b338a58a6ac8749dc2c0ad9b65d918ffcd7a36ca5985c09f0738683314e58564ad9876d32323afed65fa1c8204568ec7918aad13d7d70f4b0a4789fd807b35e4f673ffba084203cd958c55ccdda7616672664aa6c6627bb0a5bebce2e35d1395404eb36b3a3ab1fc4134e97f04d82978e253ed734124de740685a1177f3416dd083ddadacdd7633a6b49e94437488540fb7496a54004eedb3eb1235148f54e15339e15a053ebb63249d1217604a1aabcff0e33c033b5eeb3a0a07c3880a5d119632176ea6b41efec7b9e44b8b5bc5542b6bcc5853fed5133cad1bac58c87a005a8181a48fe1c2b89447e5576f5c866ecd89515f47c81178585bebceca0743173d51385aa49525b3aa7977b57fdd3c0fb10777575b519b8e340d70d223e68d6013edbb52d8b262f89b3b17694d88b562bc3a63d996ab13fda4272c117f630f54785151f3e9d89f2c43ec9d3626647445de0bfc13bd3e0502089f23a7852d1bd64e99a37723a7ccfc89f11235f08afd7ffdc40e8c579ec2fb4c1c04862246ee8ab540a579411e6b4d5e806a85b967e79c6a0c813819d2d7c4d6350b19192cd3b79a0980dd7575d7abc750df1f8aea0ee4aeea0ab51d34d8c0eeffba17bff3a3a9564a0cd2ed09bd3f91e38ec20a9d7ea0697cdeccc286a3cadb6192b891afb1f506aafb098c905589741a17c20fb6af49e4a6dff3d76c0de3aa067022366a62f6db3ff1e1c84897a9c77012aaf3ec596ff9d31b256dd17ebb157a840774faacc456639d8915df4a2315f7299441adc50bf9fccc9f965d3237e7ae0305405926c3710cd6fe887fae68ec866dbc8aaf5c93405d10ff9a1df481f3d95ddbb4bdb95dedd0d8b9837382f8919bc99f80dcd454a9879b250f11de2bfbc7bbecd1a638de2ca3fefb49030b1eca451c78b9fe8560d05fb371721dccbd4cac317aafc20a5d7b868a0b504a6e229b5997189e6a379bc0a815f643cc8defdb59c10c79dfb74a861731eb56e04af7b01cddd546e2cf149cdabdbc836f89618521e53362066364469423e0ddd3aaa8c1659a6a8fb8030693915d985d337bc83bbc7ca56219c20914447a350d4bb3667c81ed7cc355ff54974e0450b0d8bcd979868e9bb7f04bf7ab2c15eae19014305f718958c2a7c7f17d2c99cb7454e710407387f043999ecc5853ded647b89d12218a19b8c0d42329cd342d555a3066193c6ff1ea8088cb6833cc0689107afc73ec0be378c404a3cca4596b8853dc62f55c32a69ed09a5bac0a5538b49863a048a01b7caff40bce8c247bc85261511421d058f4c6e8cc33874ecb2a4c68502183c3d0709492d9cb5a1dd26be62dfa7a004a4239681af3e1640dd329548c52f556e554ea89104d3749c05b56da5376b3a936854d914595ba68340e2a5103125fc3196039e3082bdc5c6766a102472075f1f3be298f5a209ecf5d91068131ec275de3722660e74b4e8cad0686a5a9c58fd6089d831b5f8eaa01f967fcb5f00f1cfe2f6e0ebbe403b6b3fc0817100c0908ef0e0d5d1d8d6e0abc037f6b453be896418657952a3e75e149c7e49466be6c5ee452920fd7189da2d4becb68b8eed3c26de0ea69c57a016fbd1f5ba38cb8c6e959c7af4cd37f7eff6a6e3932b8b07e32f573fb1fadbfc9eaec3b3345bab3add17728cff22a6a8fb3633693063d93ad309bc95bbc7f9b0109cb8bf81992d6eba85c5b150723c8e66b1744415014853cbe3c51621a7eab690a00ed1ec4581983baa6a3bd1b3938eb8f475f0f726be52259b24500d9572b1ad10576e8521c380433e4285627f53d622f562792140a61d4004efe3c83c2d4eec3e95fb8c7c6310871fc0b1766226096f92b1f57c1a91c1e4e23b7e3a6b7f4fd67f6b95c9e285baa707041a9281d8cc12877f203e9b7ccf7e5fb2f1314e11798cb11a6679226273dc6b322f46851f017b2e07d391cab885c0472f20ac3314d76b64e712c1870f23afed02fa5ae3c57e11c791a24fb8d7d7824b0a21898c0d30d2e4ac7a2f9f2d03314860de7e5feb899aaa1f4716a6b5627b90d6beece2e393139585e29c40062dbf748c8bfbf10491e078e2d651da4124897406fba1d9ba57b8dd538bdecc3adb01a63b59191848a1c7cb9d62f78c948541c26b6525785bc4a84e12a407133a7460d7dd59eebba0093f9a3aea21f4514f1f36ec2a29d981c191fc4555190b81f411291f089fb58ba247a899963bc82e48f1e7aa366df4f4c0af33075f1abe505d4776c5263c5a2dafebcd098179e7f1cf5e3bbced99f5c856a272ddad90ddd6eead79cfb7febf6e796295fb2e4ed5103f3c72913c3a2c0e24c8095f37c7103706176475c35efb95c8668c3acb8d8541cfb59656559b9fb9cb374c5ef1eceef9a4693cc187806f17324a4b66a0fff9c9d2eb816bc389db971f79744730f924b4e524d2d25525edcd5b56ffa8f7d46ac0cf1aa53583c2a3af2d0af598a8bcb2221b95b5bcc800679791b2a374ecb6e41385aac95635d6d9c6c5bf30484e41b0307c819b82b3021ed9c6c5e7910426e8ab3d897485d6bca5773ed6b36bec038538d1e615d08c95466816daa0bf2a0d336c0001ff1d2acf86325bd1a6e9981873e5355461797c109dcc823d360d39748b0f2bcba79510d263d8dbbce29cf9dd2d3045497cf9c74e20149872859977404d728a7cc17195c7850ee9eaec33db09a692a5332483a76b64be3d64c03f1e1fe178786fd59a0b982d9cad0a82b8a80612afefa85d92bb7495c5b8bf7c1885c144103aeee72f117b0f12529cab73dcdd55047cecf69f3996ba0de0147ed3f70a8d9433277a0739b8f5dbaaecbab5a06b2e3b222d981d2f506d5bbec33ba1407cdd385752208acc8079703dcd6630eec7eeed2a4d7c9825f1c2c2ff622c0494a0c72ed0003c1aeb213120708c09d297eaa211aa6a73b7d3191b891dfb1f00a44d8e5ec9e92af74b48ee0efb19f4874a7bcb42b0c0e7a88530ef8266a663e2a5ff22481dc84a0d25d61162413aa8a64e66c8f674fc2cc4f2d918899d83073974f5ded8a8413ce73a3aaac3505438a0de1772fcece7f977bb075ba5f1103a953b222d48cf42b4b0f032cd44f469aa677b449ec0d835741ed85918a6652da573ea76f7452992edbbd1db10f138e7be5feef7b3813b08e83c0101433b9c5fd3e281eded9c6babb185627fa3b3e713a87cd8bc0a75d40438003132cddd3853a583cb621921db909a89838b11b42ab33cfc563bd373662689d1bea20b5d5772f1827c2a319d3b77b1bb337239a896b566e8209a99c1b862879d113c3a6be60f90d86cd93892a5449b589140c5b5664f10d8c50d6485820ec204eced06f546b3b18a9a10f6cab07a040757e9d75b94cca3ce90eafdd51052b7e0e525af17ff772e068cee81be0052ec8e04dd3225de44ad9df1cb424ea5e9b404ddde48d83acafb68c71046cb8489c3c3762a8e9ce6cbaca0c93387c915b4ca1448fe36657262d67559826299f1622cc7bb47ec15320e6f0987ef0e4201d87c05d706f808a63dab466bc3f89618b71ef9697f4ec3e74669e2f4870296f2e374c4cb34d12dfbfbd8f44710ddafa87ccfb2b1b249117cd6b2b03a20ff85afd54ddfc03a47a2a51a48c19c8cd79d2bb5cdd89181fc7f969656846146f0de07857ccf9650e74abf4d9cd395e2061fa822a76204f6ab656fb33cecb16347d6b7b44c149c7713ae4906bac11a719b4fec3095260c6e8b4de92e7cff95f2f5e9f66222a76b04effc91d7f5eefd0b6a9ded12ec9b1f2cdd6f336299ab6d48d57eca6e59f07750c9409c75d2542676cca02c09bb11ec5b39ba2a696694e30e2c3a08a0d6da0315332799b9d56496ba9573039995d988748f95f1c101aa25b4f235743cb8a764bbfbfbdbf47a10ddb3407ccf3eb10a4924fdaf557b3af69659c3538a11d89207116d8a06f5ee7e97d3e676deb8606bd983de98d88cde99a03beeb5478489397eaf4de4c6a7479dc1e2a822a70704c2f4d65deb62b4e8874e3149c901c2bc1d05cc17de38088103fd2042d8c6eb4a467289d90a20a3a306f5e67b62544fdd6e32ffdedeb33a2d757cb229be576a0fb3ea2ec5a456d19e7c1007188b79cb4ecfe2a45ffcbed9d6268de04424bcf44305ea896b6e15138cec3cd53285476b413611172ec515aaff8d083ca80f51abaeaf14d219ddad90264d5f296bc8253a528d89744be7caccd8ec3ec17471b1f4e705950b5ff622fc626cff992427d34385046df6ec339d106412af1cb64896be95db38f13741aaec0e4818a80b9c21f430d7b2e066f750bf9c66ec4947f48630eabbf2ae47b1b7bf56f5ee06711f7cf9f0b5ded8815de9fba0029999eca653776237af4d6fc613bc3e4299ec54ad71922fcfca9c6f50ee53caf9a0deb2da49d0e7e404db3a305ddb0e87443e03f2767b3c87bc4549985224117f619979ba068ecea5b6f32f2e4b6a55897f13a309c4ad43d876591e98fb267b4ded345f6b06cc91194bf289fbc7e949bbc169a67a9b7ec21a994013c59d6e0ad3410a8d949dde7429574d3bd6b269a799e40a5f743f12f443f9c5d7e49975d9e61d9d3aa604baec4f46bc1fb4688140e0f5171046a1d489affd96d13a1aaaecc144393915908b3d3a26353c6b4eb239c948406b8eb5dc1b7fd80445ef99d3cc17cd2ec210685e9ade19ec99cf81af7e33c11ae65baf513995a7c3f45d3766bcf5ffafe616c25e25af3a0a77dd10fdeb8b17b3fcc8e6eed13347e26279c926ef75400fb2902ac59d2c0a30c3cf5316b2a6bae95d5a4c345c26d3380406da7e949a3cc313e9fcdcdd74104904fcfd76fca64ee8b18cd50bad6e4804a089efde4438a08c07f6aaabcd3912113a1338fde08a67a4d96b6160c7c3c56eba392ed7624e4da0cd79cf20475011963e10227646621e66da6321995531d59712a013c992d3fff5f7600148e7999d9889fb65943fd2233961a08c363585855101bf793862de741068722c135437a8c9c37f4047402d05bba66291017c3b378562e0e01e6bfb64c0b3dd04a6bc57164e1f72f59f02d75f6e8decba810d6285769fb6f5d396229a1042e8b557450740a62d4da6cd483a1fb60e380a00ee4301c3b29c5168818719b4f121b0eccf05f768c98921dbf6324574719601ca0504ab1f9275cb3a2fb879245c4ecf6b04398dec55591074968163651fe612a882322d95ca10fb2daf75f56220210dbae05a096a4dbf3aea87e6f53560576d4305a5676e4ee79c4f13f541ed37f7794c6257c266d890c55162de7431c2d52ea8b0128aeb446b3295c8b1ee48ba5f99fd3b83df9c1497dbff95bbbf04ddb9666bbb74a03bbc52c7b2a5b36272079b78fcb48e40bbcdd13538ddc7bfd3a020f30201c64f6fcfd30c57747c084b0261c422df49069d100ecc2315698039f25335bf5ea795a6d22c3a07a2e2443d39beb994fda062fd0b7887eccda099cda8d6470f7c98a495c7a6de04945ded96d67e7a00248974cdd7da931b459dce2eb785f1cf76021a6f92b7af3e95c1bab1a80f2b8583be7b250f9c3ebc56f69961f575d877b1431aa5820272dea5a31362f794d8ba0e4c623a76720d9095ed40def66241a72c046e6757b940aafd782f21ed99ec008a07a76f55cd99d3c1d71889bf0426b9b16b897462d6bc08403ea59ca7f2cd50b8fcb43019893ad1e38c626b08a044da3c157b88728626d196ee955503fa95a08f74879538560176ef41be7780397453b5bfcba79510d263a0dba2b53b3d563fb994fd8537a69f9296ff468b8a11a4928411873e7662128d0a674f2e748e60a06883bb9877ccdeeedd9c3ce4029a10c1f6634102a27320b3c2b8ec3c9a0a8591ae5f3697e27937fd4e304b0601c2ec1d0526545e38040f6a394a3377f9052512a86294012fba10a0e9c5b69602162648d8b685045fda9fe02d53de21370d017c4dd9856bc0314aa7fbd10ba5dd04baecf65fc176e6f5a283e8966592317c81cda8624e9fb6a8e61f2a9287c6f7f18abca68140626bd870923aee72a65e3e00eecff4c3ab9c94c73b87371f3821b0eccff9f749fb1021151f496b49f6a822ca2922c23e9bb4b990a8587ea6bcc14dbe693ec97b802a6b3897ebaa62fff999a01e2c22854077ca567f1f4ae645d88ba201550489179f5538a9ff488beeaeed6bae85622ac2e84ea8ec32246ed3c0543c8d949027a2c8abe6629166bc3572012aeccfde3a89d8bc2cee7574c1b32039e2268504a297dbf1d1af9206a010ac489269c3efdd408cd9be7b85ff3a62046409c72ed000558beb38bc11f8e607b273dae8752b50db8df343647ed57bec40d262d37448137ce938eeaeb58abe6b1acbc295f425fc8ca39c1aa72d66a642e2b3cb221c84898eaf91012aaf309539fdc1cd9eaa99c55918ee5b381462304410ec6e4f015a9ac600d58638ff869865202fdbbb62852a8aa5b8cd48123bddbca80da6ac610989d639fdeddb3bd3a2b13b7bab57ba4f3dcd374ad757c933e24b5f7b442e89f2c47248cdf19947dc2e9411237a8974956ea100b5c7cd2eaf323ce01a12699cf239040991f4080d47ecf55e9cd220864c254457ff6826214eba9cad20780395c035c08b359baf0b35ed5ea2390c743c38231229d206cda2163e1049e9535086845cddfdf1048ceb7a519a8ed9c62d5e68dd7438d7958a2948c2062104a6c95e7afd3f89575312dce23b9e3eb126d36601e1ca39a6121ec80dbf578b5698ad4907c7d9e72c153e8b64310a556b0448249617e8bef9dfdd21cdff1a79de7c43fc808701018e9c73a7c081c203be798d04dda67ffd1201771eed5de7ac9b26ff2d61a0c552ece266a0f9bb7ff99ebacb91cc541e6e723598a6d922a19c08e8483f044089796861a662ba0e51850f0c3a0476023baa901f4aed241e7ecb61f6d8df698504243f443bafe803b1810a948bc73104c7deee57ad702ef1d606ae51262f62856331bca074bce863ea04accf3cc82cddfb4073737b234a99bc79419abcc93bbbabfcc1edc0985320dd5a842548ea896d19f43b8edda8ec3c61023ab3bede7454857c5ef6305e3acb5b6297cfb83cf809edb988f7065fa49973f5baf369564353af6fefaa2dafad38f5f7ed62597f4c40cddab6c3616e64f589f657df846b048397690c62d372b642a6514ebc5066d8406f303a2255458c1889bf652c3c766b8974a03becb7773e4db3a77462837bfc317bc7bb62514acb2c3a0837f97303155588b10a2c511e7c043efcee656bf0f28e957fb10147ef97be7780b2741a35bfcba795a61ee4d8db31e23b92c1be0c9416eaddfd247872b43a07ec30501dde7385eb3cc73bf4db66b753fc48cfefc0243ec9eaaf1d53a8bddd9d43a1e3bcab18e020e41a32bd498ba2c081be42e85f16ac406b2f3a4732ece8638ca8c0ec45e885ddc268e43090620f6c6996cff99c6f251e2dd6a3c6f54e37a2ab977d65485f92006f99913ca374ecb21573857bc11167b317136542879e7241b039a64d9bb6a51448178c6589a495dd3cfd3d89f2a03becb7cd3e52b3d9f6113a9094ab8dd0989546d9166fa0bf2a07166c00f4ff932a1db9c45b747cb71e1873c4e35461fd7c102190973d77360af21a222bcb2c95a61ee4c7dbbce29cf962ca5f16d248f96b4ebb6b113389974095cd8f119b248974a1a6fb26945db10f0d8ede79608583aa163e16a5e8bf4ac810fd15094125a28ae352c6b8ecb273b4ab14341076b2bc42822a17c638ae4efff54b0701c9818cf93a2dd8fbc3ea5d6e39a1a1d7828504d6ec874edd8b4f7f8bc9729d0d4897ba1848477c7f174e3209494b8ae0850f283a40c2c57987dba37219ff38402d09dedaaf4a08da9c339b929a2171f49dbb74c51448fcf2a348d3afcb04c9add516250a8c62694a5f063948130baf7a5539090d04d5f44d007f1fb1eb20b50b48e2eac5db7f10c573afeb6d535fb49b9f89648532006df0c5701bcd153f5ad5bb8585b08ab3133a0695af0b02743be4f44e1add7575fba13a83a362ddd6fd3aa24b713903e0e77dba66b256262c5fd0b7ae04dde401818556bc37ddf68717cf5373b565a13062d23a626da3482c8148e74843347a03ce55dbd66d33766b3c9f5f2e89d1f6bc4a81e456628548dd34ad5e8115cda048eddd107330d708d69d647a236f4ac80756c0032495748cd600178c646ba26f0d8882cec772fdee45c4d4a1ffc7fc204ec7385192a402b4c716db6c40264bbb7f8c839d8ebbf9ba854fd7bc49807f8c62d804715fa5e78c7cf1094022768978b7a0ff4856b36fb6d51092af7a7a83ddd929c0e34d61193b13859c08d55ffc0172f5f799a00a8199de8ccf50789fb659a89c8ae84540f9fb8dbb3ea80f51b08da59572726bca4065f9c9ce1c608911e72c017b76057937819ddec943ea2087b5e8d83be05f1f857320122e896457ec1eb757d23a62109c1e7729e80248f989713b0124a80b34ff2394a4b2db45e08922407f17047472a50077c9646bb46f1bf0234cc38ca14b2e0c9a90ffc7aa98486873649269efb501db50be1ede7436a041576a11b6afb130a82ea55e8e32897495c1226840fb107c8c9444e8c16db23762893a5629559e63a1ad90843adb89a08dd3f9f231b6b1be32c1e34f8b3bb75f7ef4f41d3bd6e83ce03bed64d6dbb0b18562892d9c7685835f5f629e17ff65df0ea665d8e020e39ba053650989a7c2be53b332ea38e24dbfe87bb359a3b5cf76da50034ed310fcc246db2119cc6089871a7ba2396187126a349d244e1fb1566bdd9ab6d8ab7fdd6110dcba0989e2466f450d4d2430c1a3b517fc1621acb5d4bb1458f67237ca1e3af16b13a83117dfc31617ff654997c596b54e62f7860d37823789ca9cebea37491068fd7ada99b0e0e433a8ad88bec7b10ab1f755ed5d7b2f4ecda784119c05fdc09c6b8c070c54856bc3810b7f4e56e235b6c215d7b62ec4515150a06633d340f6b4d044eac5095bf45d3aaaec07a0caa8653b98fe1c60deab44ae01e611051e621a9ea38ccfea1178ce55c73b78d7c185e8245e33bb743d317608f656628548ea9aadf1523d3a2647640710ff8ae234ffef940de8db452089483a7f3a0474a19c65c338d13db497f38882cec34598792e309a610aacaac2f119499492a402b41790db36dc09eb2df1cb009dfcde9cb130402ed6cb8e32897418b15a4fa5e713c9cbd5a8548abb11b3a0ff8c4631d26969100d9cb8a295a02ca7887294c7ab76aa66bef2699589db5da4dd0564f7cae865c1d2c03af7843a04bed31482a5b2e0564221b70811e565afa032dbbafd2e968171024f5fb004ddd3252d9ce913ba4563875df92404dd89a13ac705fb34a8ab56782c1094b1e0501f0726fd11854e7ec17915112d1848fe3602fda8af22d2f7627638a0d509bb47b41555cc2a07669bffc8f45b7c05d7a1e15d0ecdabac09d1a1ee950ad2aa046b8874da83a66df42aefb1f29d74b9cb34d1bbfbfb91017a38ddb3a87ccf3eb1b20e11f14455293a07475294b3bf1135d667d78c74e03e99c16369e674f2130717d98389bac39ef999dd4dee59ea8489e2c1af4de4c6dd47c2c1e2a822a7070430014fb3ff62a2e83e1385161f87e35dcd1390c3bc5666dfb456d5927620ad5ee3a862ed013d9821cde97410c71e5e2d46ffdea13a0ed949a0bb3da211070ac88562794f4d85793a07571ff11d4885cd9eb50a7c0dbcb2316ed7c0c592ec481d3aa862aa9f3cf51f1e2a9a105b0a5669332c26a64fd6c96b480721ac11906a8dbb3a03525438a8b1a5cc97f18a891152d90aba36396967e4667e7f5409bca61d890be3c0647a593ba66b25d402792b891191013b7b37a8b4b2a10240a5ae8974c2fd857c2266eca6df425f7c1a8932501142eecca718c6ce618cd3a72181b7e05e6e9ca08c9190c2ff963b3f004dec3904260a5a08a52de67c0e6345b7ca9f04a0e779173af9fbdb6810dcfc608980d8e60bab443eccdca079397e48159fca14a1ce770259f5af4972f70997f13a2ce6bb11ecd83e386fa46602ff920137b8053e22e1caa692ab68d8c3f83014b7e3f969793019a51934e2f4d325b4f2f774c48cc764bbfbfb91f47a3840a5a84ecf33b10a49314eafb2553a4b3285af6aafdfda3a13b4a5e948969c748b0adbb585d8915d037f1fd2e2fe6dff0c3dac11e0aef41c60779e347c381ef50e1fa8f798899fd6a00a95c887b80dcbf662df43decd37afca871648bae2ca03391f428504ee65f98a1e99ee64b4aa303a09ec739bcbd3d17ad82e04bfd359f57560017c1aa0cd6b0112fd9585ec5574bf9b452ce9786d2a8963fda90af18bbaa873c763ae34351702ebebdd191653fb9f3e132cccf224ea76f5b749119da88b5291d1e1c7aff9691628600da3aad931accc74508cd73549fb38b68ac20329c22d6464b336d30d4b401314e977f29cb4c29aac95bad555efb34af651630540dde798b82da7db4114ad4904db6d39fc9a109e5d05a20409a6d84fa5d9bb4948b2393fea2fb6b3c7130415b57441f1100d9553999d4ecfea78114ce8cd4401b2f9ab900a7491064068f57f8c61aaa2459d0a16d7c9e2a53adda6cbd63169fcd510b12fa72350e0780fb73e73bc332f4ea2c56271d1512e896498188c1e85dea81481c9ce5a84bbb3783c72f54266ec62c56a017cf93a620deaecb4cdd131e82c38a866cbb78d85eae33c0747d35ffb104075ba2137b8b53ab2cdeb3e681a76634ea574a1c9cf501124e876f59cd06b186f0966adbeaba5b9009eca44ad739ec294ed5b431a732917443ba5b208225d017ec0d171d301cf5304a27324c72237f38a92100448267e6d888db1d81a9817a6341385d6153eb02aa02e2298aab46ba0ec3383ff73948acd8c65f687ffa89de976c19c8e047c6b086df6c1ba6204fb32790710b0ef4e1e3b060fe208afb55f38854ed6f7864ebf533a25119053fb565f13070e5124c379f5b7ba0b4bd81aa5b356c7f6ec63b68c57cf832216b11250a56900f216177659eb4b2d0efb2ad3fc69ed96e73dcfa065b46663f1f29cb432a7acf0481d5f92bf3150db53ddbca8f5b1ee223c342db509bb445f1fd157ca45d46820f6669112155e631ec1346aeef51e3a07963ccfde33856fabd84d16d3e27471c1f4cf05040765b883c6c7159985b1667ffdd302f143b13d47d28d688b6b8db4d63d9be2595e5cb40951578178e84e09c86d938de9d1951499e7a3e92e953b7692943df662a04a25df560e0915defdbcb63b7aed3c26cab57c9c21a049fb74f575e6a1795ac5e70301cd2654252c7961e7d4533a6f34f6714eb1db35b6aebf69c9c58647de7949629d47d6ed1646d369309a173ad309bc04e7c7d6b0219c20bf3b482d2560bb360fc81e3ecc975ff5cb92625428460964bb2d62175f304a9a13a8a498f9d7d840896b4276fbbb3abbfff5065e948bf6ca7482bb0ef1f6c274dfdfab556a4d5397dea016e849afc9c09c6b3af2da40c77957fb0eb508039e73ac9538f60383eef453660487b62591b1b64ab02e62aeb2173c6a67db94eae93845e72de9cb4562042201ca44cb3a31b2e613579c427e7b2acd32b59f99e090206a62c2846204783fe73ba53e30e2af7cfda062ae850f846b6569b6eeca9cb21668403e9548c542550255a1f517656a577d75a329465ba465b3b0026cc467d2e422f975c317d9efa57600694cd3c1","code":200,"abroad":true}

中间部分好像是加密了还不知是咋的了
最有还有个 "abroad":true

求指导
我在用curl的哪个地方错了

php curl api 网易云音乐

gangdu 10 years, 3 months ago
UN.owen answered 10 years, 3 months ago

方法没错, 参数拼的不对


 $post_data = 'hlpretag=<span class="s-fc7">&hlposttag=</span>&s='. $s . '&type=1&offset=0&total=true&limit=' . $limit;

附完整的代码如下:


 <?php
header("Content-type:text/html;charset=utf-8");
$url= "http://music.163.com/api/search/get/web?csrf_token=";
$s = '简单爱';
$limit = 5;

function curl($url,$s,$limit){
    $curl = curl_init();
    $post_data = 'hlpretag=<span class="s-fc7">&hlposttag=</span>&s='. $s . '&type=1&offset=0&total=true&limit=' . $limit;
    curl_setopt($curl, CURLOPT_URL,$url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);

    $header =array(
        'Host: music.163.com',
        'Origin: http://music.163.com',
        'User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36',
        'Content-Type: application/x-www-form-urlencoded',
        'Referer: http://music.163.com/search/',
    );

    curl_setopt($curl, CURLOPT_HTTPHEADER, $header);

    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    $src = curl_exec($curl);
    curl_close($curl);
    return $src;
}

if(!$s||!$limit){
    $tempArr = array("code"=>-1,"msg"=>"输入参数有误!");
    echo  json_encode($tempArr);
}else{
    echo curl($url,$s,$limit);
}

clipboard.png

======分隔线======
刚挂上代理试了一下, 确实会返回 一串 加密后的内容.

下面为获取到这个 abroad 时的相关代码:
clipboard.png

正在分析 settmusic 函数, 请稍等..

======更新====
settmusic


 (function() {
    function bjQ() {
        var sy = function(iL) {
            if (iL < -128) {
                return sy(128 - (-128 - iL))
            } else if (iL >= -128 && iL <= 127) {
                return iL
            } else if (iL > 127) {
                return sy(-129 + iL - 127)
            } else {
                throw new Error("1001")
            }
        };
        var bjO = function(iL, cl) {
            return sy(iL + cl)
        };
        var bjK = function(Fy, LP) {
            if (Fy == null) {
                return null
            }
            if (LP == null) {
                return Fy
            }
            var lJ = [];
            var bjJ = LP.length;
            for (var i = 0, ck = Fy.length; i < ck; i++) {
                lJ[i] = bjO(Fy[i], LP[i % bjJ])
            }
            return lJ
        };
        var bjG = function(FF) {
            if (FF == null) {
                return FF
            }
            var lJ = [];
            var bjF = FF.length;
            for (var i = 0, ck = bjF; i < ck; i++) {
                lJ[i] = sy(0 - FF[i])
            }
            return lJ
        };
        var bjC = function(Mb, Cw) {
            Mb = sy(Mb);
            Cw = sy(Cw);
            return sy(Mb ^ Cw)
        };
        var bdh = function(CA, Mg) {
            if (CA == null || Mg == null || CA.length != Mg.length) {
                return CA
            }
            var lJ = [];
            var bjz = CA.length;
            for (var i = 0, ck = bjz; i < ck; i++) {
                lJ[i] = bjC(CA[i], Mg[i])
            }
            return lJ
        };
        var bdk = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
        var bjr = function(dE) {
            var wM = [];
            wM.push(bdk[dE >>> 4 & 15]);
            wM.push(bdk[dE & 15]);
            return wM.join("")
        };
        var bjp = function(tO) {
            var ck = tO.length;
            if (tO == null || ck < 0) {
                return new String("")
            }
            var wM = [];
            for (var i = 0; i < ck; i++) {
                wM.push(bjr(tO[i]))
            }
            return wM.join("")
        };
        var bdn = function(Gl) {
            if (Gl == null || Gl.length == 0) {
                return Gl
            }
            var Mv = new String(Gl);
            var lJ = [];
            var ck = Mv.length / 2;
            var cl = 0;
            for (var i = 0; i < ck; i++) {
                var ud = parseInt(Mv.charAt(cl++), 16) << 4;
                var tY = parseInt(Mv.charAt(cl++), 16);
                lJ[i] = sy(ud + tY)
            }
            return lJ
        };
        var bjl = function(dL) {
            if (dL == null || dL == undefined) {
                return dL
            }
            var CE = encodeURIComponent(dL);
            var tO = [];
            var bdq = CE.length;
            for (var i = 0; i < bdq; i++) {
                if (CE.charAt(i) == "%") {
                    if (i + 2 < bdq) {
                        tO.push(bdn(CE.charAt(++i) + "" + CE.charAt(++i))[0])
                    } else {
                        throw new Error("1009")
                    }
                } else {
                    tO.push(CE.charCodeAt(i))
                }
            }
            return tO
        };
        var bje = function(po) {
            var cQ = 0;
            cQ += (po[0] & 255) << 24;
            cQ += (po[1] & 255) << 16;
            cQ += (po[2] & 255) << 8;
            cQ += po[3] & 255;
            return cQ
        };
        var bzE = function(cQ) {
            var po = [];
            po[0] = cQ >>> 24 & 255;
            po[1] = cQ >>> 16 & 255;
            po[2] = cQ >>> 8 & 255;
            po[3] = cQ & 255;
            return po
        };
        var bjc = function(dW, ME, ck) {
            var pr = [];
            if (dW == null || dW.length == 0) {
                return pr
            }
            if (dW.length < ck) {
                throw new Error("1003")
            }
            for (var i = 0; i < ck; i++) {
                pr[i] = dW[ME + i]
            }
            return pr
        };
        var MI = function(dW, ME, GC, bja, ck) {
            if (dW == null || dW.length == 0) {
                return GC
            }
            if (GC == null) {
                throw new Error("1004")
            }
            if (dW.length < ck) {
                throw new Error("1003")
            }
            for (var i = 0; i < ck; i++) {
                GC[bja + i] = dW[ME + i]
            }
            return GC
        };
        var biV = function(ck) {
            var cK = [];
            for (var i = 0; i < ck; i++) {
                cK[i] = 0
            }
            return cK
        };
        var biU = [82, 9, 106, -43, 48, 54, -91, 56, -65, 64, -93, -98, -127, -13, -41, -5, 124, -29, 57, -126, -101, 47, -1, -121, 52, -114, 67, 68, -60, -34, -23, -53, 84, 123, -108, 50, -90, -62, 35, 61, -18, 76, -107, 11, 66, -6, -61, 78, 8, 46, -95, 102, 40, -39, 36, -78, 118, 91, -94, 73, 109, -117, -47, 37, 114, -8, -10, 100, -122, 104, -104, 22, -44, -92, 92, -52, 93, 101, -74, -110, 108, 112, 72, 80, -3, -19, -71, -38, 94, 21, 70, 87, -89, -115, -99, -124, -112, -40, -85, 0, -116, -68, -45, 10, -9, -28, 88, 5, -72, -77, 69, 6, -48, 44, 30, -113, -54, 63, 15, 2, -63, -81, -67, 3, 1, 19, -118, 107, 58, -111, 17, 65, 79, 103, -36, -22, -105, -14, -49, -50, -16, -76, -26, 115, -106, -84, 116, 34, -25, -83, 53, -123, -30, -7, 55, -24, 28, 117, -33, 110, 71, -15, 26, 113, 29, 41, -59, -119, 111, -73, 98, 14, -86, 24, -66, 27, -4, 86, 62, 75, -58, -46, 121, 32, -102, -37, -64, -2, 120, -51, 90, -12, 31, -35, -88, 51, -120, 7, -57, 49, -79, 18, 16, 89, 39, -128, -20, 95, 96, 81, 127, -87, 25, -75, 74, 13, 45, -27, 122, -97, -109, -55, -100, -17, -96, -32, 59, 77, -82, 42, -11, -80, -56, -21, -69, 60, -125, 83, -103, 97, 23, 43, 4, 126, -70, 119, -42, 38, -31, 105, 20, 99, 85, 33, 12, 125];
        var wl = 64;
        var GQ = 64;
        var bdz = 4;
        var biS = function(lV) {
            var bdB = [];
            if (lV == null || lV == undefined || lV.length == 0) {
                return biV(GQ)
            }
            if (lV.length >= GQ) {
                return bjc(lV, 0, GQ)
            } else {
                for (var i = 0; i < GQ; i++) {
                    bdB[i] = lV[i % lV.length]
                }
            }
            return bdB
        };
        var biQ = function(GV) {
            if (GV == null || GV.length % wl != 0) {
                throw new Error("1005")
            }
            var MZ = [];
            var cl = 0;
            var biC = GV.length / wl;
            for (var i = 0; i < biC; i++) {
                MZ[i] = [];
                for (var j = 0; j < wl; j++) {
                    MZ[i][j] = GV[cl++]
                }
            }
            return MZ
        };
        var biA = function(bdV) {
            var ud = bdV >>> 4 & 15;
            var tY = bdV & 15;
            var cl = ud * 16 + tY;
            return biU[cl]
        };
        var bec = function(Ni) {
            if (Ni == null) {
                return null
            }
            var bed = [];
            for (var i = 0, ck = Ni.length; i < ck; i++) {
                bed[i] = biA(Ni[i])
            }
            return bed
        };
        var biq = function(vR, lV) {
            if (vR == null) {
                return null
            }
            if (vR.length == 0) {
                return []
            }
            if (vR.length % wl != 0) {
                throw new Error("1005")
            }
            lV = biS(lV);
            var Np = lV;
            var Nq = biQ(vR);
            var CR = [];
            var bip = Nq.length;
            for (var i = 0; i < bip; i++) {
                var Nw = bec(Nq[i]);
                Nw = bec(Nw);
                var Nx = bdh(Nw, Np);
                var bio = bjK(Nx, bjG(Np));
                Nx = bdh(bio, lV);
                MI(Nx, 0, CR, i * wl, wl);
                Np = Nq[i]
            }
            var bef = [];
            MI(CR, CR.length - bdz, bef, 0, bdz);
            var ck = bje(bef);
            if (ck > CR.length) {
                throw new Error("1006")
            }
            var lJ = [];
            MI(CR, 0, lJ, 0, ck);
            return lJ
        };
        var bii = function(Hg, bF) {
            if (Hg == null) {
                return null
            }
            var beo = new String(Hg);
            if (beo.length == 0) {
                return []
            }
            var vR = bdn(beo);
            if (bF == null || bF == undefined) {
                throw new Error("1007")
            }
            var lV = bjl(bF);
            return biq(vR, lV)
        };
        this.bhW = function(Hg, bF) {
            var bhU = bii(Hg, bF);
            var NH = new String(bjp(bhU));
            var Hi = [];
            var bhR = NH.length / 2;
            var cl = 0;
            for (var i = 0; i < bhR; i++) {
                Hi.push("%");
                Hi.push(NH.charAt(cl++));
                Hi.push(NH.charAt(cl++))
            }
            return Hi.join("")
        }
    }
    window.settmusic = (new bjQ).bhW
})();

调用这个方法时的第二个参数是由下面的代码组合出来的:

clipboard.png

其作用是从页面中某个元素中取它的一个属性值 data-xname .

URL为: http://music.163.com/search/
clipboard.png

我这边得到的值是: fuck~#$%^&*(458
所以最终解密的时候是 settmusic(cc.result, 'fuck~#$%^&*(458')
解密之后,继续使用 decodeURIComponent 还原 URL编码, 然后就可以用 json_decode 得到原来的内容了.

PS: 如果你要在PHP中用,那么你需要将那个 settmusic 转换为相应的php代码.

========================================

附楼主帖的内容解密出来之后的内容


 {"songCount":38,"songs":[{"id":5244310,"name":"千千阙歌","artists":[{"id":7225,"name":"陈慧娴","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0}],"album":{"id":511459,"name":"Magic Cover","artist":{"id":0,"name":"","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0},"publishTime":1253203200000,"size":48,"copyrightId":5003,"status":1,"picId":45079976755935},"duration":299416,"copyrightId":7003,"status":1,"alias":[],"fee":0,"mvid":0,"rtype":0,"rUrl":null,"ftype":0},{"id":22852027,"name":"千千阙歌","artists":[{"id":7225,"name":"陈慧娴","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p3.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0}],"album":{"id":2101003,"name":"娴情时间","artist":{"id":0,"name":"","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0},"publishTime":1293811200004,"size":16,"copyrightId":5003,"status":1,"picId":1799900534674612},"duration":298867,"copyrightId":7003,"status":1,"alias":[],"fee":0,"mvid":0,"rtype":0,"rUrl":null,"ftype":0},{"id":5275029,"name":"千千阙歌","artists":[{"id":7225,"name":"陈慧娴","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0}],"album":{"id":513257,"name":"20世纪光辉特选18首","artist":{"id":0,"name":"","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0},"publishTime":915120000004,"size":18,"copyrightId":5003,"status":1,"picId":102254581400446},"duration":302838,"copyrightId":7003,"status":1,"alias":[],"fee":0,"mvid":0,"rtype":0,"rUrl":null,"ftype":0},{"id":211083,"name":"千千阙歌(Live) - live","artists":[{"id":7225,"name":"陈慧娴","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0}],"album":{"id":21410,"name":"活出生命 II 演唱会","artist":{"id":0,"name":"","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0},"publishTime":1208275200000,"size":27,"copyrightId":5003,"status":1,"picId":111050674418590},"duration":347507,"copyrightId":7003,"status":1,"alias":[],"fee":0,"mvid":0,"rtype":0,"rUrl":null,"ftype":0},{"id":322311,"name":"千千阙歌","artists":[{"id":10522,"name":"岳薇","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0}],"album":{"id":31832,"name":"粤语经典II","artist":{"id":0,"name":"","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p3.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0},"publishTime":1197993600000,"size":13,"copyrightId":0,"status":1,"picId":89060441867059},"duration":315611,"copyrightId":0,"status":1,"alias":[],"fee":0,"mvid":0,"rtype":0,"rUrl":null,"ftype":0},{"id":29999856,"name":"千千阙歌","artists":[{"id":2153,"name":"常石磊","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0}],"album":{"id":2629054,"name":"常石磊合集","artist":{"id":0,"name":"","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0},"publishTime":1375286400007,"size":44,"copyrightId":0,"status":1,"picId":5647091720334190},"duration":281913,"copyrightId":0,"status":0,"alias":[],"fee":0,"mvid":0,"rtype":0,"rUrl":null,"ftype":0},{"id":28240690,"name":"千千阙歌","artists":[{"id":181002,"name":"DJ小可","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0}],"album":{"id":2759218,"name":"DJ小可 ⑥独孤求嗨","artist":{"id":0,"name":"","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0},"publishTime":1203868800007,"size":15,"copyrightId":0,"status":0,"picId":5964850580691709},"duration":254406,"copyrightId":0,"status":0,"alias":[],"fee":0,"mvid":0,"rtype":0,"rUrl":null,"ftype":0},{"id":250807,"name":"千千阙歌","artists":[{"id":8193,"name":"全璟璟","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0}],"album":{"id":25072,"name":"爱与施坦威","artist":{"id":0,"name":"","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0},"publishTime":1239552000000,"size":12,"copyrightId":0,"status":1,"picId":130841883718500},"duration":298135,"copyrightId":0,"status":1,"alias":[],"fee":0,"mvid":0,"rtype":0,"rUrl":null,"ftype":0},{"id":5255707,"name":"千千阙歌","artists":[{"id":7225,"name":"陈慧娴","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0}],"album":{"id":512090,"name":"乐坛班霸-宝丽金华纳十年对垒","artist":{"id":0,"name":"","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0},"publishTime":1183910400000,"size":50,"copyrightId":5003,"status":1,"picId":59373627916977},"duration":298789,"copyrightId":7003,"status":1,"alias":[],"fee":0,"mvid":0,"rtype":0,"rUrl":null,"ftype":0},{"id":5232852,"name":"千千阙歌","artists":[{"id":4771,"name":"彭柯","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p3.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0}],"album":{"id":510746,"name":"一人一首成名曲","artist":{"id":0,"name":"","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0},"publishTime":1318694400000,"size":14,"copyrightId":5003,"status":1,"picId":102254581396471},"duration":298789,"copyrightId":7003,"status":1,"alias":[],"fee":0,"mvid":0,"rtype":0,"rUrl":null,"ftype":0},{"id":28612950,"name":"千千阙歌","artists":[{"id":10204,"name":"杨千嬅","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0}],"album":{"id":2848425,"name":"冬天的故事","artist":{"id":0,"name":"","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p3.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0},"publishTime":943977600000,"size":12,"copyrightId":0,"status":0,"picId":5909874999550701},"duration":250723,"copyrightId":0,"status":0,"alias":[],"fee":0,"mvid":0,"rtype":0,"rUrl":null,"ftype":0},{"id":278129,"name":"千千阙歌","artists":[{"id":8940,"name":"马小倩","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0}],"album":{"id":27607,"name":"落花","artist":{"id":0,"name":"","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0},"publishTime":1288368000000,"size":12,"copyrightId":0,"status":1,"picId":128642860455898},"duration":242991,"copyrightId":0,"status":1,"alias":[],"fee":0,"mvid":0,"rtype":0,"rUrl":null,"ftype":0},{"id":101304,"name":"千千阙歌","artists":[{"id":3269,"name":"侯长青","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0}],"album":{"id":9917,"name":"红尘缘","artist":{"id":0,"name":"","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0},"publishTime":1160409600000,"size":12,"copyrightId":0,"status":1,"picId":111050674418608},"duration":247562,"copyrightId":0,"status":1,"alias":[],"fee":0,"mvid":0,"rtype":0,"rUrl":null,"ftype":0},{"id":5231943,"name":"千千阙歌","artists":[{"id":122455,"name":"群星","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0}],"album":{"id":510693,"name":"琴与诗","artist":{"id":0,"name":"","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p3.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0},"publishTime":1324224000000,"size":13,"copyrightId":0,"status":1,"picId":87960930235896},"duration":331337,"copyrightId":0,"status":1,"alias":[],"fee":0,"mvid":0,"rtype":0,"rUrl":null,"ftype":0},{"id":73449,"name":"千千阙歌","artists":[{"id":2249,"name":"陈林","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p3.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0}],"album":{"id":7121,"name":"半梦半醒之间","artist":{"id":0,"name":"","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p3.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0},"publishTime":943977600000,"size":15,"copyrightId":0,"status":1,"picId":101155069756151},"duration":304353,"copyrightId":0,"status":1,"alias":[],"fee":0,"mvid":0,"rtype":0,"rUrl":null,"ftype":0},{"id":5258649,"name":"千千阙歌","artists":[{"id":7225,"name":"陈慧娴","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p3.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0}],"album":{"id":512271,"name":"金曲百分百(下)","artist":{"id":0,"name":"","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p3.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0},"publishTime":1156694400000,"size":50,"copyrightId":5003,"status":1,"picId":36283883733434},"duration":300173,"copyrightId":7003,"status":1,"alias":[],"fee":0,"mvid":0,"rtype":0,"rUrl":null,"ftype":0},{"id":140518,"name":"千千阙歌","artists":[{"id":4734,"name":"潘绍麟","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0}],"album":{"id":13988,"name":"情醉","artist":{"id":0,"name":"","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0},"publishTime":1230220800000,"size":13,"copyrightId":0,"status":1,"picId":47279000006650},"duration":328228,"copyrightId":0,"status":1,"alias":[],"fee":0,"mvid":0,"rtype":0,"rUrl":null,"ftype":0},{"id":388521,"name":"千千阙歌","artists":[{"id":13319,"name":"小米组合","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p3.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0}],"album":{"id":38485,"name":"经典再现","artist":{"id":0,"name":"","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0},"publishTime":1219334400000,"size":13,"copyrightId":0,"status":1,"picId":38482906988915},"duration":232490,"copyrightId":0,"status":1,"alias":[],"fee":0,"mvid":0,"rtype":0,"rUrl":null,"ftype":0},{"id":388548,"name":"千千阙歌","artists":[{"id":13319,"name":"小米组合","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p3.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0}],"album":{"id":38487,"name":"美丽的梦","artist":{"id":0,"name":"","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p3.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0},"publishTime":1104508800000,"size":13,"copyrightId":0,"status":1,"picId":52776558146667},"duration":232490,"copyrightId":0,"status":1,"alias":[],"fee":0,"mvid":0,"rtype":0,"rUrl":null,"ftype":0},{"id":212233,"name":"千千阕歌","artists":[{"id":7225,"name":"陈慧娴","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0}],"album":{"id":21506,"name":"千千阙歌","artist":{"id":0,"name":"","picUrl":null,"alias":[],"albumSize":0,"picId":0,"trans":null,"img1v1Url":"http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0},"publishTime":788889600000,"size":16,"copyrightId":5003,"status":1,"picId":125344325579601},"duration":302263,"copyrightId":7003,"status":1,"alias":[],"fee":0,"mvid":0,"rtype":0,"rUrl":null,"ftype":0}]}

====================再次更新============
js转php后的代码:


 php


 <?php

    function sy($iL) {
        if ($iL < -128) {
            return sy(128 - (-128 - $iL));
        } else if ($iL >= -128 && $iL <= 127) {
            return $iL;
        } else if ($iL > 127) {
            return sy(-129 + $iL - 127);
        }
    };

    function bjl($dL) {
        $ret = array();

        $len = strlen($dL);

        for($i=0; $i<$len; $i++){
            $ret[] = ord(substr($dL, $i, 1));
        }

        return $ret;
    };

    //将hex字符串转换为 数组
    function bdn($Gl) {

        $lJ = array();
        $bin = hex2bin($Gl);
        $len = strlen($bin);

        for($i=0; $i<$len; $i++){
            $lJ[] = sy(ord(substr($bin, $i, 1)));
        }

        return $lJ;
    };


    function biS($lV) {
        $bdB = array();

        $len = count($lV);

        for ($i = 0; $i < 64; $i++) {
            $bdB[$i] = $lV[$i % $len];
        }

        return $bdB;
    };

    function biQQ($GV) {
        $MZ = array();
        $cl = 0;
        $biC = count($GV) / 64;
        for ($i = 0; $i < $biC; $i++) {
            $MZ[$i] = array();
            for ($j = 0; $j < 64; $j++) {
                $MZ[$i][$j] = $GV[$cl++];
            }
        }
        return $MZ;
    };

    $biU = [82, 9, 106, -43, 48, 54, -91, 56, -65, 64, -93, -98, -127, -13, -41, -5, 124, -29, 57, -126, -101, 47, -1, -121, 52, -114, 67, 68, -60, -34, -23, -53, 84, 123, -108, 50, -90, -62, 35, 61, -18, 76, -107, 11, 66, -6, -61, 78, 8, 46, -95, 102, 40, -39, 36, -78, 118, 91, -94, 73, 109, -117, -47, 37, 114, -8, -10, 100, -122, 104, -104, 22, -44, -92, 92, -52, 93, 101, -74, -110, 108, 112, 72, 80, -3, -19, -71, -38, 94, 21, 70, 87, -89, -115, -99, -124, -112, -40, -85, 0, -116, -68, -45, 10, -9, -28, 88, 5, -72, -77, 69, 6, -48, 44, 30, -113, -54, 63, 15, 2, -63, -81, -67, 3, 1, 19, -118, 107, 58, -111, 17, 65, 79, 103, -36, -22, -105, -14, -49, -50, -16, -76, -26, 115, -106, -84, 116, 34, -25, -83, 53, -123, -30, -7, 55, -24, 28, 117, -33, 110, 71, -15, 26, 113, 29, 41, -59, -119, 111, -73, 98, 14, -86, 24, -66, 27, -4, 86, 62, 75, -58, -46, 121, 32, -102, -37, -64, -2, 120, -51, 90, -12, 31, -35, -88, 51, -120, 7, -57, 49, -79, 18, 16, 89, 39, -128, -20, 95, 96, 81, 127, -87, 25, -75, 74, 13, 45, -27, 122, -97, -109, -55, -100, -17, -96, -32, 59, 77, -82, 42, -11, -80, -56, -21, -69, 60, -125, 83, -103, 97, 23, 43, 4, 126, -70, 119, -42, 38, -31, 105, 20, 99, 85, 33, 12, 125];
    function biA($bdV) {
        global $biU;
        $ud = $bdV >> 4 & 15;
        $tY = $bdV & 15;
        $cl = $ud * 16 + $tY;
        return $biU[$cl];
    };

    function bec($Ni) {
        $bed = array();
        for ($i = 0, $ck = count($Ni); $i < $ck; $i++) {
            $bed[$i] = biA($Ni[$i]);
        }
        return $bed;
    };

    function bdh($CA, $Mg) {
        if (count($CA) != count($Mg)) {
            return $CA;
        }
        $lJ = array();
        $bjz = count($CA);
        for ($i = 0, $ck = $bjz; $i < $ck; $i++) {
            $lJ[$i] = bjC($CA[$i], $Mg[$i]);
        }
        return $lJ;
    };

    function bjC($Mb, $Cw) {
        return sy(sy($Mb) ^ sy($Cw));
    };

    function bjO($iL, $cl) {
        return sy($iL + $cl);
    };

    function bjG($FF) {
        $lJ = array();
        $bjF = count($FF);
        for ($i = 0, $ck = $bjF; $i < $ck; $i++) {
            $lJ[$i] = sy(0 - $FF[$i]);
        }
        return $lJ;
    };

    function bjK($Fy, $LP) {
        $lJ = array();
        $bjJ = count($LP);
        for ($i = 0, $ck = count($Fy); $i < $ck; $i++) {
            $lJ[$i] = bjO($Fy[$i], $LP[$i % $bjJ]);
        }
        return $lJ;
    };

    function MI($dW, $ME, $GC, $bja, $ck) {
        for ($i = 0; $i < $ck; $i++) {
            $GC[$bja + $i] = $dW[$ME + $i];
        }
        return $GC;
    };

    function biq($vR, $lV) {
        $lV = biS($lV);
        $Np = $lV;
        $Nq = biQQ($vR);
        $CR = array();
        $bip = count($Nq);
        for ($i = 0; $i < $bip; $i++) {
            $Nw = bec($Nq[$i]);
            $Nw = bec($Nw);
            $Nx = bdh($Nw, $Np);
            $bio = bjK($Nx, bjG($Np));
            $Nx = bdh($bio, $lV);
            for($ii=0; $ii<64; $ii++){
                $CR[$ii + ($i * 64)] = $Nx[$ii];
            }
            $Np = $Nq[$i];
        }
        $bef = array();
        for($ii=0; $ii<4; $ii++){
            $bef[$ii] = $CR[(count($CR) - 4) + $ii];
        }

        $ck = bje($bef);
        $lJ = array();

        for($ii=0; $ii<$ck; $ii++){
            $lJ[$ii] = $CR[$ii];
        }
        return $lJ;
    }

    function bii($Hg, $bF) {
        return biq(bdn($Hg), bjl($bF));
    };

    function bje($po) {
        $cQ = 0;
        $cQ += ($po[0] & 255) << 24;
        $cQ += ($po[1] & 255) << 16;
        $cQ += ($po[2] & 255) << 8;
        $cQ += $po[3] & 255;
        return $cQ;
    };

    function bjp($tO) {
        $ck = count($tO);
        $wM = array();
        for ($i = 0; $i < $ck; $i++) {
            $wM[] = bjr($tO[$i]);
        }
        return implode('', $wM);
    };

    $bdk = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
    function bjr($dE) {
        global $bdk;
        $wM = array();
        $wM[] = $bdk[$dE >> 4 & 15];
        $wM[] = $bdk[$dE & 15];
        return implode('', $wM);
    };

    function settmusic($Hg, $bF) {
        return hex2bin(bjp(bii($Hg, $bF)));
    }

    $a = '35b1748964afb6f6ab00803a077c655187b4143255a26acf1ae8550d3b81b3e8427b50a0491ad4bbaf1fb194773bb1cf12f5927264e2a79e3a654e66de21621409a8bc55fc25855d158974acfbfb85921f5e85e63d8582cfb46dbdd5ef1c1b1f9f30a71052ca24e525ca07b8bf5efd136d3bbe9b523112c507e883dee72dff7ccb6eedf5e7156254603a0425679173a89972e3a421ed12bc00aa576b6f5e374b0ae24815b42d6e48fe3402e60de722c9410999cc62db6bbb6dbcf632f16f6966514a8c2ca0ada0f93cc415398899c409ed1e380455039965a08ff22795ccd3f4b0efb4f2e3743ccb34d1bbfbfb5b010b2140af407c43b2b1b2167e7c9cb27b3a7872ec3adda23e50cf057357eb733a5344979a393704c964e01f7a3ac6d99a48a993ba0da5bd54896285aab14dc6a8066d9c25a85d3789d165c51e699d65d8b18187bc87f939038dcbd6926bdddada62480a4edfe8b09c8e89f2c42848d9980621dce6d13923568974956e4eefffa06b131a792d98cf6383c05b57171a356b7c8597ec628eaf79eb32b9659cc72ec7dd10a14be7def1eb5e95c035e08bfc65a55535517ea2390c743c38237267ab97eaec5f286a73adb677ea898bfb1200804d29115142b0c3d72d2adbddf238cb04fcfdf16122100448c05e7afd3f89173b5f68e2e7b63eb126d36601e14d567f4e6691a7ff2de7e8b58314897983571fec1813c6a8c1afa0e97943764750da963e1022ee464010682d34d9fce777be4f4e9da0953b4eebf1cfd87e113033683bf436653964dd48b1df49cda8a60e7597bc9d90f1f55499a55beef9e7f7c9980efbf612fbbb625742b71fea36b694d2401eb5551a2f10663cbca76716070a48e430627c993f72a63bce5cdea08ae30e4e66e3f6b12c7506e2cd822ba0041701b75038fdb62a42385bd0b7a4040d57f4526b8731cca0574401cf1a19169563d98c0abce8b5eb761a2b13051895a15b7918857e3bb11d5ff5f687947e34fa6b954eee4f21076e6294cd9df16f04a26447a8805f031711c9047cf2fd4e5e3713d9ce0ef11d13a25f7b048962cda5d6fc7ba613b18116c7c9a7d785a53dd3302a37ff3024125fa0a0ec336538b2ed11401395f672cb629dd801473b343a6b01e21e953a3173f2ae83300989b40b29bb2f6670b87caf737e7fa0eed6df8638bf53c3251149e9fb9f5f1307cbede0367cf5a59d0bee3af9b76cd1f8dba5816916b1840d1ada34b4ac0ed1658c7361bafb8c787aaa3c2a3cb680ed96e7eacf5765b40b63f1749cb4c2a7acf0bacfb4f6bf3102d953ddecf5c310372c84dfdd9e38bbded659a862fd10dc7c9fe19915144f35c92688dc186440316e3f1dec0dbd04bbd95292a705d1f73b9930fdc17104db8948d904a3a02c44c985ba09e917ecd3e12c6b72667f8e5f83eecfc1bea2165b578b091547afde38f18c9a5c52e9da040789c9373a05fb34db210d9ea789c334391e20a53e0ec3ddb204fde27873728d89032deebcb61a8eedb226de16f1a5cdcd49fbf26279229a8702ccd8f4d8c9058aa1f84da6cdabaca43670fd6eb71e8180cc6636a5ac5bd757dd34aa8e8e20baa8fb367b693009d93a3c09bc048940f99e219c8ea49c55e63ac8100894b35b11c2d623338c74e03e39fd2c8bd34e68de894904bf7139472e2c190143054b796e8c2a7c76174e069c4de8067104dd891e688c1040972e62bce8a438a8161f76e3b3cd130a3ebc5b25da8be3748b74ff4bdea885e387a2138c3ee055c96d9cd8ddbaff69920d466a10965b26230231b0e344b8c6bcb59196ec148571edd155bb746518c999071aa8958b59fe5a07bb5d33328cf55b97ec85952ff47cf93437cdeaec30a0f2a2b2d53885728cb7f68562787b5748d36dfb101798752119b8610de885eb33d91afdaa1a02ad8bb85e0dc5f6036e4a9c0abc936420ec02ccbc34aa177257a6f179a8b8d31ff1cacee88578e834f99c8e23d39f576e9a2157af8e2995dd17f212a709cca7d6133a03c08afe36021ea8c5fbe67cd51078e27e30b14026841ec8b1f5a653d8e660c0f90b85ea7fca9ccca004b2597eb2091385b6ad1fa535cdd75749a18ce2f915b1be9eed2288f69977f9668c22857334620c2f0da81f01e6ba07d336b390a0c0989a7968781420cd7453c955f75b55a3fd6a60ddd03afa2d1df1fcaedb7830cd4e1ac4724874089dd7697adb9fde03a2f109de299feb89d5aa1f474a7f2b04a65f0d502a669df54b306213b3e84520f69e2ddee58565bfb66e304d55b4ca4960b0420de04adb8b9187528708e634a69fb1cdd7aa1a17137aaf057c964dcb04f1511fb4293ac6d89cb1bccc0aa03748ea10c3458ef63dca57815d13e9d1969c50287ccfb45beae0655e2e13a8c1a5bac57c6b321fdfd1c9a89112bcf72d8df62f1d05a5b62596adcaca072dd221e43dde5f8554cf9a368bb313065fa6ee112e2c395d31046134f53517baa6d60b7c09d7b17a661cb9f8644389a60a8b098fe7432b994816e3fba07b44ed6345af512ad875ff75a7b8bbbeaf07682c12a0a899dd9aa31d053ada834e00e6792ea88e29d0a5ab7ec5097f62fbdb0139ac0261de799a26a86bc181717f0baa67d54a3195c6da67b14eecbe3bce8a173b9f5f1f9d729f39b08a656b85063a3a8bfbac6821377430645474ee0ea6459f3c555574a32c4ba0954431e28734a3def1b3333c97abc63a4fd4deb1b144d6070ac79054e2c0cddf6940042a01d64de63ab43e441385b363abc08717ffb62497ecb8753d8597a785047a71441aa53e9ec1af7cc237dd925754606b04bf41c0d6afb20e68a07e95c99bd555255598f55b65d3d1f915017c3b2dffba7cee4f3e11abb164716d01cf05042e57dafc90a94de3062ad5032615eaf44d4004d38dbc32d2107496af1cdf48e23f04dd6289f16456b4a64107a2473bdeccb2afed673830a3c73b324039c15ff03683a1f504fb137cc8aaf57c7971aa38e720b589c7815d89fb2c02999947a63b7762cd9c53da45c6ec3e3d13850bd676443077135b734e13c18115c17132647688f612d81a660e22dd7f874d3c0374fd205587a2964998b724b07f6199cbba1f8ece440a2b2bc654ea551afd6a0d37d03a28089398da19570b5fcd48e7b6baee74080eccac7a779fad76bb569aa603504ec91a48cd13c5e31f65d3484e3a0f5ac7f73a189991f1c53ac0af21ecb33a01c014518f699cd27e6106f432966a89743dec998baeaa62c913e7d1c1af50b57ccf96575b31658e13c6627e9c596548d5b2d323d106f52f56ecba2d715bbf43de9ce383972dcae9a7bb55da5ed0e7ae040934c2d6db7f969c5ff1eeb4eb2cb15d310475c7f535777f10b36f9d373c9624665a4af8d1cfde38131a09c4ad4317fa597949fba07b44ed2f8e6ba1cc91ac4b74bbfbcde976bb4e2cb1a0629edd9aa31d05d856aafd19eec9a6466138c3accf33a740eaa8954671070f298c407aec3032d840728591b3698633a5b32fd731b1cea307bebd5990844b318812a00d5193926ced6b6e72d28b21a0958510dc36cfe86385dd7fe9b320623aeb104076cf85041478bfe6adb5313ed16a00392b89114467d6d34d320237a4b1f5f1dedbc06c123bb240dd7fadafa68504c9e0370fa73a041aea8142fd39967f495f9b7ccf3e5fe67fda7c117c0ab19c10a53c0dc8f238357a0eef653a658c07d3bf08a185568a2f7f404514d3a074adc9c1d3b6b5af9402fa1ce304c130c79124adb8d7d70f4b134789760d03c2e40d2efffda5427a57651e3ecbdd2f22c21f476f211362209dd6bfbcc1e38b388340569c6bd14e9a37dc72f5f104429f44e23bedda4124de74ccfba119ba408cdd2dc8dad377d79a6ba0cc539c379962a0fb74abaf9004a6c8d7d3235148a803e2ab464e17e9d91dac18ee08f58551c5abc1db69179c77d77aa41713cd9431531402bacd920bd8e66929d56426afc9c1d687d38affe6113e987604a08906777c4840a0cb3834d4cc3ac5d53e943ae77e3ec090ab73eccf0534bbcde2524ba685e2afe695f1e986ef9ca0c6a4ba9713c1b349c9a0a792a80f2b4a6255a01a3b4d0b516aa44f1637a789b3c066d1db3baae79f405bc2d1e02f760d1879ee2d108595a0516241a6e395eced79f5aaa5570b801e317fdf09ec483b89555076c4ca44c2319ebaf40cb10d89d18dbc7608e4aa62c98c8d567c3bcefade6b5d81defba0028c76bc7c813a623a44816f73ff7e39c899a241ad715b4243a3b32050962db3de62ad3cda61d0adae04dddb6fd6dd7f969c3eebf276b09e66bc6675f18b24117fa187fdd706b5ceafb2572fb20b5b3e897f130509c4ad0817664ecb98fba087085163876b48cce4ac4bf289fbcdad76bb4e69a67a9b1fa13b993a3204616e0ad3df3ee4649dbb742a57f93baf3e6480c88707e2537b8a029fbb74405c4d95cd2d2e417ca695bab48146bc1fb4d93ba7e040171046a1d489affd66943a44aaecc1f9b67b3d905d3d40262a3ca099abe2a64ba0622ea6dc7dcc0d04c11472e6cb0da0ff1e10685e848919ec99cf8baf3e33b41ae65baf513995a736015d8566bcf58ea51e2ac24c259c3aff77622199ba3b34a5bac8cbee94903ee2a80ef1ddef75a8410a902ac5f1ae0a30c3cfca163ea6e3e95d5a4c345c26d37c0406297e949ab03ac62dfc68ddf210d704ab2998c2a6303eb18cd50be918d204ddde9ba34438a0f1a0f6aaab855512113a134857e48a0ba475ad6160c7c3c514ba3913d7624eaf07de79cf24475011c13ea6c2b86862d366da632199335f2c9735d9c63892d3f57c8c3daa4853f004b3eef353e315c9a8970e2fb3475f945da7fe1b88c36a961613cdd3c111fcb36b1373d6f40381b22444823d3ab85e5aaa858564f4bff1a685e77421ac8c174568ca794737f1cdcbddadc8293c6b0c07cddd20adaf851e6b6b57727cf9c9ea62aab5d3f162e055296eabe26ebfec98f97762859631b6f512126f9a21693e06a40b40eaf1ca9c4892a1dd10db8720aef6dec755b7df38cd0b9cccb11c3568ea144f8aef3603694a';

    $key = 'fuck~#$%^&*(458';

    $r = settmusic($a, $key);

    var_dump(json_decode($r));

比小白黑一点 answered 10 years, 3 months ago

Your Answer