Git Product home page Git Product logo

royalroad-fetchandconvert's Introduction

royalroad-fetchAndConvert

Automatically download a royalroad story, optionally convert it to kindle format and push it to the device.

GUI Homepage

Features

  • Retrieve automatically all the chapters of the given story
  • Support table of content for ebook conversion
  • Support author note at both end and start of the chapter
  • Support images
  • Support CSS rules for different stories (e.g. "Everybody Love Large Chest")
  • Convert the story in the azw3 format, and push it to the kindle.

GUI

Install

Download the latest released graphical version. For now, only the downloading is supported. The ebook generated need to be given to Calibre to convert it & to push it to your device.

Developpement

The GUI has been developped with Tkinter. Specifically, customtkinter. All the front end is inside the file gui_rfetcher.py.

The release is made by following this official tutorial.

CLI

Install

Install Python3 on your operating system.

Install needed libraries :

pip install requests-html

Also Install ADB drivers if you plan to automatically push the book into your Kindle.

It also uses calibre to convert and push the ebook to the kindle. Everything is included here.

Usage

Fetch and convert to AZW3 (Kindle Format)

The following command pull the chapter

python fetch_book.py url_of_chapter number_of_chapters name_of_ebook

Parameters :

  • url_of_chapter : The URL of the chapter (not of the story homepage!)
  • number_of_chapters : You guessed. If you want the whole book, just enter something like 99999
  • name_of_ebook : The name of the ebook, .html extension will be added when the file is written on the filesystem.

It reads the chapter content of the URL given ( url_of_chapter ) and goes to the next chapter, and it loops number_of_chapters times.

This command will give you a file name_of_ebook.html on your filesystem, that can be used through Calibre to be directly pushed to your Kindle.

Fetch, convert, and push to your device :

fetchAndCopy.py url_of_chapter number_of_chapters name_of_ebook

This script will download the chapter and push it to the first kindle detected. name_of_ebook is the name of the ebook which will be visible.

Example

If you want to fetch the best rated story Mother of Learning from the first chapter, execute the following command :

python fetch_book.py https://www.royalroad.com/fiction/21220/mother-of-learning/chapter/301778/1-good-morning-brother 102 Mother_Of_Learning

In the example above, MOL.html is written a the working directory.

royalroad-fetchandconvert's People

Contributors

lonode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

royalroad-fetchandconvert's Issues

Readme error

Please change

pip install requests

to

pip install requests-html

in readme.md

help please

this isn't an issue but i wasn't sure where to post it. can someone please tell me how to use this? or redirect me to where i can read about it? thanks and sorry for posting this here

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.