Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Related Tools

Notices

Reply
 
Thread Tools Search this Thread
Old 03-20-2025, 08:11 AM   #1
Incanus
Incanus
Incanus doesn't litterIncanus doesn't litterIncanus doesn't litter
 
Incanus's Avatar
 
Posts: 313
Karma: 210
Join Date: Oct 2017
Location: Chile
Device: Boyue Likebook T80D
Question Content Server Download from Calibre Sync and Regular Expressions

Hello:

Is it possible to change the way that Calibre Sync downloads files from Calibre Content Server running from a Windows installation?

My intent is to use regular expressions to create a folder / subfolder structure and naming convention for the downloaded files, as explained here.

Calibre's creator told me that such customization is done on the client side.

How could I customize Calibre Sync for this purpose?

Awaiting your kind reply,
Incanus is offline   Reply With Quote
Old 03-20-2025, 10:01 AM   #2
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
Posts: 13,249
Karma: 78869092
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
Quote:
Originally Posted by Incanus View Post
Hello:



Is it possible to change the way that Calibre Sync downloads files from Calibre Content Server running from a Windows installation?



My intent is to use regular expressions to create a folder / subfolder structure and naming convention for the downloaded files, as explained here.



Calibre's creator told me that such customization is done on the client side.



How could I customize Calibre Sync for this purpose?



Awaiting your kind reply,
The calibre sync team does not appear to follow this forum. While they have made a post or two here, you're best to try other ways of contacting them; I believe there is an option within their app for support questions.

Sent from my Pixel 7a using Tapatalk
PeterT is offline   Reply With Quote
Old 03-20-2025, 10:28 AM   #3
Incanus
Incanus
Incanus doesn't litterIncanus doesn't litterIncanus doesn't litter
 
Incanus's Avatar
 
Posts: 313
Karma: 210
Join Date: Oct 2017
Location: Chile
Device: Boyue Likebook T80D
Thanks for your prompt reply!

I've used the app as per your suggestion: if and when I get a reply I shall post it here.

Gratefully,
Incanus is offline   Reply With Quote
Old 03-20-2025, 04:48 PM   #4
Incanus
Incanus
Incanus doesn't litterIncanus doesn't litterIncanus doesn't litter
 
Incanus's Avatar
 
Posts: 313
Karma: 210
Join Date: Oct 2017
Location: Chile
Device: Boyue Likebook T80D
In it's FAQs, CalibreSync states that for downloading on Library Format V2:

Quote:
Downloaded book filename pattern is <book-title>_<book-unique-identifier>.<extension>, this pattern appends unique identifier to the filename. This is the*default format*of Calibre Sync libraries.
If I wanted to obtain the files directly from Calibre, and then copy them to the device, instead of downloading them, is there a regular expression that could achieve the end result, vis a vis as CalibreSync generates it?

Thanks in advance,

Last edited by Incanus; 03-20-2025 at 05:22 PM. Reason: Added links and format,some text was missing
Incanus is offline   Reply With Quote
Old 03-20-2025, 10:51 PM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,128
Karma: 27110892
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
When you download books from the calibre server whatever tool you use to do the download is free to choose whatever filename it likes for the downloaded file.
kovidgoyal is offline   Reply With Quote
Old 03-21-2025, 05:48 AM   #6
Incanus
Incanus
Incanus doesn't litterIncanus doesn't litterIncanus doesn't litter
 
Incanus's Avatar
 
Posts: 313
Karma: 210
Join Date: Oct 2017
Location: Chile
Device: Boyue Likebook T80D
Indeed, but the download is rather slow, specially so for the first time when I'm installing my (rather large) library.

Hence the need to speed up the process using send to file and then copy to the device.

If I included a couple of examples of the books downloaded by Calibre Sync (along with what is actually stored on Calibre) would it be possible to create a regular expression (that isn't published in CS documentation, mind) to replicate the process from Calibre, using send to file?

Thanks in advance,
Incanus is offline   Reply With Quote
Old 03-21-2025, 05:52 AM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,128
Karma: 27110892
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
What process from calibre? calibre has no process of saving files on devices via the content server.
kovidgoyal is offline   Reply With Quote
Old 03-21-2025, 06:33 AM   #8
Incanus
Incanus
Incanus doesn't litterIncanus doesn't litterIncanus doesn't litter
 
Incanus's Avatar
 
Posts: 313
Karma: 210
Join Date: Oct 2017
Location: Chile
Device: Boyue Likebook T80D
That is so, which is why I mean to use Save to Disk (I previously wrote "send to file", my mistake) on Calibre and then manually copy the files to the device using CS, since downloading the whole library for the first time from CS takes forever, etc.

That's why I need to figure out a regular expression that would produce the files from Calibre with the naming convention used (but not documented) by CS, just so after transferring the files to the device CS would recognize them as downloaded on the device: available for reading on the device.

This is just for the first installation of my (large) library on the device using CS, because downloading takes up to much time. After that, I'll be using Calibre Content Server to download the files (a few at a time, as I incrementally add then to my Calibre library) from CS.

Maybe I am not making too much sense...

Last edited by Incanus; 03-21-2025 at 06:37 AM.
Incanus is offline   Reply With Quote
Old 03-21-2025, 09:18 AM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,128
Karma: 27110892
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
save to disk uses templates not regular expressions to decide file names. See Preferences->Save to Disk. Templates are arbitrarily powerful you can even write complete python programs inside them. So as long as you know the format you need you should be able to save them. Cant help you with the exact format specification though only calibre sync developers can tell you that.
kovidgoyal is offline   Reply With Quote
Old 03-21-2025, 01:42 PM   #10
Incanus
Incanus
Incanus doesn't litterIncanus doesn't litterIncanus doesn't litter
 
Incanus's Avatar
 
Posts: 313
Karma: 210
Join Date: Oct 2017
Location: Chile
Device: Boyue Likebook T80D
Quote:
Originally Posted by kovidgoyal View Post
Cant help you with the exact format specification though only calibre sync developers can tell you that.
Thanks again for your kind reply.

I've written to Calibre Sync support with that exact question, but they haven't replied yet.

If I get an anwser, I'll post it here.

Gratefully,

Last edited by Incanus; 03-21-2025 at 01:42 PM. Reason: typo
Incanus is offline   Reply With Quote
Old 03-24-2025, 03:08 PM   #11
Incanus
Incanus
Incanus doesn't litterIncanus doesn't litterIncanus doesn't litter
 
Incanus's Avatar
 
Posts: 313
Karma: 210
Join Date: Oct 2017
Location: Chile
Device: Boyue Likebook T80D
Question

I'm almost there; after checking "Book details" dialog/window on Calibre desktop, it turns out that the regular expression used by Calibre Sync to download on Library Format V2 is something like this:

Code:
{title} - {author:sublist(0,1,&)}_{uuid}
However, the title comes a little off, because of the prefix/sort order.

For instance, if the epub book is named "The book title" by author "Author" with uuid "the-uu-id-of-the-book", Calibre Sync downloads the book as:

Code:
The book title - Author_the-uu-id-of-the-book.epub
However, my "current" regular expression produces (using, say, Save to Disk) the following file name:

Code:
book title, The - Author_the-uu-id-of-the-book.epub
Any suggestions on how to improve/correct my regular expression in order to create a filename as Calibre Sync reads it?

Thanks in advance,
Incanus is offline   Reply With Quote
Old 03-24-2025, 06:13 PM   #12
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 44,283
Karma: 165617033
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
You could try replacing {title} by {title_sort} which should return Book Title, The which seems to be what you want.

Code:
{title_sort} - {author:sublist(0,1,&)}_{uuid}
DNSB is offline   Reply With Quote
Old 03-25-2025, 07:06 AM   #13
Incanus
Incanus
Incanus doesn't litterIncanus doesn't litterIncanus doesn't litter
 
Incanus's Avatar
 
Posts: 313
Karma: 210
Join Date: Oct 2017
Location: Chile
Device: Boyue Likebook T80D
Quote:
Originally Posted by DNSB View Post
You could try replacing {title} by {title_sort} which should return Book Title, The which seems to be what you want.
Thanks for your reply!

Confusion aside (my fault) I'm actually trying to produce:

Code:
The book title - Author_the-uu-id-of-the-book.epub
However, wether I use {title} or {title_sort} I always get:

Code:
book title, The - Author_the-uu-id-of-the-book.epub
I'm guessing the problem is that in some of my books {title} = {title_sort}, but as I stated before, I'm getting a "[...], The" either way.

Any ideas?

Thanks in advance,

Last edited by Incanus; 03-25-2025 at 07:16 AM.
Incanus is offline   Reply With Quote
Old 03-25-2025, 07:19 AM   #14
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,128
Karma: 27110892
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Either change Preferenes->Tweaks->Control formatting of title and series when used in templates or use the raw_filed() function in your template
kovidgoyal is offline   Reply With Quote
Old 03-25-2025, 08:31 AM   #15
Incanus
Incanus
Incanus doesn't litterIncanus doesn't litterIncanus doesn't litter
 
Incanus's Avatar
 
Posts: 313
Karma: 210
Join Date: Oct 2017
Location: Chile
Device: Boyue Likebook T80D
Quote:
Originally Posted by kovidgoyal View Post
Either change Preferenes->Tweaks->Control formatting of title and series when used in templates or use the raw_filed() function in your template
Thanks again for your prompt reply!

I'll try that and report back with my results: later, since I'm now at work with neither time nor access for my efforts to Save to Disk to emulate downloading my Calibre library a la Calibre Sync...

... that should only make sense if your library is as huge as mine and you want to have all your library locally on your device: otherwise, simply download (as needed to read) with Calibre Sync, connected to a Calibre content server or a cloud copy of your Calibre library.

Much obliged,

Last edited by Incanus; 03-25-2025 at 09:47 AM.
Incanus is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Content Server Download and Regular Expressions Incanus Server 3 03-26-2025 07:21 PM
Calibre Sync & Content Server HippieWiccan Server 2 07-30-2024 03:48 PM
Calibre Miscellaneous and Annotation Sync Missing in Calibre Viewer Content Server machuni Viewer 3 03-06-2023 07:48 PM
calibre-sync: Automatically download books from your Calibre Content Server onto Kobo mishagale Related Tools 14 05-13-2019 05:18 PM
Regular expressions, Calibre and you- an introduction (Archived) Manichean Conversion 80 11-11-2010 07:37 AM


All times are GMT -4. The time now is 06:42 PM.


MobileRead.com is a privately owned, operated and funded community.