Jeffchen54 / KMP-Kemono-Downloader

Simple Kemono downloader
MIT License
46 stars 4 forks source link

Maybe a bug in last version (0.4.1) #1

Closed mario6714 closed 2 years ago

mario6714 commented 2 years ago

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\m\Downloads\KMPDownloader-main\KMPDownloader.py", line 640, in main() File "C:\Users\m\Downloads\KMPDownloader-main\KMPDownloader.py", line 632, in main downloader.routine(urls) File "C:\Users\m\Downloads\KMPDownloader-main\KMPDownloader.py", line 563, in routine self.call_and_interpret_url(url) File "C:\Users\m\Downloads\KMPDownloader-main\KMPDownloader.py", line 504, in __call_and_interpret_url self.process_window(url, True) File "C:\Users\m\Downloads\KMPDownloader-main\KMPDownloader.py", line 440, in __process_window reqs = requests.get(url) File "C:\Users\m\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, kwargs) File "C:\Users\m\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\api.py", line 61, in request return session.request(method=method, url=url, kwargs) File "C:\Users\m\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 529, in request resp = self.send(prep, send_kwargs) File "C:\Users\m\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 645, in send r = adapter.send(request, kwargs) File "C:\Users\m\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\adapters.py", line 507, in send raise ConnectTimeout(e, request=request) requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='kemono.party', port=443): Max retries exceeded with url: /fanbox/user/19627910(Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x0000019EB7F44DC0>, 'Connection to kemono.party timed out. (connect timeout=None)'))

Jeffchen54 commented 2 years ago

Thanks for reaching out. Can you provide the URL you used? I'm having an issue pulling the URL up on my Chrome browser 'https://kemono.party/fanbox/user/19627910'. I think the issue is a bad URL was provided or something.

mario6714 commented 2 years ago

https://kemono.party/patreon/user/19627910

mario6714 commented 2 years ago

Sorry, my mistake in the first url, after that i cant enter using firefox or chrome

Jeffchen54 commented 2 years ago

Interesting, are you using a txt file with the -f switch? Could you send me the invocation you used and any supporting text files?

mario6714 commented 2 years ago

i use in this way in cmd: KMPDownloader.py -v -d C:\Users\m\Downloads\KMPDownloader\ Input a url, or type 'quit' to exit> https://kemono.party/patreon/user/19627910

mario6714 commented 2 years ago

supporting text files?

Jeffchen54 commented 2 years ago

That's if you used a certain switch. If you used that invocation, there isn't any txt files. It seems to work on my end though. Could you try it again with the exact same invocation you sent me? You should not be getting

requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='kemono.party', port=443): Max retries exceeded with url: /fanbox/user/19627910(Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x0000019EB7F44DC0>, 'Connection to kemono.party timed out. (connect timeout=None)'))

using that invocation since the program works by splitting URLs, it doesn't append anything to any URLs except if it is trying to download a file.

mario6714 commented 2 years ago

Ty again this way?

i use in this way in cmd: KMPDownloader.py -v -d C:\Users\m\Downloads\KMPDownloader Input a url, or type 'quit' to exit> https://kemono.party/patreon/user/19627910

Jeffchen54 commented 2 years ago

Yes

mario6714 commented 2 years ago

Is fine if i use another url?

Jeffchen54 commented 2 years ago

Yeah but make sure it is a valid URL, I believe you entered an incorrect one before. Let me know if it works.

mario6714 commented 2 years ago

This URL https://kemono.party/fanbox/user/51803217

Jeffchen54 commented 2 years ago

Yes that is valid, give a try and let me know if it goes through.

mario6714 commented 2 years ago

Nop, for a moment the program download a few files but after that i get the same error:

Traceback (most recent call last): File "C:\Users\m\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connection.py", line 174, in _new_conn conn = connection.create_connection( File "C:\Users\m\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\util\connection.py", line 95, in create_connection raise err File "C:\Users\m\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\util\connection.py", line 85, in create_connection sock.connect(sa) TimeoutError: [WinError 10060] Se produjo un error durante el intento de conexión ya que la parte conectada no respondió adecuadamente tras un periodo de tiempo, o bien se produjo un error en la conexión establecida ya que el host conectado no ha podido responder

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\m\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "C:\Users\m\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 386, in _make_request self._validate_conn(conn) File "C:\Users\m\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 1040, in _validate_conn conn.connect() File "C:\Users\m\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connection.py", line 358, in connect self.sock = conn = self._new_conn() File "C:\Users\m\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connection.py", line 179, in _new_conn raise ConnectTimeoutError( urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x000002398A39A890>, 'Connection to kemono.party timed out. (connect timeout=None)')

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\m\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\adapters.py", line 440, in send resp = conn.urlopen( File "C:\Users\m\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 785, in urlopen retries = retries.increment( File "C:\Users\m\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\util\retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='kemono.party', port=443): Max retries exceeded with url: /fanbox/user/51803217/post/3760218 (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x000002398A39A890>, 'Connection to kemono.party timed out. (connect timeout=None)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\m\Downloads\KMPDownloader-main\KMPDownloader.py", line 640, in main() File "C:\Users\m\Downloads\KMPDownloader-main\KMPDownloader.py", line 632, in main downloader.routine(urls) File "C:\Users\m\Downloads\KMPDownloader-main\KMPDownloader.py", line 563, in routine self.call_and_interpret_url(url) File "C:\Users\m\Downloads\KMPDownloader-main\KMPDownloader.py", line 504, in __call_and_interpret_url self.process_window(url, True) File "C:\Users\m\Downloads\KMPDownloader-main\KMPDownloader.py", line 459, in process_window self.__process_container( File "C:\Users\m\Downloads\KMPDownloader-main\KMPDownloader.py", line 348, in process_container reqs = requests.get(url) File "C:\Users\m\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, kwargs) File "C:\Users\m\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\api.py", line 61, in request return session.request(method=method, url=url, kwargs) File "C:\Users\m\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 529, in request resp = self.send(prep, send_kwargs) File "C:\Users\m\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 645, in send r = adapter.send(request, kwargs) File "C:\Users\m\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\adapters.py", line 507, in send raise ConnectTimeout(e, request=request) requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='kemono.party', port=443): Max retries exceeded with url: /fanbox/user/51803217/post/3760218 (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x000002398A39A890>, 'Connection to kemono.party timed out. (connect timeout=None)'))

Jeffchen54 commented 2 years ago

I've managed to reproduced the error. The reason is because your computer disconnected from the Internet. I will implement a patch where connection attempts will be made continuously until a connection is made.

mario6714 commented 2 years ago

After that error i can't enter kemono.party for a while but enter other url without error

mario6714 commented 2 years ago

I have a error like this if i use the previous version:

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "threading.py", line 1009, in _bootstrap_inner File "KMPDownloader.py", line 95, in run File "KMPDownloader.py", line 154, in download_file File "cfscrape__init__.py", line 121, in request File "requests\sessions.py", line 529, in request File "requests\sessions.py", line 667, in send File "requests\sessions.py", line 667, in File "requests\sessions.py", line 237, in resolve_redirects File "requests\sessions.py", line 645, in send File "requests\adapters.py", line 501, in send requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine('апÑ\x80авленÑ\x8b на запÑ\x80аÑ\x88иваемÑ\x8bй Ñ\x80еÑ\x81Ñ\x83Ñ\x80Ñ\x81 в ближайÑ\x88ее вÑ\x80емÑ\x8f.
Ð\x9fожалÑ\x83йÑ\x81Ñ\x82а ожидайÑ\x82е...",document.getElementById("link").innerHTML="Ð\x97аÑ\x89иÑ\x82а оÑ\x82 DDoS-аÑ\x82ак DDoS-GUARD"):(document.getElementById("title").innerHTML="Checking your browser accessing "+host,document.getElementById("description").innerHTML="This process is automatic. Your browser will redirect to your requested content shortly.
Please allow up to 5 seconds...",document.getElementById("link").innerHTML="DDoS protection by DDoS-GUARD");HTTP/1.1 403 Forbidden\r\n'))

Jeffchen54 commented 2 years ago

Thanks for the info, I have finished the patch. It's past midnight for me but I got it working. Yeah the previous version 0.3.5 had some bugs I had taken care of. It definitely sounds like your ISP or network provider is having problems connecting to the Kemono.party website.

It contains the KMPDownloader.py, you can copy and paste it into where the old one is. It should solve the connection issues you had but it may hang out until your network provider reestablishes connection with the website. I haven't enough time to run my test cases since they take some time but it works when I intentionally break my connection with the website. Let me know if any more issues arise so I can fix them tomorrow.

ConnectionPatch.zip

mario6714 commented 2 years ago

Sorry for bothering so late, here is 10:08 PM, thanks for the patch, i just need wait because in this moment i still cant connect to kemono.party.

mario6714 commented 2 years ago

is working great now, thanks for the patch.

Jeffchen54 commented 2 years ago

I have a more definitive patch coming later today that should counter most of the connection issues. It should work at least 25+ minutes when your computer loses connection to the server. I will release it after fine-tuning it and running my tests. Keep an eye on the releases!