lyrics: Add TIDAL backend#4641
Conversation
|
|
||
| while True: | ||
| try: | ||
| lyrics = top_hit.lyrics() |
There was a problem hiding this comment.
is this indentation correct?
| break | ||
| except requests.exceptions.HTTPError as e: | ||
| if e.response.status_code == 404: | ||
| return None |
|
I don't have a paid Tidal account to test this, but the code looks fine to me (some minor comments). I just checked and the free version works for albums/tracks search. It may be a good idea to also create an auto-tag plugin for Tidal (which can work with a free account). Lyrics can then be easily added. |
| super().__init__(config, log) | ||
| self._log = log | ||
|
|
||
| sessionfile = self.config["tidal_session_file"].get( |
There was a problem hiding this comment.
The session file doesn't have to be user-configurable. We can just save something like tidal.json in the config folder.
|
|
||
| self.session = self.load_session(sessionfile) | ||
|
|
||
| self.attempts = self.config["tidal_attempts"].get(int) |
There was a problem hiding this comment.
Please add default values so that these fields can be made optional in the config.
|
To future-proof this, we should have a separate |
|
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
…kend" This reverts commit 00ed448.
So what you're saying is, instead of writing a Lyrics backend, write a metadata source instead? Would that handle its own lyrics as an import stage hook or would it require modification to the Lyrics plugin to integrate into the new metadata source? |
|
This PR is based off of a 3 year old commit and requires a lot of work to rebase, additionally, it has also been superseded by #5637. Closing. |
## Description This PR introduces tidal as metadatasource. It add both an minimal api layer and the typical metadata source plugin capabilities. ### Details The implementation provides a small API layer consisting of `TidalAPI` for high-level album and track fetching, and `TidalSession` which extends `requests.Session` with token authentication, automatic rate limiting (~4 req/s via `RateLimitAdapter`), and pagination resolution following the JSON:API spec. Authentication is handled through an OAuth2 PKCE flow accessible via `beet tidal --auth`, with automatic token refresh when the access token expires. Metadata parsing handles Tidal's JSON:API response format, extracting album and track information including ISO 8601 duration conversion, artist relationships, and copyright/label data. ## Input wanted The API layer currently lacks comprehensive test coverage. Setting up proper tests would require either mocking all outgoing requests or creating a dedicated test token (which necessitates an account and might require read/write to github secrets). Are we comfortable with the current approach of unit testing the plugin itself while mocking all requests? ## TODOs - [x] Documentation - [x] `candidate` and `item_candidates` lookup - [x] It should be possible to optimize batched lookups - [x] Add tests for candidates and item_candidates - [x] Implement batching for more than 20 filters ## Refs thanks to @jcjordyn130 for his initial implementations in #5637 and #4641
Description
This adds a TIDAL backend to the lyrics plugin. It requires a paid TIDAL account as the free account returns 404 upon lyrics query. This feature adds a new (optional) dependency on
tidalapithough. The lyrics tests completed successfully both in my personal usage and when running the test_lyrics.py file. The reasoning behind this new feature is that TIDAL lyrics have time codes (important for my usage, lyrics in the Navidrome web player require them).To Do
docs/to describe it.)docs/changelog.rstnear the top of the document.)