beetbox / beetbox/beets

Urlencode error using smartplaylist plugin

Open
#5,905 0 comments 0 reactions 0 assignees View on GitHub
smartplaylist
Dominant language
Python
Stars
15.7k
Forks
2.1k
Avg merge
4d 21h
Merged PRs (30d)
31

Description

Tried switching on urlencode to make the plugins smartplaylists and beetstream work together. Currently my playlists don't work and every song can't be played.

Error when using splupdate:

smartplaylist: Updating 1 smart playlists...
smartplaylist: Creating playlist all.m3u
Traceback (most recent call last):
File "/usr/bin/beet", line 8, in
sys.exit(main())
~~~~^^
File "/home/cthulhu/.local/lib/python3.13/site-packages/beets/ui/__init__.py", line 1870, in main
_raw_main(args)
~~~~~~~~~^^^^^^
File "/home/cthulhu/.local/lib/python3.13/site-packages/beets/ui/__init__.py", line 1849, in _raw_main
subcommand.func(lib, suboptions, subargs)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cthulhu/.local/lib/python3.13/site-packages/beetsplug/smartplaylist.py", line 153, in update_cmd
self.update_playlists(lib, opts.pretend)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
File "/home/cthulhu/.local/lib/python3.13/site-packages/beetsplug/smartplaylist.py", line 296, in update_playlists
item_uri = bytestring_path(pathname2url(item_uri))
~~~~~~~~~~~~^^^^^^^^^^
File "/usr/lib/python3.13/urllib/request.py", line 1679, in pathname2url
return quote(pathname, encoding=encoding, errors=errors)
File "/usr/lib/python3.13/urllib/parse.py", line 924, in quote
raise TypeError("quote() doesn't support 'encoding' for bytes")
TypeError: quote() doesn't support 'encoding' for bytes

My config:

directory: ~/Music/Library
# --------------- Main ---------------

library: ~/musiclibrary.db

import:
move: yes
languages: en

ui:
color: yes
colors:
text_success: [bold, green]
text_warning: [bold, yellow]
text_error: [bold, red]
text_highlight: [bold, red]
text_highlight_minor: [white]
action_default: [bold, cyan]
action: [bold, cyan]
text: [normal]
text_faint: [faint]
import_path: [bold, blue]
import_path_items: [bold, blue]
added: [green]
removed: [red]
changed: [yellow]
added_highlight: [bold, green]
removed_highlight: [bold, red]
changed_highlight: [bold, yellow]
text_diff_added: [bold, red]
text_diff_removed: [bold, red]
text_diff_changed: [bold, red]
action_description: [white]

# --------------- Plugins ---------------

plugins: spotify web smartplaylist webm3u
smartplaylist:
playlist_dir: /home/cthulhu/Music/Playlists
relative_to: /home/cthulhu/Music/Library
output: extm3u
urlencode: yes
forward_slash: no
playlists: [{name: all.m3u, query: ''}]
auto: yes
uri_format:
fields: []
prefix: REDACTED
pretend_paths: no
webm3u:
host: 127.0.0.1
port: 8339
cors: ''
cors_supports_credentials: no
reverse_proxy: no
include_paths: no
playlist_dir:
uri_format:
web:
host: 127.0.0.1
port: 8337
cors: ''
cors_supports_credentials: no
reverse_proxy: no
include_paths: no
readonly: yes
spotify:
source_weight: 0.5
mode: list
tiebreak: popularity
show_failures: no
artist_field: albumartist
album_field: album
track_field: title
region_filter:
regex: []
client_id: REDACTED
client_secret: REDACTED
tokenfile: spotify_token.json

Rather new to both linux and beets, and advice is appreciated. Using most recent version of endeavourOS and KDE.

Contributor guide

Open the contributing guide

Research direction

Start in beetsplug/smartplaylist.py at the update_playlists path shown in the traceback, then reproduce the issue with splupdate and urlencode: yes. Done means the command no longer raises the quoted TypeError and the generated smart playlist can be used to play its songs.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.