Jump to content

[HELP] Why not working this youtube music player?


Turbe$Z

Recommended Posts

No errors / warnings in debugscript 3... then what wrong in this script?

Client:

requestBrowserDomains({"www.convertmp3.io"})
local browser = createBrowser( 1, 1, false )
local currentSound = {}

addEvent( 'Play' , true )
addEventHandler( 'Play' , root ,
    function( link )
        local vehicle = getPedOccupiedVehicle ( source )
        local x, y, z = getElementPosition(vehicle)
        currentSound[source] = playSound3D( link, x, y, z )
        attachElements(currentSound[source],vehicle)
        setSoundMaxDistance(currentSound[source],30)
        setSoundVolume(currentSound[source],50)
    end
)

function fetch(_,url)
    if url and url ~= "" then
        fetchRemote("http://www.convertmp3.io/fetch/?format=JSON&video="..url, callback)
    end
end
addCommandHandler("p",fetch)

function callback(data, error)
    if (error ~= 0) then
        return outputChatBox(error)
    end
    if (data == "ERROR") then
        return outputChatBox("data error")
    end
    local data = fromJSON("["..data.."]")
    if (data) then
        outputChatBox("Title: "..data.title)
        outputChatBox("Length: "..data.length)
        outputChatBox("Link: "..data.link)
        loadBrowserURL( browser, data.link  )
    end
end

addEventHandler( "onClientBrowserNavigate", browser, function( link )
        if not link:find("www.convertmp3.io") then
            triggerServerEvent( 'play' , localPlayer , link ) -- trigger the event when the script actially gets the playable link!
        end
    end 
)

server:

addEvent( 'play' , true )

addEventHandler( 'play' , root , 
    function( link )
        triggerClientEvent( root , 'Play' , client , link )
    end
)

 

Link to comment

My youtube player script has stopped working too due to convertompe.io has changed their services.

They don't convert videos containing music.

Videos containing music can not be downloaded

How did I solve this ? I tried to deal with a free api from GitHub, however, this has a limitation, like 50-100 songs per day unless you deal with a proxy to bypass that limit but might it becomes more complicated.

Best regards.

Edited by Overkillz
Link to comment
26 minutes ago, Overkillz said:

My youtube player script has stopped working too due to convertompe.io has changed their services.

They don't convert videos containing music.


Videos containing music can not be downloaded

How did I solve this ? I tried to deal with a free api from GitHub, however, this has a limitation, like 50-100 songs per day unless you deal with a proxy to bypass that limit but might it becomes more complicated.

Best regards.

But when i try convert a simple video without music, then does not working too.. 

Link to comment
4 minutes ago, Turbe$Z said:

But when i try convert a simple video without music, then does not working too.. 

I know, I've already tried with some videos which doesn't containt any music, however, convertmp3.io detects that the video containts some music.

I recommend you to find another converter that bring you the content in JSON or direct link ...etc

Regards.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...