View Single Post
Old 09-06-2022, 09:13 AM   #33
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,203
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
Another semi-automatic solution for you to get around this error:
  • Choose all the books you want, and use calibre gui to convert to text.
  • Modify the Action Chain code to use the text file created by calibre conversion. (I can help with that if you don't know to do it)
  • Delete all the converted text files using calibre's "remove format" option.

Edit: You can make a chain of all the above steps. Make sure to check the option to wait for ongoing jobs in the "Calibre Actions" settings dialog.

Edit2: Chain attached below.

There are two things to take into consideration while using this chain
  • The chain is interactive because the convert step will pop up a dialog asking you for input. Make sure you select the output format to be text.
  • Warning: that this chain will delete all (selected) text formats even pre-exsiting ones. If you don't want this remove the last action from the chain and manually delete the text files instead

Edit3: For anyone else who wants to test this, you must make a dictionary of tags and corresponding regular expressions in the format illustrated below (This is the format chosen by OP in his original code).

Code:
{
    "case_sensitive_tag": "case_sensitive_tag",
    "science-fiction": "(?i)science.?fiction",
    "non-fiction": "(?i)non.?fiction"
}
The location of dictionary is controlled by a variable in the first action withing the chain. You have to change the variable to the location of your dictionary.
Attached Files
File Type: zip extract_tags_2.zip (1.2 KB, 66 views)

Last edited by capink; 09-06-2022 at 04:46 PM.
capink is offline   Reply With Quote