A possible direct ******* Player...
#8

API's for converting ******* video to mp3 or other formats are generally unreliable, sometimes the url returned by API works and sometimes it doesn't. I have tested over 3 different API for this all were unreliable.

Only fully reliable method imo is (requires that your server is hosted on vps/dedi that you have root access to) to host a php script on your vps/dedi that downloads ******* video then converts it to mp3 format then store that mp3 file on your vps and returns url for it.

Here is how I have done it:
Firstly install these two things on your vps :
1. ffmpeg (to convert downloaded video to mp3 format)
2. *******-dl (to download video from *******)

then you can simply use this script to download and convert it then return then link
PHP Code:
<?php
    set_time_limit
(0);
    
$id $_GET['id'];
    
$url "https://www.youtube.com/watch?v=".$id;
    if(!
file_exists("files/$id.mp3"))
    {        
        
exec("*******-dl --extract-audio --audio-format mp3 $url -o files/$id.mp3");        
    }
    
// get title
    
$info json_decode(file_get_contents("https://www.*******.com/oembed?format=json&url=".$url), true);
    if(
$info === null)echo "Invalid link?";
    else echo 
$info['title'];
?>
Firstly place this file for say in path like example.com/yt2mp3.php
Then create a path example.com/files

Now make a http get request from your samp script to example.com/yt2mp3.php?id=XXX
Where XXX is video ID.

Now after execution of script is complete the title will be available via script output and to play the file simply play it from url example.com/files/XXX.mp3 (Where XXX is video ID that was originally passed)
Reply


Messages In This Thread
A possible direct ******* Player... - by SsHady - 21.12.2016, 12:41
Re: A possible direct ******* Player... - by ball - 21.12.2016, 12:57
Re: A possible direct ******* Player... - by SsHady - 21.12.2016, 13:03
Re: A possible direct ******* Player... - by Konstantinos - 21.12.2016, 13:09
Re: A possible direct ******* Player... - by Dice_ - 21.12.2016, 13:10
Re: A possible direct ******* Player... - by SsHady - 21.12.2016, 13:20
Re: A possible direct ******* Player... - by NaS - 21.12.2016, 13:43
Re: A possible direct ******* Player... - by BroZeus - 21.12.2016, 13:50

Forum Jump:


Users browsing this thread: 1 Guest(s)