Hello Jaysonlong
Thank you so much for your awesome program, I really love it.
But recently I get an error when downloading video from iq.com
Can you help to check? Thank you a lot
Traceback (most recent call last):
File "E:\Work\Code\webvideo\downloader\dispatcher.py", line 167, in dispatch
self.download(url, fileName, data)
File "E:\Work\Code\webvideo\downloader\dispatcher.py", line 139, in download
targetFileName = self.handleSubtitles(subtitles, fileName, targetFileName, headers)
File "E:\Work\Code\webvideo\downloader\dispatcher.py", line 108, in handleSubtitles
self.downloader.downloadAll(subtitleUrls, subtitleNames, headers, self.hlsThreadCnt)
File "E:\Work\Code\webvideo\downloader\tools\downloader.py", line 174, in downloadAll
self._waitUtilFinish()
File "E:\Work\Code\webvideo\downloader\tools\downloader.py", line 105, in _waitUtilFinish
raise self.threadPool.exception
File "C:\Users\Windows10\AppData\Local\Programs\Python\Python39\lib\concurrent\futures\thread.py", line 52, in run
result = self.fn(*self.args, self.kwargs)
File "E:\Work\Code\webvideo\downloader\tools\downloader.py", line 130, in _downloadRange
raise self.threadPool.exception
File "C:\Users\Windows10\AppData\Local\Programs\Python\Python39\lib\concurrent\futures\thread.py", line 52, in run
result = self.fn(*self.args, *self.kwargs)
File "E:\Work\Code\webvideo\downloader\tools\downloader.py", line 130, in _downloadRange
raise self.threadPool.exception
File "C:\Users\Windows10\AppData\Local\Programs\Python\Python39\lib\concurrent\futures\thread.py", line 52, in run
result = self.fn(self.args, self.kwargs)
File "E:\Work\Code\webvideo\downloader\tools\downloader.py", line 130, in _downloadRange
raise self.threadPool.exception
File "C:\Users\Windows10\AppData\Local\Programs\Python\Python39\lib\concurrent\futures\thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "E:\Work\Code\webvideo\downloader\tools\downloader.py", line 123, in _downloadRange
rangeSize = rangeSize or int(response.headers['Content-Length'])
File "C:\Users\Windows10\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\structures.py", line 54, in getitem
return self._store[key.lower()][1]
KeyError: 'content-length'
go to the path: "webvideo-downloader-master\downloader\tools", and open the "downloader.py" file
find "rangeSize = rangeSize or int(response.headers['Content-Length'])", and change to:
try:
rangeSize = rangeSize or int(response.headers['Content-Length'])
except KeyError:
rangeSize = len(response.content)
Hello Jaysonlong Thank you so much for your awesome program, I really love it. But recently I get an error when downloading video from iq.com
Can you help to check? Thank you a lot
Traceback (most recent call last): File "E:\Work\Code\webvideo\downloader\dispatcher.py", line 167, in dispatch self.download(url, fileName, data) File "E:\Work\Code\webvideo\downloader\dispatcher.py", line 139, in download targetFileName = self.handleSubtitles(subtitles, fileName, targetFileName, headers) File "E:\Work\Code\webvideo\downloader\dispatcher.py", line 108, in handleSubtitles self.downloader.downloadAll(subtitleUrls, subtitleNames, headers, self.hlsThreadCnt) File "E:\Work\Code\webvideo\downloader\tools\downloader.py", line 174, in downloadAll self._waitUtilFinish() File "E:\Work\Code\webvideo\downloader\tools\downloader.py", line 105, in _waitUtilFinish raise self.threadPool.exception File "C:\Users\Windows10\AppData\Local\Programs\Python\Python39\lib\concurrent\futures\thread.py", line 52, in run result = self.fn(*self.args, self.kwargs) File "E:\Work\Code\webvideo\downloader\tools\downloader.py", line 130, in _downloadRange raise self.threadPool.exception File "C:\Users\Windows10\AppData\Local\Programs\Python\Python39\lib\concurrent\futures\thread.py", line 52, in run result = self.fn(*self.args, *self.kwargs) File "E:\Work\Code\webvideo\downloader\tools\downloader.py", line 130, in _downloadRange raise self.threadPool.exception File "C:\Users\Windows10\AppData\Local\Programs\Python\Python39\lib\concurrent\futures\thread.py", line 52, in run result = self.fn(self.args, self.kwargs) File "E:\Work\Code\webvideo\downloader\tools\downloader.py", line 130, in _downloadRange raise self.threadPool.exception File "C:\Users\Windows10\AppData\Local\Programs\Python\Python39\lib\concurrent\futures\thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "E:\Work\Code\webvideo\downloader\tools\downloader.py", line 123, in _downloadRange rangeSize = rangeSize or int(response.headers['Content-Length']) File "C:\Users\Windows10\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\structures.py", line 54, in getitem return self._store[key.lower()][1] KeyError: 'content-length'