JimmXinu / FanFicFare

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

Add support for Fanfic-fr.net #670

Open Nicbobbo6 opened 3 years ago

Nicbobbo6 commented 3 years ago

The main URL of stories are like this one: https://www.fanfic-fr.net/fanfics/Animes-Mangas/N/Naruto/The-Almighty-/68755.html On this page there is a list of all chapters and a link to a printable version of these chapters. For exemple, a chapter link and his printable link : https://www.fanfic-fr.net/fanfics/Animes-Mangas/N/Naruto/The-Almighty-/68755/318292.html https://www.fanfic-fr.net/fanfics/imprimer/Animes-Mangas/N/Naruto/The-Almighty-/68755/318292.html

I'm a .Net dev, so i thinks i can help with the job but i need some tips to know how to start. Thanks you for you're help and you're time.

JimmXinu commented 3 years ago

That's a pretty good candidate site for FFF. It's fanfiction and appears to have a consistent author - story - chapter structure.

I'll assume you know how to get a fork and working directory created--there are many git/github tutorials.

The code for each supported site in FFF is in an 'adapter' file in fanficfare/adapters. Each needs to be imported into fanficfare/adapters/__init__.py. For a new site, create a new adapter file and add the import. There are also two copies of the default setting (fanficfare/defaults.ini & calibre-plugin/plugin-defaults.ini) that usually need a section added.

For testing and development, I find it easiest to work with the CLI in the code dir by setting PYTHONPATH=. (how depends on OS) and calling FFF directly with a script/batch file containing python fanficfare\cli.py --save-cache -d <url>.

Putting use_basic_cache:true in your personal.ini under the new site name and using --save-cache will save and re-use downloaded pages--saves a lot of site hits when testing metadata parsing. Delete the global_* files to clear the cache and use usecache=False in the code when you need to force new fetches; such as when you need to log in.

Also, FFF still needs to be compatible with Python2.7 and Python3 for older versions of Calibre.

adapter_efpfanficnet.py is an example of an existing, non-English site adapter.

HazelSh commented 3 years ago

For testing and development, I find it easiest to work with the CLI in the code dir by setting

I just installed with setup.py in develop mode. Means it runs as a command, anywhere, but it's always executing my local up-to-date version.