Advertisement
gonzalezb

Untitled

Dec 5th, 2014
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. Public Sub Button2_Click()
  2.  
  3. Dim fname As String = Replace(GridView1[GridView1.Row, 0].Text, " ", "")
  4. Dim cmd As String
  5.  
  6. If Exist(TextBox2.Text) = False Then
  7. Message("Download location is invalid!")
  8. Return
  9. Endif
  10.  
  11. fname = Replace$(fname, "_", "")
  12. fname = Replace$(fname, "?", "")
  13. fname = Replace$(fname, "'", "")
  14. Try fname = Mid$(fname, 1, 20)
  15. fname &= ".mp3"
  16.  
  17.  
  18. sString.Text = "'echo " & ivt.Text & "File: " & fname & ivt.Text & "; echo " & ivt.Text & "Downloading to:" & TextBox2.Text & ivt.Text & "; curl -# --user-agent " & ivt.Text & "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:21.0) Gecko/20130331 Firefox/21.0" & ivt.Text & " -o " & ivt.Text & TextBox2.Text & "/" & fname & ".mp3" & ivt.Text & " -L " & ivt.Text & ListBox1[GridView1.Row].Text & ivt.Text & "'"
  19.  
  20.  
  21.  
  22. If Exist("/usr/bin/konsole") = True
  23.  
  24. Shell "konsole -e bash -c " & sString.Text
  25.  
  26. Else If Exist("/usr/bin/gnome-terminal") = True Then
  27.  
  28. Shell "gnome-terminal -e " & Quote("bash -c " & sString.Text)
  29.  
  30. Else
  31. Message("Please install either gnome-terminal or konsole")
  32.  
  33. Endif
  34.  
  35. End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement