Switch from unmaintained pytube to yt-dlp. Check user is subscribed to YTM premium...
authortronikos <tronikos@users.noreply.github.com>
Mon, 24 Jun 2024 08:01:11 +0000 (01:01 -0700)
committerGitHub <noreply@github.com>
Mon, 24 Jun 2024 08:01:11 +0000 (10:01 +0200)
commit7159a39288b42c821bc1da1bf65fd971b84d15a8
tree628eb63ca9a064da0e27d2498653dbb157aa9a94
parent8dce2898a01a14a781d37a544a65c04eff61d32a
Switch from unmaintained pytube to yt-dlp. Check user is subscribed to YTM premium (#1387)

* Add option to use yt_dlp instead of pytube. yt_dlp is much slower but more reliable

* fix

* ruff

* Use format_selector to select bestaudio

* Add yt dlp as default stream resolver.

* Add check for YT Premium users.

* Remove unnecessary pytube log adjustment.

* Fix conflicts.

* fix return type and remove unused const

* use YTM_DOMAIN constant

* Disable quiet in yt_dlp for debug log level

* Catch DownloadError and raise UnplayableMediaError

* Check format_id that is likely to change than format

---------

Co-authored-by: Marvin Schenkel <marvinschenkel@gmail.com>
music_assistant/server/providers/ytmusic/__init__.py
music_assistant/server/providers/ytmusic/helpers.py
music_assistant/server/providers/ytmusic/manifest.json
requirements_all.txt