FanFicFare icon indicating copy to clipboard operation
FanFicFare copied to clipboard

[FimFiction] Fetching all stories in a users bookshelf

Open EpicLPer opened this issue 7 months ago • 3 comments

I want to automatically archive stories that I've added to my personal bookshelves, however I can't seem to find a proper way to extract story URLs from my own bookshelves.

Using the following command as example fanficfare -l "https://www.fimfiction.net/bookshelf/XXXXXX/read-it-later&view_mode=1" does somewhat work, the List view shows a lot more entries than the default view does, however this also includes featured stories that are displayed on the right side or anywhere else on the website.

Is there any way to use an alternative method? I've seen that FimFiction does have an API, tho in a previously closed GitHub issue read that FanFicFare switched away from it due to BBCode weirdness. Maybe it's possible to scrape URLs via their API but download them via webscraping instead?

Thanks!

EpicLPer avatar Nov 24 '23 16:11 EpicLPer

Not promising I'm going to do it, but here's my initial thoughts:

FanFicFare's mechanism for getting story URLs from a page is deliberately pretty general--fetch page, search for valid stories. But as you've noticed, that can get additional links sometimes, depending on site and page.

There is additional complexity in the code for some sites for series pages using the Calibre plugin version's anthology feature, but it's not really helpful for your case, or available in FFF's CLI.

The adapter_fimfictionnet.py code could probably override the default implementation of base_adapter.get_urls_from_page() with one that recognizes book shelf URLs and scrapes only the list. And/Or the base implementation could be modified to allow for an additional hook for that. If the list can be paginated when it gets long, that would increase the complexity. I don't know anything about the API off hand.

JimmXinu avatar Nov 24 '23 22:11 JimmXinu

I've read further about the API and so far it's pretty private, one can ask the Admin of FimFiction to request access but not sure if scraping stories is going to be greenlit ^^" If another method would work then I guess it's the safer option.

EpicLPer avatar Nov 25 '23 23:11 EpicLPer

I've had this exact problem.

Load the bookshelf in a browser, switch to card mode, and use an auto scrolled to scroll to the bottom slowly, letting each page load as it goes. Then repeat every x days.

nerdguy1338 avatar Mar 11 '24 05:03 nerdguy1338