import urllib
link = "https://www.facebook.com/cofidis/videos/1518507675176091/?__cft__[0]=AZWA0HX9K9N1U6ZGKugETU-gWHDvRPDv0Vg7kmZwd2cR45pt9_Uml9gYz33wD3taI1aZc_w18hmTiUVd7VIXQxQTecK5v76B6r7gUdBxf4V1mAJgbV77A_NMi-07ywYyAQrUFVIT0if2gNQpFMS8Dq91o0w3xwALSDf0WV7_41Vw7EQUMYldqmaU6ZE29VkNXE4&__tn__=+?FH-R"
urllib.request.urlretrieve(link, "video.mp4")
CodePudding user response:
import urllib
link = "https://www.facebook.com/cofidis/videos/1518507675176091/?cft[0]=AZWA0HX9K9N1U6ZGKugETU-gWHDvRPDv0Vg7kmZwd2cR45pt9_Uml9gYz33wD3taI1aZc_w18hmTiUVd7VIXQxQTecK5v76B6r7gUdBxf4V1mAJgbV77A_NMi-07ywYyAQrUFVIT0if2gNQpFMS8Dq91o0w3xwALSDf0WV7_41Vw7EQUMYldqmaU6ZE29VkNXE4&tn=+?FH-R"
opener = urllib.FancyURLopener()
opener.retrieve(link,"testout.flv")
CodePudding user response:
I think this is the simplest technique to achieve your aim.
downloader = urllib.FancyURLopener() downloader.retrieve(link,"video.mp4")
Or,
file_name = 'video.mp4' urllib.retrieve(link, file_name)