N.S
N.S

Reputation: 1477

how to download videos from a site using python

recently I`m watching some videos of CS 162 from this site and when I tried to find url of video I found out there is no url in inspect elements tab. but I found the url of video in network tab. you can see this tab near inspect elements of site in opera. I tried to get data of this tab using "requests" but It didn't turn out to be a clear url I was looking for.

Is there a way to gain data of network tab using python?
check this site if you can't find network tab.

thanks;

Upvotes: 0

Views: 365

Answers (1)

rose
rose

Reputation: 31

I write this code base on your comment:

import requests
url = 'your site'
r = requests.get(url, stream=True)   # your comment
print(r)

in the output there is a <iframe> tag which has a src of a .mp4. I think you should grab that using bs4 and then download the video you want.

Upvotes: 3

Related Questions