0

I am using this link as an example: https://www.dailymotion.com/video/x7ylio6?playlist=x6lgtp I have been reading other stack overflow questions and gathered this code:

nam = sg.popup_get_text('Enter name', no_titlebar=True)
                nam = nam+'.mp4'
                st = urllib.request.urlretrieve(Ur, nam)

However, this only gives me the HTML of the page when it is supposed to download the video, not specific to DailyMotion. Any ideas?

Is there a way to download a video from a webpage with python?

Web Scraping Videos

  • Is this question specific to Dailymotion? How old is the question where you got the code from? If so, maybe that specific code doesn't work anymore for getting the MP4. You should link the question you got the code from though. – Random Davis Jan 11 '21 at 20:08
  • No not specific to DailyMotion, the questions weren't really recent. – Kareem Fareed Jan 11 '21 at 20:14
  • Each website will have a totally different way of downloading embedded videos. There's no one generic solution. It's not clear why you think those solutions would apply to DailyMotion, or to anything besides the specific sites in those examples. – Random Davis Jan 11 '21 at 20:15
  • Oh, but what would the general idea be for any site, how would you determine what you would have to do? – Kareem Fareed Jan 11 '21 at 20:22
  • You'd have to use google to see if someone already has a way of extracting videos from that particular site, or the video player that a particular site uses. You could then translate that into Python if you want. If there is no info, you'd have to look at the site's source code. It could be way too complex for you to understand, in which case you'd have to ask somewhere where that kind of question is allowed. – Random Davis Jan 11 '21 at 20:27

0 Answers0