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

Help 

Application I Would Like to Create

I want to make a script/application of some sort that will:
Download a feed of songs from Soundcloud. I want it to grab the songs from my soundcloud like page and download them one by one.


Right now I have to download each and every song I like manually, and it can take a long time to download several songs, one at a time.



My question is: What is the best way to go about doing this?
Hankaf posted something you might like.
I can't post links yet but it is in the VB.NET subsection of coding.
see his thread on how to use this properly

Code
'Made by hankaf of HF
Imports Awesomium.Core
Imports System.IO
Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
      'Newer user agent required to access soundcloud
      'Limiting asset interception to just the https protocol
      'To target all protocols, remove the AssetProtocol portion
      Dim WC As New WebConfig With {.UserAgent = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36", .AssetProtocol = "https"}
      'Webcore needs to be initialized in order to use the new webconfig
      WebCore.Initialize(WC)
      'Basic steps to create a new awesomium webcontrol
      Dim WS As WebSession = WebCore.CreateWebSession(New WebPreferences)
      Dim WebControl1 As New Awesomium.Windows.Forms.WebControl
      WebControl1.Dock = DockStyle.Fill
      WebControl1.Source = New Uri("https : // soundcloud . com/") 'Remove spaces from URI (Can't post links yet)
      Me.Controls.Add(WebControl1)
      'Implements the ResourceInterceptor class
      WebCore.ResourceInterceptor = New ResourceInterceptor
    End Sub
End Class
Public Class ResourceInterceptor
    Implements IResourceInterceptor
    'OnFilterNavigation does nothing for our purpose, however it is required
    Public Function OnFilterNavigation(ByVal request As NavigationRequest) As Boolean Implements IResourceInterceptor.OnFilterNavigation
      Return True
    End Function
    'Every request to a resource gets handled here
    'For soundcloud, those are the two locations that I found that have the mp3 files
    Public Function OnRequest(ByVal request As ResourceRequest) As ResourceResponse Implements IResourceInterceptor.OnRequest
      If request.Url.ToString.Contains("https : // ec-media. sndcdn . com/") Then 'Remove spaces from URI (Can't post links yet)
      Download(request.Url.ToString)
      ElseIf request.Url.ToString.Contains("https : // cf-media. sndcdn . com") Then 'Remove spaces from URI (Can't post links yet)
      Download(request.Url.ToString)
      End If
      Return Nothing
    End Function
    'Basic stuff, you should understand what this sub does
    Private Sub Download(ByVal request As String)
      Dim result As Integer = MessageBox.Show("Download song?", "Download?", MessageBoxButtons.YesNo)
      If result = DialogResult.Yes Then
      Dim fbd As New FolderBrowserDialog
      fbd.ShowDialog()
      My.Computer.Network.DownloadFile(request, fbd.SelectedPath & "\SongDownload.mp3")
      End If
    End Sub
End Class
Hey thanks so much thats exactly what I was looking for.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by issou276Mar 25, 2018 11:10 PM 17 341 Mar 25, 2018 11:10 PM
Last Post: ᴨᴜᴌᴌ
[Help] by AdeptMTAug 30, 2016 03:51 AM 0 135 Aug 30, 2016 03:51 AM
Last Post: AdeptMT
by passwordsMay 18, 2016 08:20 PM 3 113 May 18, 2016 08:20 PM
Last Post: IPIKIN