hi
im trying to write a program to download the mp4 from "http://entervideo.net/watch/7fb47a9cda2f0af"
so far i have
TextBox2.Text = ""
TextBox8.Text = ""
Dim i As Long
Dim IE As Object
Dim objElement As Object
Dim objCollection As Object
' Create InternetExplorer Object
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = False
'.Top = 50
'.Left = 2500
'.Height = 400
'.Width = 400
End With
url = TextBox1.Text
IE.navigate url
Do
DoEvents
Loop Until IE.ReadyState = READYSTATE_COMPLETE
Dim doc As HTMLDocument
Set doc = IE.document
'--------------------------------------------------------------------------------------
On Error Resume Next
getDistance = doc.getElementsByTagName("source")(0).src
If Err.Number <> 0 Then
' dirDistanceSummary not available
Err.Clear
getDistance = 0 ' Set the value to a default
While IE.Busy
DoEvents
Wend
End If
"once i get here i get stuck as to progress to the destination location you have to right click and hit open video in new tab"
TextBox2.Text = doc.getElementsByTagName("source")(0).src
"the program pulls the src for the final location but if you put it in the address bar 400 bad request is there a way to follow through with the cookies or something
MyFile = doc.getElementsByTagName("source")(0).src
WHTTP.open "GET", MyFile, False
WHTTP.send
FileData = WHTTP.responseBody
Set WHTTP = Nothing
FileNum = FreeFile
Open "G:\vids\DOCTOR WHO\Doctor Who S1E1.mp4" For Binary Access Write As #FileNum
Put #FileNum , 1, FileData
Close #FileNum
IE.Quit
End Sub
im trying to write a program to download the mp4 from "http://entervideo.net/watch/7fb47a9cda2f0af"
so far i have
TextBox2.Text = ""
TextBox8.Text = ""
Dim i As Long
Dim IE As Object
Dim objElement As Object
Dim objCollection As Object
' Create InternetExplorer Object
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = False
'.Top = 50
'.Left = 2500
'.Height = 400
'.Width = 400
End With
url = TextBox1.Text
IE.navigate url
Do
DoEvents
Loop Until IE.ReadyState = READYSTATE_COMPLETE
Dim doc As HTMLDocument
Set doc = IE.document
'--------------------------------------------------------------------------------------
On Error Resume Next
getDistance = doc.getElementsByTagName("source")(0).src
If Err.Number <> 0 Then
' dirDistanceSummary not available
Err.Clear
getDistance = 0 ' Set the value to a default
While IE.Busy
DoEvents
Wend
End If
"once i get here i get stuck as to progress to the destination location you have to right click and hit open video in new tab"
TextBox2.Text = doc.getElementsByTagName("source")(0).src
"the program pulls the src for the final location but if you put it in the address bar 400 bad request is there a way to follow through with the cookies or something
MyFile = doc.getElementsByTagName("source")(0).src
WHTTP.open "GET", MyFile, False
WHTTP.send
FileData = WHTTP.responseBody
Set WHTTP = Nothing
FileNum = FreeFile
Open "G:\vids\DOCTOR WHO\Doctor Who S1E1.mp4" For Binary Access Write As #FileNum
Put #FileNum , 1, FileData
Close #FileNum
IE.Quit
End Sub