-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add initial rclone support #35
base: master
Are you sure you want to change the base?
Conversation
I should have listed another "Bad" as it puts some config bits into the |
I suggest bundling a binary of rclone with the package and then using rclone itself to auto-update from the website. |
So we'd ship a I think rototilling to enable all that is a bit more than I have cycles for at the moment. (I'm still trying to debug why newly sync'ed books aren't shown, and require a reboot for the Clara HD to import them - regardless of how they were downloaded. I suspect the loopback mount isn't doing what we think it should.) |
As far as I understood, rclone can still be used as a normal command-line tool (like curl or rsync). So we don't need to change the configuration file format, we would just need to adapt the get.sh (or getRemoteFile) to use rclone, |
Hmm, I'm not sure I've ever used it that way. I've only used it via |
https://rclone.org/commands/rclone/ For example I believe that rclone copy would do what we need. |
I'm not so sure. Trying to pass a URL doesn't work, as it's looking in the config file:
If you create a config file with
Then when you pass Anyway, we can probably make something work. Worst case, use |
You are right. Rclone does not support download from anonymous links. Mmm this is quite a bummer because it would indeed change the whole approach. |
I still think we can make it work though. For downloading For downloading books, having the user create their own I really think the solution as-implemented in this PR works really well, it just needs some cleanup (aka, what I list in "Bad" in the PR) to be perfect. It certainly is WAY easier and faster (after the initial sync) than the current "iterate through every URL and download with curl" method. |
Clarified process + another user w/success using the above in #36 |
It took me a while to figure out how to use it but in the end it was worth it. I seem to have understood that to delete a book, you must do it directly on the cloud storage. |
Oh, that's interesting. I would have thought RE deleting files, what works for me is removing them from the cloud storage, and the next time rclone runs it removes them from the Kobo. |
Assuming
I tried to run the following commands locally:
The first In my opinion the "flaw" is related to the use of I could also be wrong, of course. |
Ah, I see it now. Good catch. |
To get around this "problem" it would be enough to do |
But then deleting wouldn't work - you'd have to delete items locally on the Kobo I think. I think what we'd need is a way to specify the output directory for the |
EDIT2: you are right about deleting files, because with Thinking about it on the fly, since the format of the arguments is always EDIT: remains the case where EDIT3: if the |
And it works: |
Is there any update on this ? |
@ScottESanDiego I think this is a wonderful solution that would open the door to the many sources rclone supports, without having to code for each independently. And it would add two way sync, as others mentioned. Regarding the need for a user to make a This way |
That seems like a good solution @marklar423 . I've kinda dropped this project, since DropBox via NickelMenu has been working "good enough" for me now, and @fsantini seemed to want to go a different path with the KoboCloud bits. |
Here's a first swag at adding
rclone
support.Good:
Bad:
rclone
binary (should really wget it from the static URL on the rclone site)kobo_rclone.conf
in thekobocloud
directorykobocloudrc
syntax since you cannot really identify an rclone path via URLTo make this work, you need to do a couple things:
rclone
somewhere, and create a new config for it (e.g., "ScottE_DropBox:eBooks").rclone.conf
to the kobo, and put it in.add/kobocloud/kobo_rclone.conf
kobocloudrc
that looks likeRCLONE Foo
(e.g.,RCLONE ScottE_DropBox:eBooks
)Depending on how many books you have, the first sync can take a LONG time. Afterwards,
rclone
is pretty good about only transferring new files, so it goes quickly.Full disclosure, I didn't yet 'make' a new
KoboRoot.tgz
with this, I was just updating files in the existing tarball for my tests.