beetcamp icon indicating copy to clipboard operation
beetcamp copied to clipboard

ValueError: time data '' does not match format '%d %B %Y'

Open noahsager opened this issue 5 years ago • 4 comments

KeyError gone, thank you! But now getting a ValueError:

   ~  beet import /Users/noah/Music/beets\ Import/                        ✔ 
Traceback (most recent call last):
  File "/usr/local/bin/beet", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/beets/ui/__init__.py", line 1278, in main
    _raw_main(args)
  File "/usr/local/lib/python3.9/site-packages/beets/ui/__init__.py", line 1265, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/usr/local/lib/python3.9/site-packages/beets/ui/commands.py", line 960, in import_func
    import_files(lib, paths, query)
  File "/usr/local/lib/python3.9/site-packages/beets/ui/commands.py", line 930, in import_files
    session.run()
  File "/usr/local/lib/python3.9/site-packages/beets/importer.py", line 341, in run
    pl.run_parallel(QUEUE_SIZE)
  File "/usr/local/lib/python3.9/site-packages/beets/util/pipeline.py", line 445, in run_parallel
    six.reraise(exc_info[0], exc_info[1], exc_info[2])
  File "/usr/local/lib/python3.9/site-packages/six.py", line 703, in reraise
    raise value
  File "/usr/local/lib/python3.9/site-packages/beets/util/pipeline.py", line 312, in run
    out = self.coro.send(msg)
  File "/usr/local/lib/python3.9/site-packages/beets/util/pipeline.py", line 194, in coro
    func(*(args + (task,)))
  File "/usr/local/lib/python3.9/site-packages/beets/importer.py", line 1365, in lookup_candidates
    task.lookup_candidates()
  File "/usr/local/lib/python3.9/site-packages/beets/importer.py", line 653, in lookup_candidates
    autotag.tag_album(self.items, search_ids=self.search_ids)
  File "/usr/local/lib/python3.9/site-packages/beets/autotag/match.py", line 463, in tag_album
    for matched_candidate in hooks.album_candidates(items,
  File "/usr/local/lib/python3.9/site-packages/beets/plugins.py", line 582, in decorated
    for v in generator(*args, **kwargs):
  File "/usr/local/lib/python3.9/site-packages/beets/autotag/hooks.py", line 631, in album_candidates
    for candidate in plugins.candidates(items, artist, album, va_likely,
  File "/usr/local/lib/python3.9/site-packages/beets/plugins.py", line 391, in candidates
    for candidate in plugin.candidates(items, artist, album, va_likely,
  File "/Users/noah/Library/Python/3.9/lib/python/site-packages/beetsplug/bandcamp/__init__.py", line 213, in get_album_info
    return Metaguru(html, self.media).album if html else None
  File "/Users/noah/Library/Python/3.9/lib/python/site-packages/beetsplug/bandcamp/_metaguru.py", line 352, in album
    return self.albuminfo
  File "/Users/noah/Library/Python/3.9/lib/python/site-packages/beetsplug/bandcamp/_metaguru.py", line 304, in albuminfo
    "year": self.release_date.year,
  File "/Users/noah/Library/Python/3.9/lib/python/site-packages/beetsplug/bandcamp/_metaguru.py", line 156, in release_date
    return datetime.strptime(datestr, DATE_FORMAT).date()
  File "/usr/local/Cellar/[email protected]/3.9.1_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "/usr/local/Cellar/[email protected]/3.9.1_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '' does not match format '%d %B %Y'

noahsager avatar Jan 17 '21 19:01 noahsager

Could you provide the bandcamp link that was queried here? This is related to how the release date is parsed and seems like it's partly missing here - haven't really seen it before.

snejus avatar Jan 17 '21 19:01 snejus

This is the Bandcamp link for the album:

https://jazzhopcafe.bandcamp.com/album/sketches-of-home-ep

noahsager avatar Jan 17 '21 19:01 noahsager

I see! It got confused since the same pattern it was looking for was also found in the description: EP, released on The Jazz Hop Café Records, while it looked for released 06 November 2019. I'll update the parser, it will be part of 0.4.4 in a half an hour or so.

snejus avatar Jan 17 '21 20:01 snejus

That's done now, thanks for reporting it all!

snejus avatar Jan 17 '21 21:01 snejus