Hello people from VB.NET Forums.
I made a app that worked perfectly for years, but now there has been a change in something and it's not working properly any more.
It's used to get torrent links from ThePiratebay. you can get the top 100, that still works but when I want to search for a torrent I keep getting 0 back
Search for links(not working any more)
Top100(works)
It seems to be in the Url's but I can't figure it out.
If I type in my browser "http://thepiratebay.org/search/Hulk/0/7/200" I get the links, but somehow this "http://thepiratebay.org/search/" + (theItem) + "/0/7/200" isn't getting anything back in the app.
Thanks in advance,
ecoster
Ps,
I apologise if this isn't in the correct section.
I made a app that worked perfectly for years, but now there has been a change in something and it's not working properly any more.
It's used to get torrent links from ThePiratebay. you can get the top 100, that still works but when I want to search for a torrent I keep getting 0 back
Search for links(not working any more)
VB.NET:
Private Sub VideoMenu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VideoMenu.Click
Dim theItem As String
Dim wb As New Net.WebClient
Dim src As String
theItem = InputBox("Type in the name of the Video file you want to find.", " Video search")
If theItem = "" Then Exit Sub
Me.Cursor = Cursors.WaitCursor
TorrentList.Items.Clear()
src = wb.DownloadString("http://thepiratebay.org/search/" + (theItem) + "/0/7/200")
TabPage1.Text = (GetLinks(src) & " Torrents found")
Me.Cursor = Cursors.Default
End Sub
Top100(works)
VB.NET:
Private Sub Top100MoviesMenu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Top100MoviesMenu.Click
Dim wb As New Net.WebClient
Dim src As String
Me.Cursor = Cursors.WaitCursor
TorrentList.Items.Clear()
TextBox1.Clear()
src = wb.DownloadString("http://thepiratebay.org/top/201")
TabPage1.Text = (GetLinks(src) & " Torrents found.")
Me.Cursor = Cursors.Default
End Sub
VB.NET:
Private Function GetLinks(ByRef HTML As String) As Long
Dim lonRet As Long, lonStart As Long
Dim lonEnd As Long
TorrentList.Items.Clear()
lonRet = -1
Do
lonStart = InStr(lonStart + 1, HTML, "http://torrents.thepiratebay.org", vbTextCompare)
If lonStart > 0 Then
lonStart = lonStart + 0
lonEnd = InStr(lonStart, HTML, """", CompareMethod.Text)
If lonEnd > 0 Then
lonRet = lonRet + 1
TorrentList.Items.Add(Mid$(HTML, lonStart, lonEnd - lonStart))
lonStart = lonEnd
End If
End If
Loop Until lonStart = 0
Return lonRet + 1
End Function
It seems to be in the Url's but I can't figure it out.
If I type in my browser "http://thepiratebay.org/search/Hulk/0/7/200" I get the links, but somehow this "http://thepiratebay.org/search/" + (theItem) + "/0/7/200" isn't getting anything back in the app.
Thanks in advance,
ecoster
Ps,
I apologise if this isn't in the correct section.