question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Download appears to be slowed significantly by default_chunk_size in request.py

See original GitHub issue

The download speed seems to be very slow It’s download for me in speed of 4 Megabyte / s ( 32mbps ) Is that normal?

I tried many videos

currently I download video with resolution of 720p

os: ubuntu 20.04.2 
python version: Python 3.8.5
pytube version: latest from github - 10.5.1

speedtest

Hosted by FibreStream (Toronto, ON) [2.19 km]: 3.359 ms
Testing download speed...
Download: 1046.61 Mbit/s
Testing upload speed...
Upload: 1766.06 Mbit/s

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
tfdahlincommented, Mar 6, 2021

It looks like right now pytube is making ~2300 write operations per web request, which has some pretty significant overhead

0reactions
tfdahlincommented, Apr 28, 2021

No, pytube requests 9MB of the file at a time, so this is 2300 write operations per 9MB of filesize. I am creating a PR for this right now, I just want to make sure that I test it extensively before I merge it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Download large file in python with requests - Stack Overflow
It transfers the data to OS. Usually, it is enough unless there is a power failure. f.flush() makes the code slower here for...
Read more >
How to Optimize Tick History file downloads for Python (and ...
After making a historical data request using Refinitiv Tick History, once the data was extracted and is ready you can download and save...
Read more >
ProcessPoolExecutor in Python: The Complete Guide
Python provides a process pool via the ProcessPoolExecutor class. Run your loops using all CPUs, download my FREE book to learn how.
Read more >
Chapter 4. How Chunking and Compression Can Help You
Chapter 4. How Chunking and Compression Can Help You So far we have avoided talking about exactly how the data you write is...
Read more >
Python Module Index - Requests Documentation
In the event you are posting a very large file as a multipart/form-data request, you may want to stream the request. By default,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found