View Single Post
Old 02-03-2021, 03:14 PM   #5333
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,990
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
New Test Version Posted

2021-02-03
- use_browser_cache feature added -- Read fanfiction.net stories from your Chrome browser cache instead of the network. Many thanks to Sidney Markowitz for the stellar help with this.

FanFicFare now has the ability to read your Chrome browser cache for fanfiction.net stories instead of (or in addition to) going out to the ffnet servers for them.

Obviously, the reason to do this is for when FFF is failing due to CloudFlare, but you can still see the story pages manually in your browser.

To use this:
  1. Figure out where your Chrome cache directory is and set browser_cache_path under [defaults]. If the notes below aren't sufficient, try google--that's what I'll be doing if you ask me about your OS.
  2. Set use_browser_cache:true under [www.fanfiction.net].
  3. Navigate to the story you want to download in Chrome.
  4. Click the cover image thumbnail to see the bigger version once if you care about covers.
  5. Click the author link once if you care about not getting the author image as cover.
  6. Click through all the chapters of the story. Or, if you are updating an existing story, click the first and last chapters (or all new chapters).
  7. The WebToEpub can be used to spin through the chapters for you when it generates it's epub (the button is 'Pack EPUB').
  8. Download story in FanFicFare as normal. There will be a delay as FFF starts to read your browser cache.

Example ini settings:
Spoiler:
Code:
[defaults]

## browser_cache_path needs to be set to the location of YOUR Chrome
## browser cache.  Here are a few examples for different OS.  Note
## that all have YOUR user name in them somewhere as a Chrome Profile
## name, frequently Default.  Make sure you have set (and uncommented)
## appropriately.

## Note also that browser_cache_path goes under [defaults] because
## browser cache is read once and shared between all downloads for
## performance.

## Further note that there is a time cost to first reading the browser
## cache on each download session (not Calibre session)

## windows:
#browser_cache_path:C:\Users\YourUser\AppData\Local\Google\Chrome\User Data\Default\Cache
#browser_cache_path:C:\Users\YourUser\AppData\Local\Google\Chrome\User Data\Profile 1\Cache

## mac:
#browser_cache_path:/Users/your.user/Library/Caches/Google/Chrome/Default/Cache 
#browser_cache_path:/Users/your.user/Library/Caches/Google/Chrome/Profile 2/Cache 

## linux:
#browser_cache_path:/home/youruser/.cache/google-chrome/Default/Cache
#browser_cache_path:/home/youruser/.cache/google-chrome/Profile 1/Cache

[www.fanfiction.net]

## browser cache will only be used if use_browser_cache:true and ONLY
## for fanfiction.net right now.  Requires a browser_cache_path set in
## [defaults].
use_browser_cache:true

## use_browser_cache_only:true prevents FFF from falling through to
## request from the server when a page isn't in the browser cache.
## You can turn this on to be sure you're only using the browser
## cache.
use_browser_cache_only:false

## Pre-existing ffnet INI settings you might want to think about
## changing with use_browser_cache:

## If you want covers to work correctly with use_browser_cache, you'll
## need to click the cover image at least once for each story.  Or
## turn cover off.
never_make_cover:true

## If you want skip_author_cover to work correctly with
## use_browser_cache, you'll need to click the author page at least
## once for each story.  Or turn skip_author_cover off.
##
## From defaults.ini:
## April 2015, ffnet changed their story and user pictures urls to be
## the same.  Now the only way to know if the story image is really
## the author image is to go get the author image and check.
skip_author_cover:false

## If you turned this on before, you probably want it off while using
## browser cache.
##
## From defaults.ini:
## ffnet used to have a tendency to send out update notices in email
## before all their servers were showing the update on the first
## chapter.  It generates another server request and doesn't seem to
## be needed lately, so now default it to off.
check_next_chapter:false


Again this only works with Chrome browsers and fanfiction.net (so far). I have, however, tested on Windows, Mac and Linux.

If you want to see what's happening in more detail, or have problems, run Caliber in debug mode to see the debug output.

FYI, I ran out of time this afternoon, so pre-Cal5 versions haven't been tested yet--they worked last time I tried, but code has changed since then.
UPDATE: Just did a quick test in Calibre versions 2, 3 & 4 (in windows) successfully.

Last edited by JimmXinu; 02-03-2021 at 05:55 PM.
JimmXinu is offline   Reply With Quote