JimmXinu / FanFicFare

FanFicFare is a tool for making eBooks from stories on fanfiction and other web sites.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[FimFiction] Fetching all stories in a users bookshelf

EpicLPer opened this issue · 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!

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.

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.