KJHJason / Cultured-Downloader

A project to automate the process of downloading images and other attachment files from platforms like Fantia and more!
GNU General Public License v3.0
69 stars 7 forks source link

[Bug]: Fantia downloads failed #28

Closed zxgbs closed 1 year ago

zxgbs commented 1 year ago

Which program are you seeing this problem on?

Cultured Downloader (exe)

Program Version

4.2.1

Steps to reproduce the bug

  1. choose 1. Download Fantia Posts
  2. choose 1. Download images from Fantia post(s)
  3. Enter URL(s) (X to cancel): https://fantia.jp/posts/1704263
  4. Do you wish to download from these URLs? (Y/n): y Download images? (Y/n/x to cancel): y Download thumbnail? (Y/n/x to cancel): y Download attachments? (Y/n/x to cancel): y

Expected behaviour

the post should have been downloaded

Relevant log output (If any)

the log says: Failed to get the details of 'https://fantia.jp/posts/1704263' after 4 requests.

Screenshots (Optional)

No response

KJHJason commented 1 year ago

I was able to locate the issue, turns out Fantia's API now requires a x-csrf-token in the request header. Otherwise, a 403 Forbidden response will be returned.

This x-csrf-token value can be retrieved from the HTML's meta tag while logged in, <meta name="csrf-token" content="...">

I am currently fixing this issue in the CLI version before integrating this Python program with the golang CLI program.

KJHJason commented 1 year ago

I have fixed the issue and released a new version, v4.2.2, before working on v5.0.0 which uses the CLI version of this program, developed with Golang, for its download logic.

Please re-open this issue if the issue still persists on your end.