Markeloff Posted December 8, 2013 Share Posted December 8, 2013 Guys, you're missing a heavy part here, you can actually download this, but you will need to do it client-sided wich is literally impossible, becouse either it would be using server's network to download the music wich it aint good.. No way to that. Link to comment
Spajk Posted December 8, 2013 Share Posted December 8, 2013 HyPeX, many bigger servers already have radio scripts where players can listen to an online radio which ofcourse consumes the server's network. By the way, I managed to do this using a PHP script and the API provided above. Link to comment
.:HyPeX:. Posted December 8, 2013 Share Posted December 8, 2013 HyPeX, many bigger servers already have radio scripts where players can listen to an online radio which ofcourse consumes the server's network. By the way, I managed to do this using a PHP script and the API provided above. i said this just to notice that this should be done carefully on a limited bandswith server, or a server with too many players can cause problems of lag. Notice that one thing is a radio that its a stream and not so big bandwith-consuming and another thing is a youtube video. Link to comment
Quited Posted December 9, 2013 Share Posted December 9, 2013 (edited) go to : https://www.youtube-mp3.org 1- put video link 2- download as mp3 3- put your mp3 file in your resource 4- put this code in client side (client.lua) : playSound("your-mp3-file.mp3") or if you want mp3 file download from HTTP : fetchRemote just upload your mp3 file in http://kiwi6.com/ or any mp3 hosting Edited December 9, 2013 by Guest Link to comment
Castillo Posted December 9, 2013 Share Posted December 9, 2013 That requires so you first convert it manually, then you must copy the link, and that's what he doesn't want to do. Link to comment
TAPL Posted December 9, 2013 Share Posted December 9, 2013 go to : https://www.youtube-mp3.org1- put video link 2- download as mp3 3- put your mp3 file in your resource 4- put this code in client side (client.lua) : playSound("your-mp3-file.mp3") or if you want mp3 file download from HTTP : fetchRemote just upload your mp3 file in http://kiwi6.com/ or any mp3 hosting This was a reply to NssoR, it fit you as well. Not sure either to cry or laugh, thanks for nothing. Link to comment
Scripting Moderators Sarrum Posted December 11, 2013 Scripting Moderators Share Posted December 11, 2013 Example: url = "http://www.youtube.com/watch?v=5dbEhBKGOtY" fetchRemote ( "http://vm-0.zver.kd.io/a_php/youtube_mp3.php?s=download&v=" .. url, function ( data ) if ( data ) then fetchRemote ( "http://vm-0.zver.kd.io/a_php/youtube_mp3.php?s=play&v=" .. url, function ( data ) if ( data ) then outputDebugString ( data ) end end ) end end ) PHP source: <?php if ( !empty ( $_GET [ "s" ] ) && !empty ( $_GET [ "v" ] ) ) { if ( $_GET [ "s" ] == "download" ) { $result = sFileGetContent ( "http://youtubeinmp3.com/download/?n=1&video=" . $_GET [ "v" ] ); //echo $result; exit ( ); } elseif ( $_GET [ "s" ] == "play" ) { $result = explode ( "\n", sFileGetContent ( "http://youtubeinmp3.com/fetch/?video=" . $_GET [ "v" ] ) ); echo str_replace ( "Location: ", "", $result [ 8 ] ); } } else { exit ( "Fail." ); } function sFileGetContent($sUrl) { $sContent = ""; $sUrl = str_replace("http://", "", $sUrl); $_aTmp = explode("/", $sUrl); $sDomain = $_aTmp[0]; $sGet = str_replace($sDomain, "", $sUrl); $fp = fsockopen($sDomain, 80, $errno, $errstr); if (!$fp) { } else { $out = "GET $sGet HTTP/1.0\r\n"; $out .= "Host: $sDomain\r\n"; $out .= "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021204\r\n"; $out .= "Referer: [url=http://$sDomain/]http://$sDomain/[/url]\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); while (!feof($fp)) { $sContent .= fgets($fp, 2048); } fclose($fp); } return $sContent; } ?> Link to comment
pa3ck Posted December 12, 2013 Share Posted December 12, 2013 Example: url = "http://www.youtube.com/watch?v=5dbEhBKGOtY" fetchRemote ( "http://vm-0.zver.kd.io/a_php/youtube_mp3.php?s=download&v=" .. url, function ( data ) if ( data ) then fetchRemote ( "http://vm-0.zver.kd.io/a_php/youtube_mp3.php?s=play&v=" .. url, function ( data ) if ( data ) then outputDebugString ( data ) end end ) end end ) PHP source: <?php if ( !empty ( $_GET [ "s" ] ) && !empty ( $_GET [ "v" ] ) ) { if ( $_GET [ "s" ] == "download" ) { $result = sFileGetContent ( "http://youtubeinmp3.com/download/?n=1&video=" . $_GET [ "v" ] ); //echo $result; exit ( ); } elseif ( $_GET [ "s" ] == "play" ) { $result = explode ( "\n", sFileGetContent ( "http://youtubeinmp3.com/fetch/?video=" . $_GET [ "v" ] ) ); echo str_replace ( "Location: ", "", $result [ 8 ] ); } } else { exit ( "Fail." ); } function sFileGetContent($sUrl) { $sContent = ""; $sUrl = str_replace("http://", "", $sUrl); $_aTmp = explode("/", $sUrl); $sDomain = $_aTmp[0]; $sGet = str_replace($sDomain, "", $sUrl); $fp = fsockopen($sDomain, 80, $errno, $errstr); if (!$fp) { } else { $out = "GET $sGet HTTP/1.0\r\n"; $out .= "Host: $sDomain\r\n"; $out .= "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021204\r\n"; $out .= "Referer: [url=http://$sDomain/]http://$sDomain/[/url]\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); while (!feof($fp)) { $sContent .= fgets($fp, 2048); } fclose($fp); } return $sContent; } ?> Does it really work? Link to comment
Sasu Posted December 12, 2013 Share Posted December 12, 2013 Example: url = "http://www.youtube.com/watch?v=5dbEhBKGOtY" fetchRemote ( "http://vm-0.zver.kd.io/a_php/youtube_mp3.php?s=download&v=" .. url, function ( data ) if ( data ) then fetchRemote ( "http://vm-0.zver.kd.io/a_php/youtube_mp3.php?s=play&v=" .. url, function ( data ) if ( data ) then outputDebugString ( data ) end end ) end end ) PHP source: <?php if ( !empty ( $_GET [ "s" ] ) && !empty ( $_GET [ "v" ] ) ) { if ( $_GET [ "s" ] == "download" ) { $result = sFileGetContent ( "http://youtubeinmp3.com/download/?n=1&video=" . $_GET [ "v" ] ); //echo $result; exit ( ); } elseif ( $_GET [ "s" ] == "play" ) { $result = explode ( "\n", sFileGetContent ( "http://youtubeinmp3.com/fetch/?video=" . $_GET [ "v" ] ) ); echo str_replace ( "Location: ", "", $result [ 8 ] ); } } else { exit ( "Fail." ); } function sFileGetContent($sUrl) { $sContent = ""; $sUrl = str_replace("http://", "", $sUrl); $_aTmp = explode("/", $sUrl); $sDomain = $_aTmp[0]; $sGet = str_replace($sDomain, "", $sUrl); $fp = fsockopen($sDomain, 80, $errno, $errstr); if (!$fp) { } else { $out = "GET $sGet HTTP/1.0\r\n"; $out .= "Host: $sDomain\r\n"; $out .= "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021204\r\n"; $out .= "Referer: [url=http://$sDomain/]http://$sDomain/[/url]\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); while (!feof($fp)) { $sContent .= fgets($fp, 2048); } fclose($fp); } return $sContent; } ?> Does it really work? Yes, I tested it. Very good work Sarrum . Link to comment
spAik Posted December 15, 2013 Share Posted December 15, 2013 Yes, I tested it. Very good work Sarrum . Yes it works until the API download limit is reached. Is there a way to circumvent that? or can youtube-mp3.com also be used to get a working url? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now