Looney;3 Posted July 17, 2018 Share Posted July 17, 2018 link = "https://www.youtube.com/watch?v=WAT47vPfs04" function onResourceStart() playingSound = playSound("http://www.convertmp3.io/fetch/?video="..link) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onResourceStart) why don't work this? Link to comment
Mr.Loki Posted July 18, 2018 Share Posted July 18, 2018 It's a little bit more complicated than this. You will need to use fetchRemote which means you need to whitelist the domain "www.convertmp3.io" with requestBrowserDomains to use their json/xml api to the bottom of the page. When you use the fetchRemote function your response data will be of the format specified and will need to extract the direct link and use that to play the sound with playSound. I've used this api before and some youtube links will not work unless they have special tags indicating that the video is a song. 1 Link to comment
Looney;3 Posted July 18, 2018 Author Share Posted July 18, 2018 15 hours ago, Mr.Loki said: It's a little bit more complicated than this. You will need to use fetchRemote which means you need to whitelist the domain "www.convertmp3.io" with requestBrowserDomains to use their json/xml api to the bottom of the page. When you use the fetchRemote function your response data will be of the format specified and will need to extract the direct link and use that to play the sound with playSound. I've used this api before and some youtube links will not work unless they have special tags indicating that the video is a song. Thanks but now fetchRemote send error #1006 1006: Destination IP not allowed u know why? Link to comment
Mr.Loki Posted July 18, 2018 Share Posted July 18, 2018 (edited) I think that's because you didn't whitelist the domain properly. Go to settings > Web Browser > Custom Whitelist and see if there is " www.convertmp3.io" ls listed there. Edited July 18, 2018 by Mr.Loki Link to comment
Looney;3 Posted July 18, 2018 Author Share Posted July 18, 2018 3 minutes ago, Mr.Loki said: Creo que es porque no incluiste en la lista blanca el dominio correctamente. Vaya a la configuración> Navegador web> Lista blanca personalizada y vea si allí se encuentra "www.convertmp3.io". Link to comment
Looney;3 Posted July 18, 2018 Author Share Posted July 18, 2018 1 minute ago, Mr.Loki said: remove "http://" oh hahah im stupid thanks <3 Link to comment
Popular Post Mr.Loki Posted July 18, 2018 Popular Post Share Posted July 18, 2018 I'm glad i saw this topic because i figured out a bypass to get the links to work. It was not working before because javascript redirects you to the download link after a few seconds to stop bots from using the site So here it is and i can finally fix a music player script i got I don't know how long this will last but there will be a possibility that this will break and this code needs some optimizations. requestBrowserDomains({"www.convertmp3.io"}) local browser = createBrowser( 0, 0, false ) local currentSound function start(_,link) fetch(link) end addCommandHandler("play",start) function fetch(url) if (url) then fetchRemote("http://www.convertmp3.io/fetch/?format=JSON&video="..url, callback) end end 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 currentSound = playSound( link ) end end ) This creates a dummy browser and waits for the redirect link to play the sound. 2 2 Link to comment
Looney;3 Posted July 22, 2018 Author Share Posted July 22, 2018 On 18/7/2018 at 2:12 PM, Mr.Loki said: I'm glad i saw this topic because i figured out a bypass to get the links to work. It was not working before because javascript redirects you to the download link after a few seconds to stop bots from using the site So here it is and i can finally fix a music player script i got I don't know how long this will last but there will be a possibility that this will break and this code needs some optimizations. requestBrowserDomains({"www.convertmp3.io"}) local browser = createBrowser( 0, 0, false ) local currentSound function start(_,link) fetch(link) end addCommandHandler("play",start) function fetch(url) if (url) then fetchRemote("http://www.convertmp3.io/fetch/?format=JSON&video="..url, callback) end end 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 currentSound = playSound( link ) end end ) This creates a dummy browser and waits for the redirect link to play the sound. wow thanks bro, but why that will break? :C 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