Metadata-Version: 2.1
Name: youtube_music_uploader
Version: 1.3.4
Summary: Youtube Music package to upload your music library to Youtube Music
Home-page: https://github.com/jaymoulin/youtube-music-uploader/
Author: Jay MOULIN
License: MIT
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Communications :: File Sharing
Classifier: Topic :: Artistic Software
Classifier: Topic :: Internet :: File Transfer Protocol (FTP)
Classifier: Topic :: Home Automation
Classifier: Topic :: Internet
Classifier: Topic :: Multimedia :: Sound/Audio
Requires-Python: >=3
License-File: LICENSE

.. image:: https://raw.githubusercontent.com/jaymoulin/youtube-music-uploader/master/logo.png
    :alt: logo
    :target: http://github.com/jaymoulin/youtube-music-uploader


======================
Youtube Music Uploader
======================


.. image:: https://img.shields.io/github/release/jaymoulin/youtube-music-uploader.svg
    :alt: latest release
    :target: http://github.com/jaymoulin/youtube-music-uploader/releases
.. image:: https://img.shields.io/pypi/v/youtube-music-uploader.svg
    :alt: PyPI version
    :target: https://pypi.org/project/youtube-music-uploader/
.. image:: https://github.com/jaymoulin/jaymoulin.github.io/raw/master/ppl.png
    :alt: PayPal donation
    :target: https://www.paypal.me/jaymoulin
.. image:: https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png
    :alt: Buy me a coffee
    :target: https://www.buymeacoffee.com/jaymoulin
.. image:: https://ko-fi.com/img/githubbutton_sm.svg
    :alt: Buy me a cofee
    :target: https://ko-fi.com/jaymoulin

DISCLAIMER: As-of 2021, this product does not have a free support team anymore. If you want this product to be maintained, please support on Patreon.

(This product is available under a free and permissive license, but needs financial support to sustain its continued improvements. In addition to maintenance and stability there are many desirable features yet to be added.)

This program will create a Daemonic folder to upload your music library to Youtube Music

This work is based upon `Sigma67's Youtube Music API <https://github.com/sigma67/ytmusicapi>`_.

Installation
------------

This program needs `watchdog`, `ytmusicapi` and `requests` Python libraries to work.

.. code::

    apt-get install python3-pip build-essential
    pip3 install youtube-music-uploader

Once installed, You have to authenticate to Youtube Music via the `youtube-music-auth` command

.. code::

    # Usage youtube-music-auth [path_to_auth_file=~/oauth]


If first parameter is not defined, the script will try to store/load your credentials through the `~/oauth` file.

Then follow the setup instructions provided https://ytmusicapi.readthedocs.io/en/latest/setup/browser.html

.. note::

    **OAuth is intentionally not supported for uploads.** YouTube Music's upload
    endpoint is a private, web-client-only API with no public/OAuth equivalent,
    and ``ytmusicapi`` rejects anything other than browser (cookie) authentication
    for ``upload_song``. The auth file (historically named ``oauth``) must therefore
    be a *browser* auth file produced by ``youtube-music-auth``. Google Cloud OAuth
    credentials will not work for uploading your library.

Usage
-----

Uploader
~~~~~~~~

This program will scan a given directory for new elements to upload them to Youtube Music.
First, launch the daemon to watch a directory new inputs.

.. code::

    usage: youtube-music-upload [-h] [-v] [--directory DIRECTORY] [--auth-file AUTH_FILE] [-r]
                              [-o] [--deduplicate_api DEDUPLICATE_API]

    optional arguments:
      -h, --help            show this help message and exit
      -v, --version         show version number and exit
      --directory DIRECTORY, -d DIRECTORY
                            Music Folder to upload from (default: .)
      --auth-file AUTH_FILE, --oauth AUTH_FILE, -a AUTH_FILE
                            Path to the browser auth file created by youtube-music-auth
                            (default: ~/oauth). --oauth is a deprecated alias.
      -r, --remove          Remove the file on your hard drive if it was already successfully uploaded (default: False)
      -o, --oneshot         Upload folder and exit (default: False)
      -l, --listener_only   Only listen for new files, does not parse all files at launch (default: False)
      -e ERROR_FILE_PATH, --log ERROR_FILE_PATH
                            Log to a specified file path (Default stderr)
      -w DEDUPLICATE_API, --deduplicate_api DEDUPLICATE_API
                            Deduplicate API (should be HTTP and compatible with
                            the manifest (see README)) (default: None)

Deduplicate
~~~~~~~~~~~

This program will send all files or the specified file to the deduplication API

.. code::

    usage: youtube-music-upload-deduplicate [-h] --deduplicate_api DEDUPLICATE_API
                                       [--directory DIRECTORY] [--file FILE]
                                       [--remove]

    optional arguments:
      -h, --help            show this help message and exit
      --directory DIRECTORY, -d DIRECTORY
                            Music Folder to deduplicate
      --file FILE, -f FILE
                            Music file path to deduplicate
      -r, --remove          Unmark specified file/folder (default: False)
      -w DEDUPLICATE_API, --deduplicate_api DEDUPLICATE_API
                            Deduplicate API (should be HTTP and compatible with
                            the manifest (see README)) (default: None)

=================
Deduplication API
=================

Preface
-------

This API is completely optional. You don't have to implement this. It will only help you to avoid useless Google calls

Thanks to Brian Doherty, a local snapshot is now made to avoid external deduplication calls on local updated files.

You can use your own API implementation to avoid multiple Youtube Music uploads.
This API should match with the following requirements.

You may want to use this existing one : `Google MusicManager Deduplicate API <https://github.com/jaymoulin/google-musicmanager-dedup-api>`_.

Exists
------

+------+--------+--------------------------+----------------------------------------------------+
| path | method | parameter                | status code                                        |
+======+========+======+===================+===================+================================+
| /    | GET    | name | description       | value             | description                    |
|      |        +------+-------------------+-------------------+--------------------------------+
|      |        | path | path of your file | 200 or 204        | Your file was already uploaded |
|      |        |      |                   +-------------------+--------------------------------+
|      |        |      |                   | 404 (or whatever) | Your file was NOT uploaded     |
+------+--------+------+-------------------+-------------------+--------------------------------+

Saving
------

+------+--------+--------------------------+-------------------------------------------------+
| path | method | parameter                | status code                                     |
+======+========+======+===================+==========+======================================+
| /    | POST   | name | description       | value    | description                          |
|      |        +------+-------------------+----------+--------------------------------------+
|      |        | path | path of your file | whatever | Status code does not change anything |
+------+--------+------+-------------------+----------+--------------------------------------+

Removing
--------

+------+--------+--------------------------+-------------------------------------------------+
| path | method | parameter                | status code                                     |
+======+========+======+===================+==========+======================================+
| /    | DELETE | name | description       | value    | description                          |
|      |        +------+-------------------+----------+--------------------------------------+
|      |        | path | path of your file | whatever | Status code does not change anything |
+------+--------+------+-------------------+----------+--------------------------------------+

=====
About
=====

Requirements
------------

Youtube Music Uploader works with Python 3 or above.

Submitting bugs and feature requests
------------------------------------

Bugs and feature request are tracked on GitHub

Author
------

Jay MOULIN See also the list of contributors which participated in this program.

License
-------

Youtube Music Uploader is licensed under the MIT License
