Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fiction live images error #933

Closed
i-push-code opened this issue Mar 24, 2023 · 7 comments
Closed

Fiction live images error #933

i-push-code opened this issue Mar 24, 2023 · 7 comments

Comments

@i-push-code
Copy link

i-push-code commented Mar 24, 2023

https://fiction.live/stories/naive-schoolgirl-sakuras-exchange-trip/d8gx32QggbX8JYbET
This stories images arent showing up and Im using the latest fanficfare version

@JimmXinu
Copy link
Owner

Looking at it in the browser inspector, it looks like the HTML refers to images URLs like:

https://www.filepicker.io/api/file/7Fcd4vBTSeiB1t49RoxT

...which fail, but then something in the javascript inside calls a URL like:

https://cdn3.fiction.live/fp/7Fcd4vBTSeiB1t49RoxT?&quality=95

Note the similarity of UID.

filepicker.io appears to be a CDN of some kind. The error I get in FFF is 429 Client Error: Too Many Requests for url:

I don't even pretend to know how adapter_fictionlive works. @HazelSh, do you have the time and interest to look at this?

@Jemeni11
Copy link

Jemeni11 commented Mar 25, 2023

Note the similarity of UID.

I came up with this:

if url.startswith("https://www.filepicker.io/api/"):
  logger.warning("Filepicker.io image detected, converting to Fiction.live image. This might fail.")
  url = f"https://cdn3.fiction.live/fp/{url.split('/')[-1]}?&quality=95"

And it worked for the ten images I tested it with.
However, I tested it in a standalone script, so I do not know if this will work well with Fanficfare.

@HazelSh
Copy link

HazelSh commented Mar 27, 2023

I'm ill with covid at the moment, can't promise to get to this soon.

@JimmXinu
Copy link
Owner

Ugh. Hope you feel better soon.

@i-push-code
Copy link
Author

Looking at it in the browser inspector, it looks like the HTML refers to images URLs like:

https://www.filepicker.io/api/file/7Fcd4vBTSeiB1t49RoxT

...which fail, but then something in the javascript inside calls a URL like:

https://cdn3.fiction.live/fp/7Fcd4vBTSeiB1t49RoxT?&quality=95

Note the similarity of UID.

filepicker.io appears to be a CDN of some kind. The error I get in FFF is 429 Client Error: Too Many Requests for url:

I don't even pretend to know how adapter_fictionlive works. @HazelSh, do you have the time and interest to look at this?

Note the similarity of UID.

I came up with this:

if url.startswith("https://www.filepicker.io/api/"):
  logger.warning("Filepicker.io image detected, converting to Fiction.live image. This might fail.")
  url = f"https://cdn3.fiction.live/fp/{url.split('/')[-1]}?&quality=95"

And it worked for the ten images I tested it with. However, I tested it in a standalone script, so I do not know if this will work well with Fanficfare.

Thanks

@i-push-code
Copy link
Author

I'm ill with covid at the moment, can't promise to get to this soon.

Okay, hope you get better soon

@JimmXinu
Copy link
Owner

Fixed in #1004

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants