Skip to main content

Shiori logo: a red badge with a download arrow carrying a play button

Shiori

栞 — "bookmark." Your channel's bookmark.

tests python 3.11+ MIT license

Point Shiori at a YouTube channel. Come back later and run it again.


What it does

Shiori archives a whole YouTube channel to plain .mp4 files on your disk:

  • Videos, shorts, livestreams — pick one tab or take all three, each landing in its own folder.
  • Captions baked in as soft subtitles — both the uploader's subtitles and YouTube's auto-generated ones ride along inside the mp4 as toggleable text tracks. The video itself is never re-encoded, and no .vtt files are left behind.
  • Incremental by default — every run records video IDs in .shiori-archive.txt, so re-running a 500-video channel fetches only the new uploads.
  • Untouched download output — yt-dlp's own progress streams straight to your terminal, exactly as it emits it. Tab headers, a per-tab summary, and a timestamped log file wrap around it.

Shiori is a thin, opinionated wrapper around yt-dlp. It has zero runtime dependencies — everything else is the Python standard library.

Requirements

  • Python 3.11+
  • yt-dlp on your PATH
  • ffmpeg on your PATH (merging formats and embedding subtitles both go through it — Shiori checks for both before doing anything)

Install

git clone https://github.com/<you>/shiori.git
cd shiori
pip install -e .

That registers the shiori command. (python -m shiori works too.)

Quick start

# Archive a channel's videos
shiori "https://www.youtube.com/@SomeChannel"

# Everything: videos + shorts + livestreams
shiori "https://www.youtube.com/@SomeChannel" --type all

Bare handles work too: shiori @SomeChannel. It also accepts /channel/…, /c/… and /user/… URLs.

A real session looks like this (yt-dlp's own output streams straight through):

shiori: archiving YouTube (yt-dlp 2026.08.19, ffmpeg version N-125365-g9a01c1cb6a-20260630)
== shorts ==  https://www.youtube.com/@YouTube/shorts
[download] 100% of  448.87KiB in 00:00:00 at 926.63KiB/s
[Merger] Merging formats into ".../2026-10-13 - carrying the pots and pans is a rite of passage @andrewtrs [en].mp4"
  downloaded 9.5 MiB (1 file)
Archive run: 1 tab, 1 ok, 0 failed

What you get

archives/
  Some Channel/
    .shiori-archive.txt          # incremental state — don't delete this
    .shiori-logs/
      20261014-202724.log        # one per run
    videos/
      2026-10-08 - 20 years of esports history explained [en].mp4
    shorts/
      2026-10-13 - carrying the pots and pans is a rite of passage @andrewtrs [en].mp4
    streams/
      ...

Filenames are upload-date - title [subtitle-langs].mp4. Every mp4 carries h264 video, aac audio, mov_text subtitle tracks, and embedded cover art + metadata.

Re-runs

Run the same command weekly, monthly, whenever. Videos already in .shiori-archive.txt are skipped by yt-dlp, so only new uploads download:

== shorts ==  https://www.youtube.com/@SomeChannel/shorts
[download] Q_BC8ZhiZoU: carrying the pots and pans is a rite of passage @andrewtrs has already been recorded in the archive
  downloaded 0 B (0 files)
Archive run: 1 tab, 1 ok, 0 failed

--full ignores the archive file and rebuilds everything from scratch.

Bot checks ("Please sign in" with no cookies)

Some videos answer every default request with ERROR: … Please sign in — that's YouTube's bot-check wall (IP-reputation based), not a broken video. Tested October 2026 against a gated short: the default, android, ios, mweb, tv and web_safari clients all hit the wall, while web_embedded sailed through with identical quality (720p h264 + AAC — the same 136+140 pick the defaults make):

shiori "https://www.youtube.com/@SomeChannel" --type all `
  --extractor-args "youtube:player_client=web_embedded"

Notes, honestly stated:

  • --extractor-args is a generic passthrough (repeatable) precisely because these gates move — today's recipe may need adjusting tomorrow, and that shouldn't require a shiori release.
  • If every client fails on a video, your IP is hard-flagged: change networks, slow down, or accept cookies for those items. Static hardcoded PO tokens don't work anymore (YouTube binds them per video); the heavy alternative is the bgutil PO-token server plus its yt-dlp plugin.
  • Cookies remain the reliable fix whenever they're an option.

Missing tabs & partial runs

Not every channel has every tab. If @SomeChannel has no livestreams, that tab is skipped — not failed:

== streams ==  https://www.youtube.com/@SomeChannel/streams
  -- no streams tab, skipping

Similarly, a tab where some videos fail (gated items, deletions) but others download reports completed with errors and counts toward success — only a tab that errors with nothing new downloaded is a real FAIL (exit 1). A re-run of a healthy archive is all skips and 0 B lines, exiting 0.

Heavy use

Big channels mean long runs. Shiori parallelizes across videos, not fragments:

shiori "https://www.youtube.com/@SomeChannel" --type all --workers 3

Each worker runs the exact same flags a single-shot run would use, on its own slice of video URLs with its own archive shard file — the fetched bytes are identical, only the concurrency differs, so quality is untouched. Shards merge back into .shiori-archive.txt when the tab finishes, and a live 143/500 videos line tracks progress. --workers 1 restores strict sequential mode; already-archived IDs are filtered before splitting, so a fully-archived tab skips downloading entirely.

Three guards keep long runs safe:

  • Disk check — refuses to start below --min-disk-gb free space (default 5 GiB, 0 disables).
  • Channel lock — one run per channel folder at a time (.shiori-lock, stale locks from dead runs are taken over). --no-lock opts out.
  • Cheap tab probes — existence checks list a single item, so even 10k-video tabs start fast.

For full output capture (shiori streams yt-dlp's own log straight to your terminal), mirror it yourself:

shiori "https://www.youtube.com/@SomeChannel" --type all *>&1 | Tee-Object run.log

Options

usage: shiori [-h] [-o OUTPUT] [-t {videos,shorts,all}]
              [--sub-langs SUB_LANGS] [--since SINCE] [--until UNTIL]
              [--full] [-j JOBS] [--cookies COOKIES] [--dry-run]
              [--yt-dlp YT_DLP] [--fail-fast] [--channel-name CHANNEL_NAME]
              [--sleep SLEEP] [--throttled-rate THROTTLED_RATE]
              [--http-chunk-size HTTP_CHUNK_SIZE] [--ipv4] [--no-log]
              url
Flag What it does
-o, --output DIR Archive root (default: ./archives)
-t, --type videos (default), shorts, or all (videos + shorts + streams)
--sub-langs LANGS Subtitle languages, yt-dlp syntax (default: "en.*", use "all" for everything)
--since / --until Date range filter (YYYYMMDD)
--full Ignore the archive file, re-download everything
-j, --jobs N Concurrent download fragments per video (default: 8)
--workers N Videos downloaded in parallel per tab (default: 3, 1 is sequential)
--min-disk-gb GB Refuse to start below this free space (default: 5.0, 0 disables)
--no-lock Allow concurrent runs on one channel (risks archive corruption)
--cookies FILE Netscape cookie jar, for age- or bot-gated channels (checked up front)
--dry-run Print the exact yt-dlp commands without running anything
--yt-dlp PATH yt-dlp binary to use (default: from PATH)
--fail-fast Stop remaining tabs after the first failure
--channel-name NAME Skip the channel-name lookup (keeps --dry-run fully offline)
--sleep N Seconds between requests (default: 2.0)
--throttled-rate R Re-extract when a download crawls below this (default: 100K, 0 disables)
--http-chunk-size S Size of chunked range requests (default: 10M)
--ipv4 Force all connections over IPv4
--extractor-args IE:ARGS Pass raw args to an extractor (repeatable; see Bot checks)
--no-log Don't write the per-run log file

Exit codes: 0 success — including tabs that finished with errors or were skipped · 1 a tab failed outright (nothing new downloaded) · 2 bad usage · 3 missing yt-dlp/ffmpeg.

How it works

One yt-dlp invocation per channel tab, with a curated flag set (-t mp4, soft-sub embedding, metadata + thumbnail embedding, throttle recovery). Subtitle files are routed into a temporary scratch directory for embedding and the whole tree is deleted afterwards — that's the mp4-only guarantee. Nothing is ever passed through a shell: argv is always a list, so & and ; in video titles can't break out.

parse → preflight (yt-dlp + ffmpeg) → resolve channel name
      → plan one command per tab → per tab: check it exists → run → measure → report

For hackers

shiori/
  cli/        argument surface + pipeline wiring
  core/       shared models and errors (each error carries an exit code)
  channel/    URL normalization, tab registry
  naming/     folder sanitizing, filename template, [lang] tag
  planner/    pure Options → argv (no I/O, fully tested)
  runner/     the only layer that touches the outside world
tests/        mirrors the package one-for-one, pytest, no network
python -m pytest tests/ -q

Why "Shiori"?

栞 (shiori) means bookmark — a guide slipped between pages so you can find your way back. That's the whole job: a bookmark for a channel, keeping your place while it grows.

License

MIT — see LICENSE.

Metadata

Release files for shiori-archiver 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shiori-archiver 0.1.0
File Size Uploaded Provenance Actions
shiori_archiver-0.1.0.tar.gz 40.4 kB Without provenance Details for shiori_archiver-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for shiori-archiver 0.1.0
File Interpreter ABI Platform Actions
shiori_archiver-0.1.0-py3-none-any.whl Python 3 none any Details for shiori_archiver-0.1.0-py3-none-any.whl

Total release size: 70.6 kB

Release files / shiori_archiver-0.1.0.tar.gz

Download URL shiori_archiver-0.1.0.tar.gz
Size 40.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9651c87c4e7c0183d764ff361ccbb4c9d4024360a21b431dd1fddca7c826fbf6
BLAKE2b-256 checksum
How to use checksums
159515fd4ccf2ce31225ce95a033d7c08febe84e977d2b6468a753d4a2c3bfac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / shiori_archiver-0.1.0-py3-none-any.whl

Download URL shiori_archiver-0.1.0-py3-none-any.whl
Size 30.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
52e7bed2ab166b73f274d9edfb03990792f3e476869458bc3c79363e608e152d
BLAKE2b-256 checksum
How to use checksums
e29a1873b9c0cfc73ddffc1b02d3a5c77cdbcff00ba587ec2f2eda4032ced61b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Security for shiori-archiver 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page