Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Youtube to mp3 converter for skype bot.

So I'm currently working on my skype bot and I am having one hell of a time trying to figure out how to make a youtube to mp3 converter for my skype bot. Here is my code so far:

Code
ElseIf message.StartsWith("!convert") Then
            Dim list() As String = Split(message)
            Dim request As HttpWebRequest = HttpWebRequest.Create("https://www.youtubeinmp3.com/fetch/?format=text&video=" & list(1))
            Dim response As HttpWebResponse = request.GetResponse
            Dim source As String = New IO.StreamReader(response.GetResponseStream).ReadToEnd
            If source = "" Then
                Skype.SendMessage(user, "Link invalid. Enter command like this: !convert https://www.youtube.com/watch?v=UnfrLaQj-rk")
            Else
                Skype.SendMessage(user, source & " Thank you for your support")
            End If

I don't know what else to do or how to make it automatically change into an mp3 and spit out a download link. Please help!
I've knocked up something for you that should work well. I must admit the way you have your bot setup to read the commands and split it from the trigger is pretty messy doing it within each command but i kept it to your setup.

I know this is the NET section, but i made you a little php file that will navigate to the site you was using, but handle all the trimming and return just the download link. It will be much easier for you. You will need to save the code as "yt2mp3.php" & upload it onto a webserver somewhere. You can get free ones if you don't want to pay or something.

PHP Code:
http://pastebin.com/60rSZUyr

And here is the code that will send a request to the file on your server and return the link to your user. replace "yourdomain.com" with your one obviously.

.NET Code:
http://pastebin.com/HKRb0GkT

I didn't test it, but I do alot of work with this kind of stuff so i'm pretty confident it'll do what you want just fine. Enjoy :)


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by ZeakZNov 17, 2018 09:53 AM 22 817 Nov 17, 2018 09:53 AM
Last Post: ZeakZ
[.NET] by iphone5sNov 18, 2017 02:58 PM 3 477 Nov 18, 2017 02:58 PM
Last Post: System[X]
[.NET] by siteperJun 9, 2017 03:16 PM 8 524 Jun 9, 2017 03:16 PM
Last Post: siteper