Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

slugify() got an unexpected keyword argument 'ok' #238

Closed
jneidel opened this issue Sep 12, 2024 · 3 comments
Closed

slugify() got an unexpected keyword argument 'ok' #238

jneidel opened this issue Sep 12, 2024 · 3 comments
Assignees
Labels

Comments

@jneidel
Copy link
Contributor

jneidel commented Sep 12, 2024

Describe the bug
The slugify dependency throws.

  • TypeError: slugify() got an unexpected keyword argument 'ok'
  • TypeError: slugify() got an unexpected keyword argument 'only_ascii'

Checking the slugify source code I indeed don't see those as possible arguments.

To Reproduce
Command to reproduce the behavior:
bandcamp-dl https://virtualmage.bandcamp.com/album/strange-landscape-ep

Expected behavior
Not crash 😂

Logs

Traceback (most recent call last):                                                                                                                              
  File "/bin/bandcamp-dl", line 8, in <module>                                                                                                                  
    sys.exit(main())                                                                                                                                            
             ^^^^^^                                                                                                                                             
  File "/usr/lib/python3.12/site-packages/bandcamp_dl/__main__.py", line 132, in main                                                                           
    bandcamp_downloader.start(album)                                                                                                                            
  File "/usr/lib/python3.12/site-packages/bandcamp_dl/bandcampdownloader.py", line 52, in start                                                                 
    self.download_album(album)
  File "/usr/lib/python3.12/site-packages/bandcamp_dl/bandcampdownloader.py", line 151, in download_album
    filepath = self.template_to_path(track_meta, self.config.ascii_only,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/bandcamp_dl/bandcampdownloader.py", line 91, in template_to_path
    self.logger.debug(f'Track artist is None, replacing with {slugify_preset(track["albumartist"])}')
                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/bandcamp_dl/bandcampdownloader.py", line 71, in slugify_preset
    slugged = slugify.slugify(content, ok=ok_chars, only_ascii=ascii_only,
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: slugify() got an unexpected keyword argument 'ok'

Desktop (please complete the following information):

  • OS: Arch Linux
  • Version: latest git commit (v0.0.16.r0.gcdf24c0)
  • Python Version: 3.12.5
  • slugify version: 8.0.4

Known fix

Pass --no-slugify and download works.

@Evolution0
Copy link
Collaborator

Probably related to recent changes in arg handling, I'll check it out soon unless someone else does, just not a lot of free time for the next few days

Good that it's something that can be worked around for now but I imagine it must suck for those wanting unaltered filenames.

@Evolution0
Copy link
Collaborator

Update: Not happening for me under the current codebase, likely due to you somehow ending up with slugify and not unicode-slugify (which is specified in the pyproject.toml as well as pulled in by the build script on the AUR)

@jneidel
Copy link
Contributor Author

jneidel commented Oct 3, 2024

Can confirm.
Uninstalling slugify and replacing it with python-unicode-slugify 0.1.5 worked.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants