snejus / beetcamp

Bandcamp autotagger source for beets (http://beets.io)
GNU General Public License v2.0
66 stars 13 forks source link

bandcamp: Unexpected error obtaining https://plustek.bandcamp.com/album/skeleton-boomerang-ost #41

Closed arogl closed 1 year ago

arogl commented 1 year ago
Traceback (most recent call last):
  File "C:\Python3\Lib\site-packages\beetsplug\bandcamp\__init__.py", line 265, in handle_guru
    return getattr(self.guru(url, html=html), attr)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python3\Lib\functools.py", line 1001, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "C:\Python3\Lib\site-packages\beetsplug\bandcamp\_metaguru.py", line 533, in albums
    return list(map(self._album, self.media_formats))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python3\Lib\site-packages\beetsplug\bandcamp\_metaguru.py", line 516, in _album
    **self._common_album,
      ^^^^^^^^^^^^^^^^^^
  File "C:\Python3\Lib\site-packages\beetsplug\bandcamp\_metaguru.py", line 460, in _common_album
    common_data: JSONDict = {"album": self.clean_album_name}
                                      ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python3\Lib\functools.py", line 1001, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "C:\Python3\Lib\site-packages\beetsplug\bandcamp\_metaguru.py", line 435, in clean_album_name
    album = self.clean_album(album, self.catalognum, *artists, label=self.label)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python3\Lib\site-packages\beetsplug\bandcamp\_helpers.py", line 207, in clean_album
    if label and not re.search(label_allow_pat, name):
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python3\Lib\re\__init__.py", line 176, in search
    return _compile(pattern, flags).search(string)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python3\Lib\re\__init__.py", line 294, in _compile
    p = _compiler.compile(pattern, flags)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python3\Lib\re\_compiler.py", line 743, in compile
    p = _parser.parse(p, flags)
        ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python3\Lib\re\_parser.py", line 980, in parse
    p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python3\Lib\re\_parser.py", line 455, in _parse_sub
    itemsappend(_parse(source, state, verbose, nested + 1,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python3\Lib\re\_parser.py", line 682, in _parse
    raise source.error("nothing to repeat",
re.error: nothing to repeat at position 1

beets: git 5383d55076e51dc0edaa4cfddc3a8ad2ffd9416e beetcamp : 0.16.2 Windows 10 python: 3.11.0 I am not sure which album as running a threaded import of new library

snejus commented 1 year ago

Interesting, will have a look at this at some next week.

snejus commented 1 year ago

Good catch! This was caused by un-escaped label string during parsing - since your album is released by +TEK it got bamboozled by the +!

snejus commented 1 year ago

Fixed in 0.16.3!