JimmXinu / FanFicFare

FanFicFare is a tool for making eBooks from stories on fanfiction and other web sites.
Other
750 stars 161 forks source link

Can't or won't read Fiction.Live #858

Closed NaoDarkness closed 2 years ago

NaoDarkness commented 2 years ago

I know Fiction.Live is a supported website, but every time I input this URL:

https://fiction.live/stories/Warhammer-Fantasy-Thrust-Into-The-Struggle/cei3gk6W2cDCwHWWf/home

I get this:

Error Warhammer Fantasy: Thrust Into The Struggle mog HTTP Error in FFF '400 Client Error: Bad Request for url: https://fiction.live/api/anonkun/chapters/cei3gk6W2cDCwHWWf/1559794476728/1560074414345/'(400) https://fiction.live/stories//cei3gk6W2cDCwHWWf

It seems to be deleting the "Warhammer-Fantasy-Thrust-Into-The-Struggle" part for some reason, I don't know if this is causing the issue or not.

So digging even further I get this:

https://pastebin.com/MemmKcKG

Any help would be appreciated, Thank You.

JimmXinu commented 2 years ago

@HazelSh - Do you have time and interest to look into this?

(I don't personally know anything about fiction.live or FFF's code for it.)

HazelSh commented 2 years ago

Yeah, I'll take a look.

Removing the title is fine -- that's part of the url normalization, and it looks like the normalized version with no title or chapter-id loads fine in firefox.

Can't load the pastebin url -- says it's private. Try accessing it from a device where you're not logged in / didn't create it?

HazelSh commented 2 years ago

I've reproduced the bug locally -- first attempt at downloading the story gave the same error at the same spot. But then it got weird: trying to download it directly worked fine, giving a short chapter-range including it worked fine. Skipping it, more chapters errored out later on. Enabling use_basic_cache, things broke at different chapter entirely. Between that and the stacktrace, I suspect it's not to do with the specific chapter at all.

It could maybe be something about that story in particular, but if so I don't yet see how.

At this point, I really want to see the entire http request for chapter requests that error out and ones that don't. Tomorrow I might look into logging in FFF/requests and investigate the FFF request handling infrastructure, or alternatively I might get my girlfriend to show me how to set up mitmproxy to intercept the request.

JimmXinu commented 2 years ago

FFF uses the requests package from the RequestsFetcher class in fanficfare/fetcher.py. I believe there's a setting that can be passed to requests to get debugging details, but I don't remember what or where off hand. It may be a global or even an env var.

NaoDarkness commented 2 years ago

Sorry about making it private, force of habit, the Pastebin is now public.

HazelSh commented 2 years ago

This bug is no longer reproducible with this story. Just tried it twice, story downloaded correctly with no errors both times.

Sorry about the delay. However, seems to have fixed itself in the meantime. As I didn't change anything, I'm assuming it was a fiction.live site bug. Please try it again, and let me know what happens.