AlphaSlayer1964 / kemono-dl

A simple kemono.party downloader using python.
509 stars 83 forks source link

crash while downloading user/4147932 #14

Closed MilesFarber closed 3 years ago

MilesFarber commented 3 years ago

Found Python 3 [Python.Python.3] Version 3.10.150.0 This application is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. Downloading https://www.python.org/ftp/python/3.10.0/python-3.10.0-amd64.exe ██████████████████████████████ 27.0 MB / 27.0 MB Successfully verified installer hash Starting package install... Successfully installed Requirement already satisfied: bs4 in c:\users\flaro\appdata\local\programs\python\python310\lib\site-packages (0.0.1) Requirement already satisfied: beautifulsoup4 in c:\users\flaro\appdata\local\programs\python\python310\lib\site-packages (from bs4) (4.10.0) Requirement already satisfied: soupsieve>1.2 in c:\users\flaro\appdata\local\programs\python\python310\lib\site-packages (from beautifulsoup4->bs4) (2.2.1) WARNING: You are using pip version 21.2.3; however, version 21.3.1 is available. You should consider upgrading via the 'C:\Users\Flaro\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip' command. Requirement already satisfied: requests==2.25.1 in c:\users\flaro\appdata\local\programs\python\python310\lib\site-packages (from -r requirements.txt (line 1)) (2.25.1) Requirement already satisfied: beautifulsoup4==4.10.0 in c:\users\flaro\appdata\local\programs\python\python310\lib\site-packages (from -r requirements.txt (line 2)) (4.10.0) Requirement already satisfied: Pillow==8.3.2 in c:\users\flaro\appdata\local\programs\python\python310\lib\site-packages (from -r requirements.txt (line 3)) (8.3.2) Requirement already satisfied: certifi>=2017.4.17 in c:\users\flaro\appdata\local\programs\python\python310\lib\site-packages (from requests==2.25.1->-r requirements.txt (line 1)) (2021.10.8) Requirement already satisfied: idna<3,>=2.5 in c:\users\flaro\appdata\local\programs\python\python310\lib\site-packages (from requests==2.25.1->-r requirements.txt (line 1)) (2.10) Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\flaro\appdata\local\programs\python\python310\lib\site-packages (from requests==2.25.1->-r requirements.txt (line 1)) (1.26.7) Requirement already satisfied: chardet<5,>=3.0.2 in c:\users\flaro\appdata\local\programs\python\python310\lib\site-packages (from requests==2.25.1->-r requirements.txt (line 1)) (4.0.0) Requirement already satisfied: soupsieve>1.2 in c:\users\flaro\appdata\local\programs\python\python310\lib\site-packages (from beautifulsoup4==4.10.0->-r requirements.txt (line 2)) (2.2.1) WARNING: You are using pip version 21.2.3; however, version 21.3.1 is available. You should consider upgrading via the 'C:\Users\Flaro\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip' command. Downloading: ZinFyu [4147932] icon Downloading: ZinFyu [4147932] banner Downloading: 96a7f61c-f473-4b57-bf36-309920cc98a6.jpg [==================================================] 8.7/8.7 MB, 11.7 Mbps Downloading: 11d6ec6a-cab5-4c73-b2f4-29ed440c6628.jpg [==================================================] 8.8/8.8 MB, 116.9 Mbps Downloading: a27c8b21-aae7-4f50-bb00-550650790531.jpg [==================================================] 0.1/0.1 MB, 23.4 Mbps Saving content to content.html Traceback (most recent call last): File "Z:\PortableApps\KemonoDLPortable\kemono-dl.py", line 409, in main() File "Z:\PortableApps\KemonoDLPortable\kemono-dl.py", line 405, in main if not extract_link(link.lstrip().strip().split('?')[0]): File "Z:\PortableApps\KemonoDLPortable\kemono-dl.py", line 360, in extract_link get_posts_channels(dict(info)) File "Z:\PortableApps\KemonoDLPortable\kemono-dl.py", line 321, in get_posts_channels save_post(dict(post), dict(info)) File "Z:\PortableApps\KemonoDLPortable\kemono-dl.py", line 238, in save_post result = download_inline(post['content'], post_path, args['force_inline']) File "Z:\PortableApps\KemonoDLPortable\kemono-dl.py", line 139, in download_inline file_name = link.split('?')[0].split('/')[-1] UnboundLocalError: local variable 'link' referenced before assignment

MilesFarber commented 3 years ago

This is the script i used winget install Python.Python.3 pip install bs4 pip install -r requirements.txt python kemono-dl.py --cookies "cookie.txt" --output "Z:\Documents\Pictures\Downloads" --ignore-errors --force-inline --fromfile "test.txt"

MilesFarber commented 3 years ago

Disabling --force-inline fixed it.

AlphaSlayer1964 commented 3 years ago

--force-inline is experimental but I also see the problem that's code that wasn't changed from when I was doing testing. I will have a new release today with some other changes and this particular issue will be fixed then.