Metadata-Version: 2.4
Name: ytpb
Version: 2026.1.18
Summary: A playback for YouTube live streams
Project-URL: Source, https://github.com/xymaxim/ytpb
Project-URL: Documentation, https://ytpb.readthedocs.io
Author: Maxim Stolyarchuk
License: MIT License
        
        Copyright (c) 2024 Maxim Stolyarchuk
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: youtube
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.12
Requires-Dist: av>=12.0.0
Requires-Dist: click>=8.1.7
Requires-Dist: cloup>=3.0.5
Requires-Dist: jinja2>=3.1.4
Requires-Dist: lark>=1.1.9
Requires-Dist: lxml>=5.2.2
Requires-Dist: pathvalidate>=3.2.0
Requires-Dist: pillow>=10.3.0
Requires-Dist: platformdirs>=4.2.2
Requires-Dist: pycond>=20230212
Requires-Dist: python-mpv-jsonipc>=1.2.0
Requires-Dist: requests>=2.32.0
Requires-Dist: rich>=13.7.0
Requires-Dist: structlog>=24.2.0
Requires-Dist: timedelta-isoformat>=0.6.2.11
Requires-Dist: unidecode>=1.3.8
Requires-Dist: yt-dlp>=2025.12.8
Provides-Extra: dev
Requires-Dist: freezegun>=1.5.1; extra == 'dev'
Requires-Dist: pre-commit; extra == 'dev'
Requires-Dist: pytest-matcher==2.0.1; extra == 'dev'
Requires-Dist: pytest-socket>=0.7.0; extra == 'dev'
Requires-Dist: pytest>=8.2.1; extra == 'dev'
Requires-Dist: responses>=0.25.0; extra == 'dev'
Requires-Dist: toml>=0.10.2; extra == 'dev'
Provides-Extra: docs
Requires-Dist: myst-parser==3.0.1; extra == 'docs'
Requires-Dist: sphinx-toolbox==3.5.0; extra == 'docs'
Requires-Dist: sphinx==7.3.7; extra == 'docs'
Provides-Extra: test
Requires-Dist: freezegun>=1.5.1; extra == 'test'
Requires-Dist: pytest-matcher==2.0.1; extra == 'test'
Requires-Dist: pytest-socket>=0.7.0; extra == 'test'
Requires-Dist: pytest>=8.2.1; extra == 'test'
Requires-Dist: responses>=0.25.0; extra == 'test'
Requires-Dist: toml>=0.10.2; extra == 'test'
Description-Content-Type: text/x-rst

Ytpb
####

A playback for YouTube live streams.

|PyPI| |Tests|

.. |PyPI| image:: https://img.shields.io/pypi/v/ytpb
   :target: https://pypi.org/project/ytpb
   :alt: PyPI - Version

.. |Tests| image:: https://github.com/xymaxim/ytpb/actions/workflows/ci.yml/badge.svg
   :target: https://github.com/xymaxim/ytpb/actions/workflows/ci.yml
   :alt: Tests

`Project page`_ |sep| `Documentation`_ |sep| `Contributing`_

.. |sep| unicode:: 0xA0
   :trim:

.. _Project page: https://github.com/xymaxim/ytpb
.. _Documentation: https://ytpb.readthedocs.io/
.. _Contributing: https://ytpb.readthedocs.io/en/latest/contributing.html

*Rewind to past moments in live streams and download or play excerpts*

Ytpb is a playback for YouTube live streams written in Python. It lets you go
back to past moments beyond the limits of the web player. You can keep selected
moments by downloading excerpts or play them instantly in your video player via
MPEG-DASH.

Check out also `mpv-ytpb <https://github.com/xymaxim/mpv-ytpb>`__ to play and
rewind live streams interactively without leaving a player.

Features
********

- Command line interface (CLI) and Python library
- Rewind live streams far beyond the limits of the web player
- Download audio and/or video excerpts

  - Save excerpts in different available audio and video formats
  - Precisely cut to exact moments without slow re-encoding

- Play and rewind instantly via MPEG-DASH

  - Compose DASH manifests to play it in your favorite player
  - Transcode/download excerpts into local files with FFmpeg

- Capture a single frame or create time-lapse images
- Makes use of yt-dlp to reliably extract information about videos (optionally)

Demos
*****

- Downloading a live stream excerpt (`link <https://asciinema.org/a/653861>`__)
- Composing an MPEG-DASH MPD and transcoding it to MP4 (`link
  <https://asciinema.org/a/653865>`__)
- Creating a time-lapse of a live stream excerpt (`link
  <https://asciinema.org/a/653869>`__)

Installation
************

Ytpb requires Python 3.12 or higher and has been `tested
<https://github.com/xymaxim/ytpb/actions/workflows/ci.yml>`__ on Linux, macOS,
and Windows. Also, it needs the recent version of `FFmpeg
<https://ffmpeg.org/download.html>`__ to be installed.

Installing from PyPI
====================

When you have all required dependencies, you can install Ytpb via `pipx
<https://pypa.github.io/pipx/>`_::

  $ pipx install ytpb

To upgrade to the newer version, do::

  $ pipx upgrade ytpb

Windows binaries
================

For Windows, pre-built binaries are available: check `releases
<https://github.com/xymaxim/ytpb/releases>`__ on GitHub. Make sure to `add
<https://www.wikihow.com/Install-FFmpeg-on-Windows>`__ the ``ffmpeg.exe`` file
to your system path or place it in the folder next to the Ytpb binary. Now
you're ready to use Ytpb in Terminal: type commands, not double-click.

Further reading
***************

After installing, check out the `documentation`_. The `Why Ytpb?`_ page explains
why the project exists. For main usage scenarios, see `Quick start`_. The
`Command line application`_ page goes deeper into the usage. `Reference`_
provides some general aspects and terms. See `Questions`_ for answers to the
most anticipated questions. `Cookbook`_ contains some useful examples.  Have any
issues, suggestions, or want to contribute code? `Contributing`_ tells how to
participate in the project.

.. _Why Ytpb?: https://ytpb.readthedocs.io/en/latest/why.html
.. _Quick start: https://ytpb.readthedocs.io/en/latest/quick.html
.. _Command line application: https://ytpb.readthedocs.io/en/latest/cli.html
.. _Reference: https://ytpb.readthedocs.io/en/latest/reference.html
.. _Questions: https://ytpb.readthedocs.io/en/latest/questions.html
.. _Cookbook: https://ytpb.readthedocs.io/en/latest/cookbook.html

Similar projects
****************

- `Kethsar/ytarchive <https://github.com/Kethsar/ytarchive>`__ — archive streams from the start
- `rytsikau/ee.Yrewind <https://github.com/rytsikau/ee.Yrewind>`__ — rewind and save streams
- `yt-dlp/yt-dlp#6498 <https://github.com/yt-dlp/yt-dlp/pull/6498>`__ — brings rewind range selection to yt-dlp

License
*******

Ytpb is licensed under the MIT license. See `LICENSE`_ for details.

.. _LICENSE: https://github.com/xymaxim/ytpb/blob/main/LICENSE
