Nandaka / PixivUtil2

Download images from Pixiv and more!
http://nandaka.devnull.zone/
BSD 2-Clause "Simplified" License
2.36k stars 257 forks source link

Ugoria to GIF function not working #900

Closed Pgj1997 closed 3 years ago

Pgj1997 commented 3 years ago

Description

The function the converts Ugorias to GIFs is broken

Steps to Reproduce

  1. Set createugoria and creategif to true in config.ini
  2. Open the program
  3. Type 2
  4. Paste in the ID of any ugoria

Expected behavior: The ugoira outputs to a folder in the same directory

Actual behavior: The program thows this error

Failed when converting, ffmpeg command used: ffmpeg -y -i "C:/Users/(user)/AppData/Local/Temp/ugoira2webmh1bww_vu/i.ffconcat" -filter_complex "[0:v]split[a][b];[a]palettegen=stats_mode=diff[p];[b][p]paletteuse=dither=bayer:bayer_scale=5:diff_mode=rectangle" "C:/Users/(user)/AppData/Local/Temp/ugoira2webmh1bww_vu/temp.gif"
Traceback (most recent call last):
  File "shutil.pyc", line 780, in move
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:/Users/(user)/AppData/Local/Temp/ugoira2webmh1bww_vu/temp.gif' -> '(output directory)'
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "PixivImageHandler.pyc", line 314, in process_image
  File "PixivDownloadHandler.pyc", line 335, in handle_ugoira
  File "PixivHelper.pyc", line 881, in ugoira2gif
  File "PixivHelper.pyc", line 963, in ugoira2webm
  File "shutil.pyc", line 794, in move
  File "shutil.pyc", line 426, in copy2
  File "shutil.pyc", line 259, in copyfile
FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/(user)/AppData/Local/Temp/ugoira2webmh1bww_vu/temp.gif'
Error at process_image(): (ID)
Exception: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'No such file or directory'), <traceback object at 0x040E5408>)
Dumping html to: Error medium page for image (ID).html
Unknown Error: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'No such file or directory'), <traceback object at 0x040E59E8>)

Versions

20210108-beta4 20210128

Nandaka commented 3 years ago

Can you try apng or webm too? I suspect there is permission issue to write to the temp folder?

Checked with my pc, I can convert gif/apng/webm/webp without error. image

Pgj1997 commented 3 years ago

Can you try apng or webm too? I suspect there is permission issue to write to the temp folder?

I'm pretty sure the other conversion types are irrelevant to this. Anyway, tried APNG and WEBM and got the same result. Also updated to build 20210128, and still doesn't work

Nandaka commented 3 years ago

I'm pretty sure the other conversion types are irrelevant to this.

It is relevant, because it calling the same function, just different parameter for the encoder in FFMpeg.

Like I said before, most likely this is due to permission issue when it try to access the temp folder or some issue with your username/path. Is your username have special characters?

Pgj1997 commented 3 years ago

Like I said before, most likely this is due to permission issue when it try to access the temp folder or some issue with your username/path. Is your username have special characters?

No.

Nandaka commented 3 years ago

then I have no idea as I cannot replicate your issue on my side.

Also check if the downloaded file is unblocked before extracting. image

Lawrr commented 3 years ago

I've ran into the same issue. Turns out it's due to a bad/old version of ffmpeg and updating my ffmpeg version fixes it. The "cannot find file" error is just because ffmpeg didn't run successfully so the file wasn't produced and couldn't be moved.

i.e. was getting:

[AVFilterGraph @ 03417d80] No such filter: 'palettegen'
Error configuring filters.

May be worth adding a check on the return code of ffmpeg and printing the output if it fails to make it easier to look for issues. The current error logging also made me suspect it was due to permissions initially.