EpubManager 1.0.0

dotnet add package EpubManager --version 1.0.0
                    
NuGet\Install-Package EpubManager -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EpubManager" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EpubManager" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="EpubManager" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EpubManager --version 1.0.0
                    
#r "nuget: EpubManager, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EpubManager@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EpubManager&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=EpubManager&version=1.0.0
                    
Install as a Cake Tool

EpubManager

Build EPUB 3 files from online stories. The core package knows how to write EPUBs; each site is a separate plugin package, so you only install what you use.

Install

dotnet add package EpubManager
dotnet add package EpubManager.Writers.Literotica

Targets .NET Standard 2.0.

Usage

using EpubManager.ContentSources;

IStoryWriter writer = EpubManager.EpubManager.Writers.Literotica
    ?? throw new InvalidOperationException("Install EpubManager.Writers.Literotica");

await writer.CreateEpubFromStoryAsync("https://www.literotica.com/s/some-story-slug", "./epubs");
await writer.CreateEpubFromSeriesAsync("https://www.literotica.com/series/se/123456", "./epubs");

Both methods take optional coverOverwrite, raw (write the unzipped folder instead of an .epub), and a CancellationToken. Series also take startIndex / endIndex (inclusive; endIndex 0 means through the last part).

What the writer does for you: builds in a private temp folder (concurrent builds are safe), packages the zip with mimetype first, retries transient download failures, embeds remote inline images, and keeps going with a logged warning if a cover or image can't be added. Rebuilding the same story gives the same book identifier, so e-readers don't treat it as a new book.

To build an EPUB from your own chapter files, create an EpubStory and call StoryWriter.CreateEpubAsync(story, onLog, outputDirectory, raw, cancellationToken) (or the synchronous CreateEpub). Use StoryWriter.StableId(seed) for a repeatable Identifier.

Options

Pass an EpubOptions to either create method to set the language, a synopsis, and the look of the book. Anything left unset keeps the writer's default.

using EpubManager.ContentSources;

await writer.CreateEpubFromStoryAsync(url, "./epubs", options: new EpubOptions
{
    Language = "French",                       // BCP 47 code ("fr", "pt-BR") or a name; unknown names become "und" with a warning
    Description = "A short synopsis.

Blank lines start a new paragraph.",
    Style = new EpubStyle
    {
        Font = EpubFont.SansSerif,             // Serif (default), SansSerif, Monospace
        FontSizePercent = 110,                 // 50-300, default 100
        LineHeight = 1.5,                      // 1.0-3.0, default 1.2
        TextAlign = EpubTextAlign.Justify,     // Left (default), Justify
        ParagraphStyle = EpubParagraphStyle.Indented, // Spaced (default), Indented
        ChapterHeadingAlign = EpubHeadingAlign.Center, // Left (default), Center
        SceneBreak = "~"                       // text for scene breaks ("* * *" default); "" draws a thin line
    }
});

The description is stored as the book's dc:description and shown on the title page. Style values are validated up front (ArgumentOutOfRangeException), and the default style ships the stock stylesheet unchanged. When building from your own EpubStory, set Language, Description and Style on it directly.

How plugins are found

EpubManager.Writers discovers plugins on first use. It looks at loaded assemblies and at EpubManager.Writers.*.dll files next to the application, and registers every IStoryWriter with a public parameterless constructor under its class name.

EpubManager.EpubManager.Writers.Available;        // names of what was found
EpubManager.EpubManager.Writers.Get("Literotica"); // null if not installed
EpubManager.EpubManager.Writers.Register("MySite", new MySiteWriter()); // manual

Single-file and trimmed publishes

Discovery cannot see plugins that are bundled inside a single-file executable and never referenced in code, and the trimmer can remove them. Either:

  • Copy the plugin DLL (and its dependencies) next to the executable, or
  • Reference the plugin type and register it yourself: Writers.Register("Literotica", new Literotica()).

Writing a plugin

  1. Create a class library named EpubManager.Writers.<Site> that references EpubManager.
  2. Add a public class named <Site> implementing IStoryWriter, with a parameterless constructor. Fetch the story, write each chapter to a file inside StoryWriter.NewTempDirectory() (delete it when done), build an EpubStory (set Identifier = StoryWriter.StableId(...) from the source URL), and pass it to StoryWriter.CreateEpubAsync. Wrap network fetches in EpubManagerClient.WithRetryAsync.
  3. Publish it as a NuGet package. Users install it and it is picked up automatically.

EpubManager.Writers.Literotica in this repository is a working example.

Repository layout

Project Purpose
EpubManager Core: EPUB writer, shared HTTP client, plugin registry.
EpubManager.Writers.Literotica Literotica plugin, built on LiteroticaApi.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on EpubManager:

Package Downloads
EpubManager.Writers.Literotica

Literotica writer plugin for EpubManager. Auto-discovered; no setup needed.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 100 10/7/2026