Metadata-Version: 2.4
Name: youtube2mp3
Version: 2.1.1
Summary: Commandline tool to convert youtube videos to tagged mp3 files
Author-email: Michael Pfister <michael@mp-development.de>
License: MIT
Project-URL: Homepage, https://github.com/pfitzer/youtube2mp3
Keywords: youtube,mp3
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Video :: Conversion
Requires-Python: <4,>=3.10
Description-Content-Type: text/x-rst
License-File: LICENSE.txt
Requires-Dist: yt-dlp>=2026.10.21
Requires-Dist: mutagen>=1.47.0
Dynamic: license-file

|image0| |image1| |image6| |image3| |image4|

youtube2mp3
===========
A wrapper to simplify youtube downloads with `yt-dlp <https://github.com/yt-dlp/yt-dlp>`_

Downloaded files will be tagged with `mutagen <https://pypi.python.org/pypi/mutagen>`_.

installation
------------
with pip
""""""""
::

    pip install youtube2mp3


usage
-----
::

    youtube2mp3 [options] arg1 arg2

see *youtube2mp3 -h* for more information
::

    Options:
  -h, --help            show this help message and exit
  -d DIRECTORY, --directory=DIRECTORY
                        directory to store the files
  -y YOUTUBE_URL, --youtube-url=YOUTUBE_URL
                        link to a youtube video or playlist. Or path to a file
                        with yt urls.
  -V, --version         show version and exit


development
-----------
The project is managed with `uv <https://docs.astral.sh/uv/>`_. Create the virtual environment
and install all dependencies
::

    uv sync

run the tool from source
::

    uv run youtube2mp3 -d <directory> -y <url>

run the tests (`ffmpeg <https://ffmpeg.org/>`_ is required for the conversion tests)
::

    uv run pytest

the real youtube downloads are skipped by default, enable them with
::

    YOUTUBE2MP3_NETWORK_TESTS=1 uv run pytest

YouTube downloads need a JavaScript runtime for yt-dlp, see
`yt-dlp EJS <https://github.com/yt-dlp/yt-dlp/wiki/EJS>`_ (e.g. install `deno <https://deno.com/>`_).

|image5|


.. |image0| image:: https://img.shields.io/pypi/v/youtube2mp3.svg
     :target: https://pypi.python.org/pypi?name=youtube2mp3&:action=display
     :alt: pypi

.. |image1| image:: https://pyup.io/repos/github/pfitzer/youtube2mp3/shield.svg
     :target: https://pyup.io/repos/github/pfitzer/youtube2mp3/
     :alt: Updates

.. |image3| image:: https://img.shields.io/pypi/dm/youtube2mp3.svg
    :target: https://pypistats.org/packages/youtube2mp3
    :alt: PyPI - Downloads

.. |image4| image:: https://github.com/pfitzer/youtube2mp3/actions/workflows/unittest.yml/badge.svg
    :target: https://github.com/pfitzer/youtube2mp3/actions/workflows/unittest.yml
    :alt: Unit Tests

.. |image5| image:: https://cdn.buymeacoffee.com/buttons/lato-orange.png
    :target: https://www.buymeacoffee.com/pfitzer
    :alt: Buy Me a Beer

.. |image6| image:: https://img.shields.io/pypi/pyversions/youtube2mp3.svg?logo=python&logoColor=FFE873
    :target: https://pypi.python.org/pypi?name=youtube2mp3&:action=display
    :alt: youtube2mp3 on pypi
