View Single Post
Old 12-01-2016, 10:35 PM   #1
trap000d
Member
trap000d can illuminate an eclipsetrap000d can illuminate an eclipsetrap000d can illuminate an eclipsetrap000d can illuminate an eclipsetrap000d can illuminate an eclipsetrap000d can illuminate an eclipsetrap000d can illuminate an eclipsetrap000d can illuminate an eclipsetrap000d can illuminate an eclipsetrap000d can illuminate an eclipsetrap000d can illuminate an eclipse
 
Posts: 23
Karma: 8028
Join Date: Sep 2016
Device: Kindle PW1
Dropbox client, Seafile client

Please welcome to test my little projects:

https://github.com/trap000d/seafile-kindle-client
https://github.com/trap000d/dropbox-kindle-client

They both are made as KUAL extensions and work similarly so installation instructions are similar too. In short words: download, unpack to extensions folder, edit config, start KUAL, use.

I refrained from implementing daemon mode for several reasons:
1. Almost all the time I keep my Kindles in airplane mode, therefore these scripts when running in background will only eat resources.
2. Frequent notifications are distracting, but without notifications it's not possible to get information about synchronization process.
3. If you remove or replace open document, the result is unpredictable.

Longer description
Seafile client:
Spoiler:

# seafile-kindle-client
Simple client for synchronization between Kindle and Seafile server. Upload works only for particular direectory.

### Installation

- Your kindle must be jailbroken
- Install python for kindle https://www.mobileread.com/forums/sho...d.php?t=225030
- Copy the contents of KUAL/seafile directory into /mnt/us/extensions/seafile
- Copy seafile.cfg.example to seafile.cfg, set there proper server address, library name, your login and password (as well as path to local directory):
```
[server]
url = https://seafile.example.com
library = MyBooks
user = user@mail.server
password = Password
; SSL certificate verify options: True, False or path to self-signed crt file
cert = False

[kindle]
local = /mnt/us/documents/Seafile
upload = /MyKindle_1
; screen dimensions in chars: 68x60 for PW3/KV, 48x42 for PW2
width = 68
height = 60
```
Run it via KUAL menu:
- KUAL -> Seafile Sync -> Synchronize
or
- KUAL -> Seafile Sync -> Push to server

At the first run script will obtain an authentication token at Seafile server and remove your login and password entries from configuration file (for security reasons).

### Known Issues/Bugs/Limitations
- Synchronization (download) works pretty well for 100-200 files in 3 sub-dir levels with overall size 1 Gb. For testing a bigger volumes I'll have to re-solder Kindle storage chip and hack firmware.
- One'n'half-way synchronization (only newly created local files are uploaded to server). As ID of file is generated on the server, there is no reliable way to determine if file is changed locally by it's ID. File timestamp doesn't look good too as kindle clock might reset after cold restart.
- There is an option for uploading of the particular directory contents (useful e.g. for notes synchronization). As all files in that directory have to be uploaded to the server you should be careful: it could take much time.
- Directory for uploads must exist on the server. You have to create it there (e.g. via web interface or with desktop seafile client) and perform synchronization (download) at least once before upload.
- Upload directory must be a sub-folder in directory tree, e.g. /mnt/us/documents/Seafile/MyKindle_1. In config it should be defined as relative path to the base directory
- File ID is a hash of file therefore all exact copies of particular file will have the same ID (though different names). Because the client idea is based on ID comparison, then if you make a copy of existing file at the server, client will download only the first file.
- Just rudimentary checks of internet/WiFi availability/file operations
- Hidden files/folders are not synchronized as well as bookmarks/statistics (*.sdr). It's because client has keeping actual state in hidden files ".hash", also some FUSE FS garbage often present as .fuse_hiddenXXXXXX.


Dropbox client:
Spoiler:
# dropbox-kindle-client
Dropbox client for Amazon Kindle
Based on Seafile client https://github.com/trap000d/seafile-kindle-client

### Installation

- Your kindle must be jailbroken
- Install python for kindle https://www.mobileread.com/forums/sho...d.php?t=225030
- Copy/unpack the contents of KUAL/dropbox directory to /mnt/us/extensions/dropbox
- Copy dropbox.cfg.example to dropbox.cfg, set Dropbox folder to sync, as well as your Dropbox token (see howto generate token here: https://www.dropbox.com/developers/r...ng-up-your-app)

```
[server]
; Dropbox folder to synchronize
library = MyBooks
; Dropbox API Token
token = s7ergngt3y3fhdsnvjdnvnjfbfywfgywgcsdsdbsd

[kindle]
; Local Kindle directory to synchronize
local = /mnt/us/documents/Dropbox
; contents of /mnt/us/documents/Dropbox/MyKindle_1 ("local"+"upload") will be forced to upload
upload = /MyKindle_1
; screen dimensions in chars: 68x60 for PW3/KV, 48x42 for PW2
width = 68
height = 60
```

### Run

Via KUAL menu:
- KUAL -> Dropbox Sync -> Synchronize
or
- KUAL -> Dropbox Sync -> Push to server
In this case all the contents of directory 'local+upload' will be forced to upload into Dropbox (useful e.g. for notes synchronization).

Via command line:

```/mnt/us/extensions/dropbox/bin/dbcli.py ``` for sync
```/mnt/us/extensions/dropbox/bin/dbcli.py push ``` for upload

### Known Issues/Bugs/Limitations
- One'n'half-way synchronization (only newly created local files are uploaded to server). As ID of file is generated on the server, there is no reliable way to determine if file is changed locally by it's ID. File timestamp doesn't look g
ood too as kindle clock might reset after cold restart.
- There is an option for uploading of the particular directory contents (useful e.g. for notes synchronization). As all files in that directory have to be uploaded to the server you should be careful: it could take much time.
- Directory for uploads must exist on the server. You have to create it there (e.g. via web interface or with official Dropbox client) and perform synchronization (download) at least once before upload.
- Upload directory must be a sub-folder in directory tree, e.g. /mnt/us/documents/Dropbox/MyKindle_1. In config it should be defined as relative path to the base directory
- Just rudimentary checks of internet/WiFi availability/file operations
- Hidden files/folders are not synchronized as well as bookmarks/statistics (*.sdr). It's because client has keeping actual state in hidden files ".hash", also some FUSE FS garbage often present as .fuse_hiddenXXXXXX.


What's new:
0.1.2
  • More intelligent network errors handling
  • Automatic detection of screen size: you can remove 'height' and 'width' parameters from config

0.1.3
  • Automatic wireless state detection, activation and deactivation.
  • bugs/issues/UI fixes

ToDo:

override problems with non-Unicode 'bad' characters in file names:
  • legacy 8859-1 (Latin-1) symbols are still in use in Germany (and probably other countries), but are not interpreted properly by official Dropbox client
  • Other symbols not compatible with Kindle FAT file system, e.g. <,>,?,#,:

Download links for current versions:

Seafile client:
https://github.com/trap000d/seafile-.../v0.1.3.tar.gz

Dropbox client:
https://github.com/trap000d/dropbox-.../v0.1.3.tar.gz

Find new releases here:
https://github.com/trap000d/seafile-...lient/releases
https://github.com/trap000d/dropbox-...lient/releases
Attached Files
File Type: gz seafile-kindle-client-0.1.1.tar.gz (19.9 KB, 494 views)
File Type: gz dropbox-kindle-client-0.1.tar.gz (18.8 KB, 527 views)
File Type: gz dropbox-kindle-client-0.1.2.tar.gz (18.9 KB, 530 views)
File Type: gz seafile-kindle-client-0.1.2.tar.gz (19.8 KB, 505 views)
File Type: gz dropbox-kindle-client-0.1.3.tar.gz (19.3 KB, 566 views)
File Type: gz seafile-kindle-client-0.1.3.tar.gz (20.1 KB, 518 views)

Last edited by trap000d; 12-28-2016 at 09:46 PM. Reason: New version 0.1.3 pushed
trap000d is offline   Reply With Quote