-
Tachiyomi to Paperback backup conversion Convert the library, read chapter markers and categories
-
Paperback to Tachiyomi backup conversion Convert the library and read chapter markers NOTE: Library tabs are currently not converted, see Limitations NOTE: Sources used may not be in the correct language, requiring a migration, see Limitations
Supported sources can be found in
src/ConversionSources
-
Tachiyomi backup manager Allow to inflate, decode, export, encode and gzip Tachiyomi backups.
-
Light representation Export Tachiyomi and Paperback backups into a small representation, easily usable to display their library content.
On Paperback and Tachiyomi websites Using this repository scripts and ressources
-
Fork and clone this repository
-
Run:
npm install
You will then be able to modify this tool.
To add support for a new source, simply create a new class, inheriting from
AbstractConversionSource
. UpdateConversionSources.ts
with the new source converter to make it accessible for the backup converters.
To test your modifications, you can use this repository's scripts and ressources
Generate the js bundle:
npm run bundle
Add the bundled file dist/bundle/backupConverter.js
to the website assets.
Then require it from your script:
const converter = require('./backupConverter.js')
The converters only support Paperback
backupSchemaVersion 3
(app version 0.6 and newer) and Tachiyomi.proto.gz
backup formats.
Tachiyomi to Paperback
// The original backup needs to be a Buffer
const protoGzFile: Buffer
With node:
const protoGzFile = readFileSync(path)On a browser, if
file
is a File object:const protoGzFile = await file.arrayBuffer()
// Unpack the .proto.gz file and export it as a `TachiyomiObjectModel.Backup` object
const tachiyomiBackupManager = new TachiyomiBackupManager()
tachiyomiBackupManager.loadProtoGz(protoGzFile)
const tachiyomiBackup = tachiyomiBackupManager.exportBackup()
// Convert the Tachiyomi backup into a Paperback backup
const convertionManager = new TachiToPaperBackupConverter(tachiyomiBackup)
const paperbackBackup = await convertionManager.conversion()
// paperbackBackup is then a `PaperbackBackup.Backup` object
Scripts, examples and backups can be found in the ressource folder.
You can run them using ts-node
npx ts-node ressources/convertPaperToTachiBackup.ts
Backup managers define methods to manage backup files, especially loading from and exporting to .proto.gz Tachiyomi backup format. They also contains methods to edit the backup which are used by Backup Converters.
Backup Converters are responsible for managing the backup conversion process. They need to be instantiated with the backup that will be converted.
PaperToTachiBackupConverter
accept aPaperbackBackup.Backup
object:
const conversionManager = new TachiToPaperBackupConverter(paperbackBackup)
TachiToPaperBackupConverter
accept aTachiyomiObjectModel.Backup
object:
const conversionManager = new TachiToPaperBackupConverter(tachiyomiBackup)
Calling .conversion()
return a promise that resolves into the converted backup (a PaperbackBackup.Backup
or a TachiyomiObjectModel.Backup
object)
convertionManager.conversion()
.then((backup) => {
// Use the backup object
})
Classes responsible for managing the conversion between Tachiyomi and Paperback extensions. They have to convert:
- source ids
- manga ids
- chapter ids
To add support for a new source, simply create a new class, inheriting from
AbstractConversionSource
. UpdateConversionSources.ts
with the new source converter to make it accessible for the backup converters.
Paperback and Tachiyomi types are defined in their respectives folders.
Entry point of the repository. Export objects necessary for backup conversion.
Paperback to Tachiyomi converter does not include categories to not raise the error "Expected wire type 0, found 2" when the backup is restored in the app.
See src/BackupConverters/PaperToTachiBackupConverter.ts
parseBackupManga()
definition
If Tachiyomi use a different source for each language, Paperback only have a multi-languages source. Thus when converting from Paperback to Tachiyomi, the source used may be the English one, requiring a migration to use the correct one.
Tachiyomi use numeric sources ids like 2499283573021220255. To prevent an overflow, these ids should be used as Long
.
See src/BackupConverters/PaperToTachiBackupConverter.ts
parseBackupManga()
definition