forked from YutongGu/mopidy-tidal
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
36 lines (28 loc) · 12.1 KB
/
Copy pathsetup.py
File metadata and controls
36 lines (28 loc) · 12.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- coding: utf-8 -*-
from setuptools import setup
packages = \
['mopidy_tidal']
package_data = \
{'': ['*']}
install_requires = \
['Mopidy>=3.0,<4.0', 'tidalapi>=0.7.5,<0.8.0']
entry_points = \
{'mopidy.ext': ['tidal = mopidy_tidal:Extension']}
setup_kwargs = {
'name': 'mopidy-tidal',
'version': '0.3.6',
'description': 'Mopidy Extension for Tidal music service integration.',
'long_description': '# Mopidy-Tidal\n\n[](https://github.com/tehkillerbee/mopidy-tidal)\n[](https://github.com/tehkillerbee/mopidy-tidal)\n[](https://codecov.io/gh/tehkillerbee/mopidy-tidal)\n\nMopidy Extension for Tidal music service integration.\n\n### Changelog\nFind the latest changelog [here](CHANGELOG.md)\n\n### Contributions\n- Current maintainer: [tehkillerbee](https://github.com/tehkillerbee)\n- Original author: [mones88](https://github.com/mones88)\n- [Contributors](https://github.com/tehkillerbee/mopidy-tidal/graphs/contributors)\n\nQuestions related to Mopidy-Tidal, feature suggestions, bug reports and Pull Requests are very welcome.\n\nIf you are experiencing playback issues unrelated to this plugin, please report this to the Mopidy-Tidal issue tracker and/or check [Python-Tidal/Tidalapi repository](https://github.com/tamland/python-tidal) for relevant issues.\n\n### Development guidelines\nPlease refer to [this document](DEVELOPMENT.md) to get you started.\n\n### Getting started\nFirst install and configure Mopidy as per the instructions listed [here](https://docs.mopidy.com/en/latest/installation/). It is encouraged to install Mopidy as a systemd service, as per the instructions listed [here](https://docs.mopidy.com/en/latest/running/service/). \n\nAfter installing Mopidy, you can now proceed installing the plugins that you require, including Mopidy-Tidal. :\n```\nsudo pip3 install Mopidy-Tidal\n```\n\nPoetry can also be used to install mopidy-tidal and its dependencies.\n```\ncd <mopidy-tidal source root>\npoetry install\n```\n\n##### Note: Make sure to install the Mopidy-Tidal plugin in the same python venv used by your Mopidy installation. Otherwise, the plugin will NOT be detected.\n\n### Install from latest sources\nIn case you are upgrading your Mopidy-Tidal installation from the latest git sources, make sure to do a force upgrade from the source root (remove both mopidy-tidal and python-tidal), followed by a (service) restart.\n```\ncd <mopidy-tidal source root>\nsudo pip3 uninstall mopidy-tidal\nsudo pip3 uninstall tidalapi\nsudo pip3 install .\nsudo systemctl restart mopidy\n```\n\n## Dependencies\n### Python\n\nReleased versions of Mopidy-Tidal have the same requirement as the Mopidy\nversion they depend on. Development code may depend on unreleased features.\nAt the time of writing we require python >= 3.9 in anticipation of mopidy 3.5.0.\n\n### Python-Tidal\nMopidy-Tidal requires the Python-Tidal API (tidalapi) to function. This is usually installed automatically when installing Mopidy-Tidal.\nIn some cases, Python-Tidal stops working due to Tidal changing their API keys.\n\nWhen this happens, it will usually be necessary to upgrade the Python-Tidal API plugin manually\n```\nsudo pip3 install --upgrade tidalapi\n```\n\nAfter upgrading Python-Tidal/tidalapi, it will often be necessary to delete the existing json file and restart mopidy.\nThe file is usually stored in `/var/lib/mopidy/tidal/tidal-<session_type>.json`, depending on your system configuration.\n\n### GStreamer\nWhen using High and Low quality, be sure to install gstreamer bad-plugins, e.g.:\n```\nsudo apt-get install gstreamer1.0-plugins-bad\n```\nThis is mandatory to be able to play m4a streams and for playback of MPEG-DASH streams. Otherwise, you will likely get an error:\n```\nWARNING [MainThread] mopidy.audio.actor Could not find a application/x-hls decoder to handle media.\nWARNING [MainThread] mopidy.audio.gst GStreamer warning: No decoder available for type \'application/x-hls\'.\nERROR [MainThread] mopidy.audio.gst GStreamer error: Your GStreamer installation is missing a plug-in.\n```\n\n## Configuration\n\nBefore starting Mopidy, you must add configuration for Mopidy-Tidal to your Mopidy configuration file, if it is not already present.\n Run `sudo mopidyctl config` to see the current effective config used by Mopidy\n\nThe configuration is usually stored in `/etc/mopidy/mopidy.conf`, depending on your system configuration. Add the configuration listed below in the respective configuration file and set the relevant fields.\n\nRestart the Mopidy service after adding/changing the Tidal configuration\n`sudo systemctl restart mopidy`\n\n### Plugin configuration\nThe configuration is usually stored in `/etc/mopidy/mopidy.conf`, depending on your system configuration. Add the configuration listed below in the respective configuration file and set the relevant fields.\n```\n[tidal]\nenabled = true\nquality = LOSSLESS\n#playlist_cache_refresh_secs = 0\n#lazy = true\n#login_method = AUTO\n#auth_method = OAUTH\n#login_server_port = 8989\n#client_id =\n#client_secret =\n#auth_token = <your_auth_token>\n```\n### Plugin parameters\n* **quality:** Set to one of the following quality types.. Make sure to use a quality level supported by your current subscription.\n * `HI_RES_LOSSLESS`, `HI_RES` `LOSSLESS`, `HIGH` or `LOW`\n * `HI_RES_LOSSLESS` quality (i.e. HiRes lossless FLAC) and `HI_RES` quality (MQA) requires a Tidal HiFi Plus subscription\n * `LOSSLESS` quality (i.e. HiFi lossless FLAC) and below requires a HiFi subscription.\n* **auth_method (Optional):**: Select the authentication mode to use.\n * `OAUTH` used as default and allows playback up to `LOSSLESS` (HiFi)\n * `PKCE` is **required** for `HI_RES`, `HI_RES_LOSSLESS` (HiFi+) playback. This method uses the HTTP server for completing the authentication step.\n* **login_web_port (Optional):**: Port to use for the authentication HTTP Server. Default port: `8989`, i.e. web server will be available on `<host_ip:>:8989` eg. `localhost:8989`.\n* **playlist_cache_refresh_secs (Optional):** Tells if (and how often) playlist\ncontent should be refreshed upon lookup.\n * `0` (default): The default value (`0`) means that playlists won\'t be refreshed after the\n extension has started, unless they are explicitly modified from mopidy.\n * `>0`: A non-zero value expresses for how long (in seconds) a cached playlist is\n considered valid. For example, a value of `300` means that the cached snapshot\n of a playlist will be used if a new `lookup` occurs within 5 minutes from the\n previous one, but the playlist will be re-loaded via API if a lookup request\n occurs later.\n\n The preferred setting for this value is a trade-off between UI responsiveness\nand responsiveness to changes. If you perform a lot of playlist changes from\nother clients and you want your playlists to be instantly updated on mopidy,\nthen you may choose a low value for this setting, albeit this will result in\nlonger waits when you look up a playlist, since it will be fetched from\nupstream most of the times. If instead you don\'t perform many playlist\nmodifications, then you may choose a value for this setting within the range of\nhours - or days, or even leave it to zero so playlists will only be refreshed\nwhen mopidy restarts. This means that it will take longer for external changes\nto be reflected in the loaded playlists, but the UI will be more responsive\nwhen playlists are looked up. A value of zero makes the behaviour of\n`mopidy-tidal` quite akin to the current behaviour of `mopidy-spotify`.\n* **lazy (Optional):**: Whether to connect lazily, i.e. when required, rather than\nat startup.\n * `false` (default): Lazy mode is off by default for backwards compatibility and to make the first login easier (since mopidy will not block in lazy mode until you try to access Tidal).\n * `true`: Mopidy-Tidal will only try to connect when something\n tries to access a resource provided by Tidal. \n \n Since failed connections due to\n network errors do not overwrite cached credentials (see below) and Mopidy\n handles exceptions in plugins gracefully, lazy mode allows Mopidy to continue to\n run even with intermittent or non-existent network access (although you will\n obviously be unable to play any streamed music if you cannot access the\n network). When the network comes back Mopidy will be able to play tidal content\n again. This may be desirable on mobile internet connections, or when a server\n is used with multiple backends and a failure with Tidal should not prevent\n other services from running.\n* **login_method (Optional):**: This setting configures the auth login process. \n * `BLOCK` (default): The user is REQUIRED to complete the OAuth login flow, otherwise mopidy will hang.\n * `AUTO`/`HACK`: Mopidy will start as usual but the user will be prompted to complete the auth login flow by visiting a link. The link is provided as a dummy track and as a log message.\n* **client_id, _secret (Optional):**: Tidal API `client_id`, `client_secret` can be overridden by the user if necessary.\n* **pkce_access_token (Optional):**: PKCE access token for authentication.\n\n## Login\nBefore TIDAL can be accessed from Mopidy, it is necessary to login, using either the OAuth or PKCE flow described below.\n\nBoth OAuth and PKCE flow require visiting an URL to complete the login process. The URL can be found either:\n* In the Mopidy logs, as listed below\n```\njournalctl -u mopidy | tail -10\n...\nVisit link.tidal.com/AAAAA to log in, the code will expire in 300 seconds.\n```\n* Displayed in the Mopidy web client as a "dummy" track when the `login_method` is set to `AUTO`\n* By playing the "dummy" track, a QR code will be displayed and the URL will be read aloud.\n* Displayed as a link when accessing the auth. webserver `localhost:<login_web_port>` when PKCE authentication is used.\n\n### General login tips\n* When the `login_method` is set to BLOCK, all login processes are **blocking** actions, so Mopidy + Web interface will stop loading until you approve the application.\n* When using the `lazy` mode, the login process will not be started until browsing the TIDAL related directories.\n* Session is reloaded automatically when Mopidy is restarted. It will be necessary to perform these steps again if the json file is moved/deleted.\n\n### OAuth Flow\nWhen using OAuth authentication mode, you will be prompted to visit an URL to login. \nThis URL will be displayed in the Mopidy logs and/or in the Mopidy-Web client as a dummy track.\n\nWhen prompted, visit the URL to complete the OAuth login flow. No extra steps are required.\n\n### PKCE Flow\nFor `HI_RES` and `HI_RES_LOSSLESS` playback, the PKCE authentication method is required. \nThis PKCE flow also requires visiting an URL but requires an extra step to return the Tidal response URL to Python-Tidal\n1. Visit the URL listed in the logs or in the Mopidy client. Usually, this should be `<host_ip>:<login_web_port>`, eg. localhost:8989. When running a headless server, make sure to use the correct IP.\n2. You will be greeted with a link to the TIDAL login page and a form where you can paste the response URL:\n\n3. Click the link and visit the TIDAL URL and login using your normal credentials. \n4. Copy the complete URL of the page you were redirected to. This webpage normally lists "Oops" or something similar; this is normal.\n5. Paste this URL into the web authentication page and click "Submit". You can now close the web page.\n6. Refresh your Mopidy frontend. You should now be able to browse as usual.\n',
'author': 'Johannes Linde',
'author_email': 'tehkillerbee@users.noreply.github.com',
'maintainer': 'None',
'maintainer_email': 'None',
'url': 'https://github.com/tehkillerbee/mopidy-tidal',
'packages': packages,
'package_data': package_data,
'install_requires': install_requires,
'entry_points': entry_points,
'python_requires': '>=3.8,<4.0',
}
setup(**setup_kwargs)
# This setup.py was autogenerated using poetry.