Quantcast
Channel: MobileRead Forums - Kobo Developer's Corner
Viewing all articles
Browse latest Browse all 1561

Auto Kepupify and FTP Uploader (Python+Win)

$
0
0
Hi all,

Hope everything is cool with you. I recently found this forum while researching ereaders for my wife.

After much consideration, I decided to go with the Kobo Libra 2, and it seems like a solid buy. To make everything easier for her and get to practice some python, me and ChatGPTto put together a Python script. Now, she can simply drop epubs and PDFs into an inbox folder, and they will magically be kepubified and uploaded to the Kobo via FTP on our local network.

Prerequisites:

Kobo with the ability to host an FTP server.
Possibility to refresh library.
Python 3.
NickelMenu (Probably optional if you know what to do)
Required packages:
Code:

pip install -r requirements.txt
Instructions:

Make sure to edit the config.json file with your credentials.

Code:

{
  "ftp_server": "0.0.0.0", //Change to your local IP address assigned for your KOBO.
  "ftp_port": 1021,
  "ftp_username": "root",
  "ftp_password": "",
  "ftp_path": "/ebooks/", //Some might just export files to the root folder, in that case, leave this path empty.
  "inbox_directory": "inbox", //The inbox directory can be changed, I suppose.
  "outbox_directory": "outbox", //The outbox folder is a way to ensure that files are not uploaded incorrectly. If there is a connection error, this ensures that we complete the process.
  "archive_directory": "archive", //All processed files are archived here.
  "bin_directory": "bin", //This folder contains kepubify.
  "error_log_file": "error_log.txt", //Contains error messages.
  "processed_log_file": "processed_log.txt", //Keeps track of processed files, probably unnecessary, but the idea was to not always ping the Kobo.
  "script_log_file": "script_log.txt" //Script text.
}

Run the script by clicking on main.py or using any command tool.


Code:

python main.py
Close when you're done.

The instructions are written for NickelMenu when you run the script, but you can adjust them in main.py if needed.

I've also attached my NickelMenu config for anyone interested.


Code:

_  __    _    _  __
| |/ /  _| |__ (_)/ _|_  _  ___ _ __
| ' / | | | '_ \| | |_| | | |/ _ \ '__|
| . \ |_| | |_) | |  _| |_| |  __/ |
|_|\_\__,_|_.__/|_|_|  \__, |\___|_|
                      |___/

Instructions:
1. Start Kobo.
2. Turn on WiFI.
3. Turn on FTP via NickelMenu ---> FTP.
4. Drop .EPUB/.PDF files into the Inbox folder.
5. Watch files being processed and uploaded.
6. When all files have been uploaded, Import Books via NickelMenu ---> Import books.
7. ????.
8. Profit.


Attached Files
File Type: zip KepubifyFTP.zip (1.47 MB)
File Type: txt menu.txt (3.4 KB)

Viewing all articles
Browse latest Browse all 1561

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>