Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

it cant download from danbooru #150

Closed
3 tasks done
KiraiEEE opened this issue Mar 4, 2024 · 7 comments
Closed
3 tasks done

it cant download from danbooru #150

KiraiEEE opened this issue Mar 4, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@KiraiEEE
Copy link

KiraiEEE commented Mar 4, 2024

Type

Booru parser issues

Bug description

when danbooru selected and you like a pic to download it asks for quality and then doesn't show the downloading progress or even save it so i manually just click the link and get it from the browser

Steps to reproduce

  1. select danbooru
  2. select any picture
  3. click download icon
  4. select original or sample
  5. (no animation and you get failed notification)

Android version

android 12

App version

1.4.2

Screenshots or videos

Screenshot_2024-03-04-19-13-03-400_com miui home

Screenrecorder-2024-03-04-19-13-35-227.mp4

Solution

idk maybe use the link icon value to the downloader

Additional context

i hope this get fixed , i love the app and the ui and everything

Acknowledgements

  • I have searched the existing issues and this is a new and no duplicate or related to another open issue.
  • I have written a short but informative title.
  • I filled out all of the requested information in this issue properly.
@KiraiEEE KiraiEEE added the bug Something isn't working label Mar 4, 2024
@KiraiEEE
Copy link
Author

KiraiEEE commented Mar 4, 2024

btw the other completed ones are successfully downloaded using safebooru so the problem just with danbooru

@makisukurisu
Copy link
Contributor

Can confirm.
Also on Android 12. To be more precise - Google Pixel 3 with granted permission for files/media.

As stated in the description all the other (preinstalled) boorus (Gel-, Safe-, Konachan, Yandere) do work, as well as custom Gelbooru 0.2 beta boorus.

So, most likely the problem is related to how links are handled for danbooru specifically.

@sadaakisz
Copy link

The problem is indeed with Danbooru and how its cdn handles requests with headers.

While taking a look at #149 and scripting a personal solution for downloading all my favorites, I came across a 403 Forbidden when trying to download any image from Danbooru.

This forum thread indicates some funky business when trying to access content with a program that sends headers that make it look like a browser.

In the end I ended up sending requests without headers when downloading images and had no issues.

It may be worthwhile testing if removing the request headers when downloading from Danbooru solves the issue.

PS: If someone is interested in the fav downloader code, I'll leave it here: boorusphere_fav_dl

@makisukurisu
Copy link
Contributor

makisukurisu commented Apr 26, 2024

Question for maintainers, perhaps this issue should be closed as a duplicate of #148? (Or vice versa)

@makisukurisu
Copy link
Contributor

image

From my tinkering around, sending a request with no headers works just fine. The problem lies in the FlutterDownloader itself, it would seem. (And from debugging tools Flutter provides, its requests are also not visible)

Sadly, it's not possible to see the exact response, but it indeed has a 403 status code. I assume that this sender simply adds some data that doesn't “please” Danbooru → HTTP 403.

@makisukurisu
Copy link
Contributor

makisukurisu commented Apr 28, 2024

Response Body

After some alterations to the source code of the DownloadWorker, it's now clear that the CDN presents some JS challenge to the downloads class, which it cannot solve.

Test with cURL
And if you take a look at the source code, the reason is — it's sending a request with a "strange" User-Agent, which (most likely) got banned 😃

Possible ways of solving the problem:

  • Ditch this poorly/unsupported library (Way to go, but I suppose — would require a lot of work);
  • Add a custom User-Agent property in headers when making a call (something like Boorusphere/1.0.0 works just fine for now)
  • Add authorization support (may not help in this particular case though) as requested in Feature: Allow specifying authorization information for servers #154

Working request

@nullxception
Copy link
Owner

Duplicate of #148

@nullxception nullxception marked this as a duplicate of #148 Jul 5, 2024
@nullxception nullxception closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants