View Single Post
Old 11-27-2015, 11:18 AM   #1
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,207
Karma: 16228558
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
[GUI Plugin] ScrambleEbook: Getting help with copyrighted books

*** May 15, 2022
Unfortunately, due to issues at home, I will no longer be providing ongoing support for this plugin. Hopefully the latest version will work OK in calibre v5.xx and the upcoming calibre v6.xx
*** Feb 2024: Still working OK in calibre v7.xx
***


Purpose:
This plugin will read an un-DRM'd ebook file (EPUB/KEPUB/AZW3) and create an external copy with scrambled content.

The aim is to create a book sufficiently obscured to allow a full upload to the MobileRead (MR) forums without breach of copyright. It should make it easier for MR members to request and offer help with problematic ebooks.

The book can be either:
  • in your calibre library
  • on an ereader device whose contents are visible to calibre

N.B: This plugin has been sanctioned by the MR Moderator Team who were instrumental in setting the rules about what must be scrambled and what can remain intact for upload to be permissible. The rules are subject to change if circumstances change.


Background:
No-one likes to see an MR member, especially a brand-new member, being issued with a severe warning from a Moderator because they uploaded a copyrighted book to the forum due to ignorance and desperation for help rather than malicious intent.

In addition, I have seen the frustration which can occur on both sides, when a knowledgeable user tries to talk a novice user through the non-trivial process of creating a short extract of their problematic book which won't fall foul of MR copyright considerations.

Anyone interested can read more in this thread Scrambling copyright ebooks to help troubleshoot problems ??? .


How to install: Preferences - Get plugins to enhance calibre Select Scramble Ebook then press Install

Configuration: None

How to use:
Spoiler:
  1. Select a single non-DRM'd book in calibre. Either from:
    • the Library view
    • the Device view of a USB-attached device
  2. Select ScrambleEbook from whichever calibre toolbar/menu you added it to
  3. Press the Scramble now button. You will see a brief description of what was done in the large box, top-left.
    (See attached image, ScrambleEbook.jpg, below)
  4. When scrambling has finished, press the Preview content button to view Original and Scrambled content side-by-side.
    (See attached image, Preview.jpg, below)
    This step is optional, but advisable, just to double-check that the text is well-and-truly obscured.
  5. Press Save scrambled book & Exit. You will be prompted to choose the directory/folder name where the scrambled copy of the book will be saved.
    Please note that AZW3 books take a little longer to process than EPUBs because of the necessary AZW3 repacking.
  6. Create your MobileRead post explaining what problems you are seeing with the original book and attach the newly-created scrambled ebook file.
  7. Hope for a speedy response from a willing and more-knowledgeable helper

Limitations:
  1. The selected ebook file must have a filetype of one of the following:
    • .epub
    • .azw3
    • .kepub
    • .kepub.epub (USB-attached Kobo only)
  2. There are some languages for which the scrambling algorithm is not effective.
    This currently includes: Chinese, Japanese, Korean, Arabic, but there will be others.

    The rule-of-thumb about which languages are 'safe' is that if both of the following are true then it's safe:
    • ALL alpha chars of ALL alphabets used in the book have 2 different unicode versions, an uppercase and a lowercase
    • All numeric chars used in the book are standard 0-9
    You are encouraged to use the included 'Preview content' button to double-check that copyrighted content has been properly obscured before posting to MobileRead.

Acknowledgements:
Thanks to RbnJrg, BetterRed and eschwartz for beta-testing and, as always, to kovidgoyal for help with all things calibre-code-related.

How is the book scrambled?
MR default settings are:
Spoiler:
  • Book content:
    - alpha chars - replaced with random choice a-z
    - digits 0-9 - scrambled to another digit
    - UPPER/lower case retained. Paragraphs look "realistic" but meaningless.
  • Hyperlink anchors: Any which do not contain any alpha chars are unchanged
  • TOC ncx: alpha chars replaced with random choice a-z, digits 0-9 unchanged
  • Punctuation, spaces: unchanged
  • Images:
    - .jpg .gif .png (including cover image) : all replaced with dummy image of same dimensions/filetype
    - .svg : all replaced with dummy .svg image
  • Embedded fonts:
    - non-obfuscated fonts removed
    - obfuscated fonts unchanged
  • OPF file: some descriptive metadata text removed (description, calibre-specific items)
  • CSS files: unchanged


Version History:
Spoiler:
  • Version 0.6.0: 15 May 2022
    • Maintenance upgrade for PyQt6/calibre6 compatibility.
  • Version 0.4.5: 02 May 2020
    • Maintenance upgrade for python3 compatibility.
    • Plugin icon updated to be more visible when using calibre's Dark mode.
  • Version 0.4.1: 23 Oct 2019 - Preview feature working again for books located on a connected device.
  • Version 0.4.0: 4 Oct 2019
    • Updated to work with calibre 4.0
      N.B: If trying to scramble a book physically located on a connected device, rather than in your calibre library, then the Preview feature has been disabled (hopefully temporarily). However, you can still create the scrambled book.
    • Added a command-line option.
  • Version 0.0.5: 19 Jan 2017 - Remove extra calibre-specific metadata from EPUB3 books
  • Version 0.0.4: 27 Nov 2015 - Initial release
Attached Thumbnails
Click image for larger version

Name:	ScrambleEbook.jpg
Views:	1602
Size:	39.3 KB
ID:	144115   Click image for larger version

Name:	Preview.jpg
Views:	1737
Size:	232.1 KB
ID:	144116  
Attached Files
File Type: zip ScrambleEbook_v0-6-0.zip (114.6 KB, 34034 views)

Last edited by jackie_w; 02-16-2024 at 08:39 AM. Reason: Added note re: calibre v7
jackie_w is offline   Reply With Quote