Skip to content

Spotify plugin unable to find Chinese/Japanese albums #5699

Open
@Pahina0

Description

@Pahina0

Using the Spotify plugin, it is unable to correctly search for albums & artists with Chinese/Japanese characters as its being converted to Ascii before the search. Resulting in 0 results from spotify.

Searches instead should keep the characters as the original (like how MusicBrainz works) so Spotify can return the correct results as spotify doesn't support searching with Pinyin/Romaji

Problem

With a folder containing songs from 盗作 - ヨルシカ (or any album/artist using Chinese characters)

Running this command in verbose (-vv) mode:

$ beet -vv import . -t

Led to this problem:

spotify: Searching Spotify for 'album:Dao Zuo  artist:yorushika'
spotify: Found 0 result(s) from Spotify for 'album:Dao Zuo  artist:yorushika'

The album name is getting converted to ascii when searched, resulting in 0 results.
In this case, 盗作 -> Dao Zuo

The album it should be finding:
https://open.spotify.com/album/6pZ0SrZCP8Bm28L6JhMtBy?si=X2sNSW5oTAGuJBNaVCAD0w

Setup

  • OS: Arch Linux
  • Python version: 3.13.2
  • beets version: 2.2.0

My configuration (output of beet config) is:

directory: ~/Music

plugins:
    - embedart
    - fetchart
    - lyrics
    - lastgenre
    - spotify
    - scrub

import:
    move: yes


spotify:
    source_weight: 0.0
    mode: open
    show_failures: on

This is most likely due to unidecode.unidecode(query) which converts all characters into ascii prior to the search.

beets/beetsplug/spotify.py

Lines 399 to 407 in 030fd1f

query_components = [
keywords,
" ".join(":".join((k, v)) for k, v in filters.items()),
]
query = " ".join([q for q in query_components if q])
if not isinstance(query, str):
query = query.decode("utf8")
return unidecode.unidecode(query)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugbugs that are confirmed and actionable

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions