Ok, I have some code I am working with, however seem to be stuck
Not sure if it is because youtube changed something?
this is where I am getting an error,Code:Private Sub cmdStart_Click() Dim opts As String, html As String, videoId As String, token As String Dim matches As MatchCollection Dim uri As String If InStr(txtURL.Text, "http://") <> 1 Then MsgBox "Video URL must start with " & Chr(34) & "http://" & Chr(34) & ".", _ vbExclamation txtURL.SetFocus Exit Sub End If If txtURL.Text = "http://" Then MsgBox "Video URL cannot be empty.", vbExclamation Exit Sub End If ' Perform simple validatino on the video URL http.open "GET", txtURL.Text, False http.setRequestHeader "User-Agent", USER_AGENT On Error GoTo NetworkErr http.send On Error GoTo 0 html = http.responseText re.Pattern = "/watch_fullscreen\?video_id=(.*?)&.*?&t=(.*?)&" If re.Test(html) Then Set matches = re.Execute(html) videoId = matches(0).SubMatches(0) token = matches(0).SubMatches(1) Else MsgBox "The URL does not appear to be a YouTube video page.", vbExclamation Exit Sub End If uri = "http://www.youtube.com/get_video?video_id=" & videoId _ & "&t=" & token & "&eurl=" opts = "" If cbQuality.ListIndex = 0 Then opts = opts & ":ffmpeg-pp-q=6 " ElseIf cbQuality.ListIndex = 1 Then opts = opts & ":ffmpeg-pp-q=3 " End If opts = opts & ":sout=#transcode{vcodec=mp1v,vb=" If cbQuality.ListIndex = 0 Then opts = opts & "2048" Else opts = opts & "1024" End If opts = opts & ",acodec=mpga,ab=" If cbQuality.ListIndex = 0 Then opts = opts & "256" Else opts = opts & "128" End If If cbQuality.ListIndex = 0 Then opts = opts & ",deinterlace=blend" ElseIf cbQuality.ListIndex = 1 Then opts = opts & ",deinterlace" End If opts = opts & "}:std{access=file,mux=mpeg1,url=" _ & Chr(34) & GetMyVideosFolder() & "\" & videoId & ".mpg" & Chr(34) _ & "}" vlc.addTarget uri, opts, VLCPlayListReplace, 0 vlc.play pbProgress.Visible = True EnableUI False highestPos = 0 tmrTranscode.Enabled = True pbProgress.Value = 1 Exit Sub NetworkErr: MsgBox "Unable to access the video at " & txtURL.Text & ".", vbExclamation End Sub
re.Pattern = "/watch_fullscreen\?video_id=(.*?)&.*?&t=(.*?)&"
If re.Test(html) Then
Set matches = re.Execute(html)
videoId = matches(0).SubMatches(0)
token = matches(0).SubMatches(1)
Else
MsgBox "The URL does not appear to be a YouTube video page.", vbExclamation
Exit Sub
End If
Using this or any other youtube url.
How can I change code to fix?
Thanx




Reply With Quote