Home>
Hello everyone. Tell me, what are the tools or ways to download a file from a link with a restriction using python?
I tried
wget.download(url, name)
Console output
13% [......... ] 78643200 /595294094
Also used
data= urlopen(list_url_video[0])
open('video.mp4', 'wb') as file:
file.write(data)
Console output
TypeError: a bytes-like object is required, not 'HTTPResponse'
Well,
response= requests.get(url=url, stream=True)
open('video.mp4', 'wb') as file:
for chunk in response.iter_content(chunk_size=1024 * 1024):
if chunk:
file.write(chunk)
The file has been written to.mp4
format and weighs 75.0 MB
Oh yes, I used this approach too
name= 'video.mp4'
urlretrieve(url, name)
The file has been written to.tmp
format and weighs 75.0 MB
None of this worked
None of this worked, and will not work with this approach.
Александр2022-01-21 15:31:56What are the restrictions?
Александр2022-01-21 15:32:27@Alexander Added to the question, output to the console. Restriction -I mean traffic restrictions on downloading a file from the server (75.0 MB).
GRuler2022-01-21 15:58:14How can the community help you?
Александр2022-01-21 16:22:42Related questions
- How to remove { } : " " elements and letters U S D. All this must be done in python
- python : Why is the result not displayed?
- python : Please help, I can't get data through Beautiful Soup
- python : The block on the authorized page is not parsed
- What parameters to pass for a POST request to solve a Python captcha
- 511 python requests response
- How to retry a caught Fiddler request using python requests?
- How does the server know to distinguish between a python-requests request and a Fiddler request?
- How to get data-value from td in BS4 python
What is the link that is displayed in the console?
Александр2022-01-21 15:31:31