Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Function getPlid()
- If Not String.IsNullOrEmpty(_plid) Then
- Return _plid
- End If
- Dim the_request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("https://www.youtube.com/watch?v=dCsr0CNqB3g")
- Dim the_response As System.Net.HttpWebResponse = the_request.GetResponse
- Dim stream_reader As System.IO.StreamReader = New System.IO.StreamReader(the_response.GetResponseStream())
- Dim yt_source As String = stream_reader.ReadToEnd
- If String.IsNullOrEmpty(yt_source) Then
- WriteToLog(ProcessId, "Youtube ID Request Error")
- Else
- Dim r As Regex = New Regex("""plid"":""(.{16})""")
- Dim m = r.Match(yt_source)
- If (m IsNot Nothing And m.Groups.Count > 1) Then
- _plid = m.Groups(1).Value.Substring(0, 4)
- Return _plid
- End If
- End If
- Return String.Empty
- End Function
Add Comment
Please, Sign In to add comment