Comments (4)
It happens because pySmartDL assumes that webserver will always send the "Content-Length" header in its response. Some servers don't do that. In order to fix this error lot of changes are required in source code of this library.
from pysmartdl.
The server I use sends the "Content-Length", as matter of fact for the same server and same file, same link, same config, one time I get an error and another time everything is fine the file is downloaded. Could it be because of some internal caching or buffering done by pySmartDL?
from pysmartdl.
Fixed.
from pysmartdl.
Seem there is another place need to be fixed
2020-02-12 23:41:18,343 - __main__ - ERROR - int() argument must be a string, a bytes-like object or a number, not 'NoneType'
Traceback (most recent call last):
File "/Users/todaynowork/git/Images_Extract/report_images_extract_russia.py", line 258, in fecthReceipts
obj = downloadImage(report_url, dest)
File "/Users/todaynowork/git/Images_Extract/report_images_extract_russia.py", line 363, in downloadImage
obj = SmartDL(file_uri, dest=dest, progress_bar=False)
File "/Users/todaynowork/git/Images_Extract/.venv/lib/python3.8/site-packages/pySmartDL/pySmartDL.py", line 133, in __init__
if not utils.is_HTTPRange_supported(self.url, timeout=self.timeout):
File "/Users/todaynowork/git/Images_Extract/.venv/lib/python3.8/site-packages/pySmartDL/utils.py", line 107, in is_HTTPRange_supported
filesize = int(urlObj.headers["Content-Length"])
from pysmartdl.
Related Issues (20)
- New Feature: currently it does not support cookie
- ssl certificate HOT 1
- python 3.7.4 supporting HOT 1
- utils.url_fix breaks url HOT 1
- Downloading error in python 3.8 HOT 2
- Reduce download speed at last HOT 1
- HTTP NTLM Authentication
- Progress?
- How to set retries if initial download fails
- Free Palestine HOT 1
- 1973
- RuntimeError: cannot schedule new futures after shutdown HOT 1
- Question: Will the mirror function pick the fastest one?
- always download with only one thread
- Error while downloading 🤒 HOT 3
- is there any way for it to just return the current progress HOT 1
- functionality to use different url if one fails and continue downloading
- reading the filename with content-disposition header
- Wrong error message, if total file size doesn't match expected file size.
- Add supprt for request.session cookies or passing referer HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pysmartdl.