Metadata-Version: 2.4
Name: sebsync
Version: 1.2.0
Summary: Synchronize Standard Ebooks catalog with local EPUB collection.
Project-URL: Source, https://codeberg.org/pbryan/sebsync
License-Expression: 0BSD
License-File: LICENSE
Keywords: book,download,ebook,ebooks,standard,sync,synchronization
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: Topic :: System :: Archiving :: Mirroring
Requires-Python: >=3.11
Requires-Dist: click<8.5,>=8.4
Requires-Dist: requests<2.35,>=2.34
Description-Content-Type: text/markdown

# Sebsync

The `sebsync` script synchronizes the [Standard Ebooks](https://standardebooks.org/) catalog with
your local ebook collection.

## How it works

The script reads the Standard Ebooks [OPDS feed](https://standardebooks.org/feeds) and reconciles the ebooks in their catalog against the EPUB files in your local filesystem, downloading new ones or updating existing ones as necessary.

If a new ebook is detected in the catalog, then it will be downloaded into your downloads directory. If an updated version of a book is detected in the catalog that is already in your local filesystem, then the updated version will be downloaded, optionally updating (overwriting) the existing local file.

The script can also display and/or remove outdated and/or deprecated ebooks. A local ebook file is “deprecated” if its identifier has been replaced by a new identifier in the Standard Ebooks catalog. This occurs when a book is renamed or substantially revised. Its replacement will be downloaded as a new ebook.

## Requirements

This script uses the Standard Ebooks OPDS 2.0 feed to access metadata on all books their catalog. In order to do so, you need to be a member of the Standard Ebooks [Patrons Circle](https://standardebooks.org/donate#patrons-circle), or have previously produced an ebook. If you’re not already a Standard Ebooks patron, please consider becoming one!

## Installation

It is easy to install sebsync using [pipx](https://pipx.pypa.io/stable/):

```
pipx install sebsync
```

## Example usage

```
sebsync --books /home/user/Books --sessionid TEXT
```

## How to get a `sessionid`

The `--sessionid` text value is a cookie that is issued by Standard Ebooks when you <em>log into</em> their website; it allows access to the OPDS feed and dowloading updated titles without throttling. To locate this text value, log into Standard Ebooks, and in browser settings (or developer tools) copy the “sessionid” cookie. On Firefox:

- <em>Log into</em> Standard Ebooks.[^1]
- Click the top-right “hamburger” (☰) menu.
- Select More tools → Web Developer Tools.
- In the pane that pops-up, click “Storage” tab.
- In the left pane of that area, expand “Cookies”.
- Click on the “https://standardebooks.org” entry below it.
- Find the “sessionid” name in the right pane.
- Double-click the value beside it and copy that text.

[^1]: Use the “log in” link at the bottom of the Standard Ebooks web page. This intiates an email being sent, and requires you to click the “log in” button in the email.
