vba download mp4

ralphros

New Member
Joined
Jan 5, 2018
Messages
1
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
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,223,714
Messages
6,174,051
Members
452,542
Latest member
Bricklin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top