The import requests
The import re
Headers={
"The user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36 ",
"Referer" : "https://video.pearvideo.com"
}
#
Url='https://www.pearvideo.com/video_1633183'
Url1='https://video.pearvideo.com/mp4/adshort/20191216/cont-1633183-14703452_adpkg-ad_hd.mp4'
Print (url)
Request=requests. Get (url)
# print (request. Text)
# src_list=re. The.findall (" srcUrl=". *?" , a vdoUrl=srcUrl 're. S)
Src_list=re. The.findall (' ldUrl=", "srcUrl=" (. *?) "' request. The text)
# print (src_list)
For the SRC in src_list:
Print (SRC)
Into print (' 1 ')
The response=requests. Get (SRC, headers=headers)
Into print (' 2 ')
FileName="movie \ " + "1" + "mp4"
Print (" is save the file: "+ fileName)
With the open (fileName, "wb") as f:
F.w rite (response. The content)
CodePudding user response:
Specified file storage paths, it is suggested that in the current path can be used./
CodePudding user response:
You are to be stored in the specified path you can use the OS module chdir method, look at, very powerfulCodePudding user response: