PHP obtains the HD and UHD music videos of the music platform. Demo address: music.yuur.net none? Php $ urlisset ($ _ GET [url])? Trim ($ _ GET [url]):; v. yinyuetai. comvideo2185713 $ time $ _ SERVER [REQUEST_TIME]; $ contentfile_get_contents ($ url); GET the title preg_match (
PHP obtains the HD and UHD music videos of the music platform. Demo address: http://music.yuur.net none? Php $ url = isset ($ _ GET ['url'])? Trim ($ _ GET ['url']): ''; // response = file_get_contents ($ url); // obtain the title preg_match ('/
PHP obtains the HD and UHD music videos of the music platform.
Demo address: http://music.yuur.net <无>
/I ', $ content, $ title); // obtain the cover preg_match ('/property = "og: image" content = "([^"] *) ". *?> /', $ Content, $ images); // obtain the IDpreg_match ('/[\ d] +/', $ url, $ song_id) of the MV ); $ title = $ title [1]; $ images = $ images [1]; $ song_id = $ song_id [0]; // parse json $ songurl = "http://www.yinyuetai.com/api/info/get-video-urls? Callback = callback & videoId = ". $ song_id. "& _ = ". $ time; $ data = file_get_contents ($ songurl); if (strpos ($ data, "callback ")! = False) {$ lpos = strpos ($ data, "("); $ rpos = strrpos ($ data, ")"); $ data = substr ($ data, $ lpos + 1, $ rpos-$ lpos-1);} $ json = json_decode ($ data, true); echo $ title."
"; Echo" LD address: ". $ json ['hcvideourl']."
"; Echo" HD address: ". $ json ['hdvideourl']."
"; Echo" UHD address: ". $ json ['videourl']."
"; Echo" "; // Demo: http://music.yuur.net?>