How do I extract the flv link for a putlocker video? using VB.Net

Discussion in 'Programming' started by Dreamer09, Jan 11, 2013.

  1. #1
    I've came here because no one else seemed to be able to help, also because digitalpoint is very reputable when it comes to working with websites.

    I have a media player which plays flvs but the only issue I'm having is, I'm finding it near impossible to get the link to a putlocker video's flv. I have found tons of threads about it but no definitive answer. Here is some help I received from a german forum (which I can't make much sense of)


    Code:


    Class putlocker:

    Imports System.Text.RegularExpressions
    Imports System.Text
    Imports System.Net
    Imports System.ComponentModel

    Public Class putlocker

    Public URL As String = Nothing
    Public Referer As String = Nothing
    Public Postdata As String = Nothing
    Public Hash As String = Nothing
    Public Titel As String = Nothing
    Public Directlink As String = Nothing
    Public FeedLink As String = Nothing
    Dim HttpRequest As New HttpRequest

    Public Sub getHash()
    Try
    Dim Quelltext As String = Nothing

    HttpRequest.GET(URL)
    Quelltext = HttpRequest.Result

    If Quelltext.Contains("hash") Then
    Dim Treffer As New Regex("(?).+(?=<strong>)") Dim Mc2 As MatchCollection = Treffer2.Matches(Quelltext) Dim StrBuilder2 As New StringBuilder For Each m2 As Match In Mc2 Dim name2 As String = m2.Value Titel = name2 Next 'Form1.lvinfos.Items.Add("Name: ").SubItems.Add(Titel) 'MsgBox("Infos geladen") End If Catch ex As Exception MsgBox(ex.Message) End Try End Sub Sub getFeedLink() Try Postdata = "hash=" &amp; Trim(Hash) &amp; "&amp;confirm=Continue+as+Free+User" HttpRequest.POST(URL, Postdata, Referer) Dim Quelltext As String = HttpRequest.Result If Quelltext.ToLower.Contains("playlist") Then Dim Treffer As New Regex("(?</strong>
    Class HttpRequest (credits gehen an jemanden von vb-community.eu):

    Imports System.Net
    Imports System.IO
    Imports System.Text
    Imports System.Threading

    Public Class HttpRequest

    Public Request As HttpWebRequest
    Public Response As HttpWebResponse
    Public Result As String
    Public CookieContainer As New CookieContainer

    Public Sub [GET](ByVal URL As String, Optional ByVal referer As String = "")
    Try
    Request = DirectCast(WebRequest.Create(URL), HttpWebRequest)
    Request.Method = "GET"
    Request.Accept = "*/*"
    Request.AllowAutoRedirect = True
    Request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20100101 Firefox/12.0"
    Request.Timeout = 60000
    Request.CookieContainer = CookieContainer
    Response = DirectCast(Request.GetResponse(), HttpWebResponse)
    Dim ResponseStream As New StreamReader(Response.GetResponseStream())
    Result = ResponseStream.ReadToEnd()
    ResponseStream.Close()
    Catch
    Finally
    Response.Close()
    End Try
    End Sub

    Public Sub [POST](ByVal URL As String, ByVal Post As String, ByVal Referer As String)
    Try
    Request = DirectCast(WebRequest.Create(URL), HttpWebRequest)
    Request.Method = "POST"
    Request.Accept = "*/*"
    Request.AllowAutoRedirect = True
    Request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20100101 Firefox/12.0"
    Request.Timeout = 60000
    Request.CookieContainer = CookieContainer
    Request.ContentType = "application/x-www-form-urlencoded"
    Request.Referer = Referer

    Dim Encoding As New ASCIIEncoding()
    Dim PostByteArray() As Byte = Encoding.GetBytes(Post)
    Request.ContentLength = PostByteArray.Length
    Dim PostStream As IO.Stream = Request.GetRequestStream()
    PostStream.Write(PostByteArray, 0, PostByteArray.Length)
    PostStream.Close()
    Response = DirectCast(Request.GetResponse(), HttpWebResponse)
    Dim ResponseStream As New StreamReader(Response.GetResponseStream())
    Result = ResponseStream.ReadToEnd()
    ResponseStream.Close()
    Catch
    Finally
    Response.Close()
    End Try
    End Sub
    End Class

    putlocker.URL = link
    putlocker.getHash()
    putlocker.getFeedLink()
    putlocker.getDirectLink()
     
    Dreamer09, Jan 11, 2013 IP