unrblt / beets-bandcamp Goto Github PK
View Code? Open in Web Editor NEWPlugin for beets (http://beets.io) to use bandcamp as an autotagger source.
License: GNU General Public License v2.0
Plugin for beets (http://beets.io) to use bandcamp as an autotagger source.
License: GNU General Public License v2.0
When I enable art: true in my config for bandcamp, I get these errors popping during imports:
Traceback (most recent call last):
File "/usr/local/var/pyenv/versions/2.7.13/bin/beet", line 11, in
load_entry_point('beets==1.4.3', 'console_scripts', 'beet')()
File "/usr/local/var/pyenv/versions/2.7.13/lib/python2.7/site-packages/beets/ui/init.py", line 1209, in main
_raw_main(args)
File "/usr/local/var/pyenv/versions/2.7.13/lib/python2.7/site-packages/beets/ui/init.py", line 1196, in _raw_main
subcommand.func(lib, suboptions, subargs)
File "/usr/local/var/pyenv/versions/2.7.13/lib/python2.7/site-packages/beets/ui/commands.py", line 930, in import_func
import_files(lib, paths, query)
File "/usr/local/var/pyenv/versions/2.7.13/lib/python2.7/site-packages/beets/ui/commands.py", line 907, in import_files
session.run()
File "/usr/local/var/pyenv/versions/2.7.13/lib/python2.7/site-packages/beets/importer.py", line 319, in run
pl.run_parallel(QUEUE_SIZE)
File "/usr/local/var/pyenv/versions/2.7.13/lib/python2.7/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/var/pyenv/versions/2.7.13/lib/python2.7/site-packages/beets/util/pipeline.py", line 312, in run
out = self.coro.send(msg)
File "/usr/local/var/pyenv/versions/2.7.13/lib/python2.7/site-packages/beets/util/pipeline.py", line 194, in coro
func(*(args + (task,)))
File "/usr/local/var/pyenv/versions/2.7.13/lib/python2.7/site-packages/beets/importer.py", line 1392, in plugin_stage
func(session, task)
File "/usr/local/var/pyenv/versions/2.7.13/lib/python2.7/site-packages/beets/plugins.py", line 124, in wrapper
return func(*args, **kwargs)
File "/usr/local/var/pyenv/versions/2.7.13/lib/python2.7/site-packages/beetsplug/fetchart.py", line 797, in fetch_art
candidate = self.art_for_album(task.album, task.paths, local)
File "/usr/local/var/pyenv/versions/2.7.13/lib/python2.7/site-packages/beetsplug/fetchart.py", line 859, in art_for_album
if source.IS_LOCAL or not local_only:
AttributeError: 'BandcampAlbumArt' object has no attribute 'IS_LOCAL'
I've noticed a pattern of some releases getting tagged with artists named in their track titles, and the awful "various artists" or name of record label for the artist tag. Here's an example:
https://schematicmusiccompany.bandcamp.com/album/still-ill
and another:
http://store.origamisound.com/album/borealis-voidness-remixed
It's pretty clear why this is happening, and I'm not sure there is a way around it, since it seems like the artist names are getting baked into the track title markup. I haven't studied the markup closely enough, nor have I used Bandcamp enough to know if the record labels are baking the artist names in themselves, or if Bandcamp is doing it. If there is a pattern, we could probably account for it and split on ' - ', but then of course you run the risk of a false positive.
I have more examples, if that is any help.
I'm receiving this errorwhen trying to install:
Collecting beets-bandcamp
Using cached beets-bandcamp-0.1.4.tar.gz (12 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [3 lines of output]
error in beets-bandcamp setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected
end or semicolon (after version specifier)
six>=1.9requests
~~~~~~^
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip
Can anyone tell me what im doing wrong?
Is it possible to incorporate some ability to paste in a direct id/url when the results come back negative similar to what you can do with Musicbrainz or Discogs ID?
Just opening this issue to say thanks for this plugin. I had lots of albums directly downloaded from bandcamp and they aren't neither in MusicBraniz nor Discogs. With your plugin I have all my library (except one album ;__;) correctly tagged.
Thank you for this plugin!!!
the file beetsplug/__init__.py
is already part of beets and setup.py attempts to overwrite it.
when trying to make a distro package of this program it will make the package manager complain about the conflict
since beets already ships that file, it shouldn't be necessary to install it
Hi there,
I keep running into this whenever I'm trying to fetch from Bandcamp, hopefully this stack can help you trace the error for a fix:
Traceback (most recent call last):
File "/usr/local/bin/beet", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python3.6/site-packages/beets/ui/__init__.py", line 1256, in main
_raw_main(args)
File "/usr/local/lib/python3.6/site-packages/beets/ui/__init__.py", line 1243, in _raw_main
subcommand.func(lib, suboptions, subargs)
File "/usr/local/lib/python3.6/site-packages/beets/ui/commands.py", line 934, in import_func
import_files(lib, paths, query)
File "/usr/local/lib/python3.6/site-packages/beets/ui/commands.py", line 911, in import_files
session.run()
File "/usr/local/lib/python3.6/site-packages/beets/importer.py", line 325, in run
pl.run_parallel(QUEUE_SIZE)
File "/usr/local/lib/python3.6/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.6/site-packages/six.py", line 686, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/beets/util/pipeline.py", line 312, in run
out = self.coro.send(msg)
File "/usr/local/lib/python3.6/site-packages/beets/util/pipeline.py", line 194, in coro
func(*(args + (task,)))
File "/usr/local/lib/python3.6/site-packages/beets/importer.py", line 1435, in plugin_stage
func(session, task)
File "/usr/local/lib/python3.6/site-packages/beets/plugins.py", line 124, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/beetsplug/fetchart.py", line 793, in fetch_art
candidate = self.art_for_album(task.album, task.paths, local)
File "/usr/local/lib/python3.6/site-packages/beetsplug/fetchart.py", line 854, in art_for_album
source.fetch_image(candidate, self)
File "/usr/local/lib/python3.6/site-packages/beetsplug/fetchart.py", line 230, in fetch_image
with closing(self.request(candidate.url, stream=True,
AttributeError: 'str' object has no attribute 'url'
Thanks for the hard work on making this plugin.
Edit: Just found that this issue was raised in a closed issue #1
This stacktrace happened while I was using beets to import a collection of mp3 files downloaded from bandcamp. Note that the specific package which these songs were from is no longer available on the bandcamp site. I was importing 'as tracks' instead of 'as album' and the songs themselves are still on the bandcamp.
I'm running using the archlinux install, which is using beets 1.4.9 and beets-bandcamp 0.1.4
It seems that it is successfully processing most of the songs, but dies when it gets to a specific track, even when resuming from an interrupted import.
Sending event: import_task_choice
Sending event: import_task_created
Sending event: import_task_start
Looking up: /home/kayila/Music.bak/Approaching Nirvana/Approaching Nirvana - Approaching Nirvana CD Package - 01 Sugar High.flac
Item search terms: Approaching Nirvana - Sugar High
Sending event: trackinfo_received
Sending event: trackinfo_received
Sending event: trackinfo_received
Sending event: trackinfo_received
Sending event: trackinfo_received
bandcamp: Searching track, page 1
Traceback (most recent call last):
File "/usr/bin/beet", line 33, in <module>
sys.exit(load_entry_point('beets==1.4.9', 'console_scripts', 'beet')())
File "/usr/lib/python3.8/site-packages/beets/ui/__init__.py", line 1266, in main
_raw_main(args)
File "/usr/lib/python3.8/site-packages/beets/ui/__init__.py", line 1253, in _raw_main
subcommand.func(lib, suboptions, subargs)
File "/usr/lib/python3.8/site-packages/beets/ui/commands.py", line 955, in import_func
import_files(lib, paths, query)
File "/usr/lib/python3.8/site-packages/beets/ui/commands.py", line 925, in import_files
session.run()
File "/usr/lib/python3.8/site-packages/beets/importer.py", line 329, in run
pl.run_parallel(QUEUE_SIZE)
File "/usr/lib/python3.8/site-packages/beets/util/pipeline.py", line 445, in run_parallel
six.reraise(exc_info[0], exc_info[1], exc_info[2])
File "/usr/lib/python3.8/site-packages/six.py", line 703, in reraise
raise value
File "/usr/lib/python3.8/site-packages/beets/util/pipeline.py", line 315, in run
for msg in _allmsgs(out):
File "/usr/lib/python3.8/site-packages/beets/util/pipeline.py", line 466, in pull
out = coro.send(msg)
File "/usr/lib/python3.8/site-packages/beets/util/pipeline.py", line 194, in coro
func(*(args + (task,)))
File "/usr/lib/python3.8/site-packages/beets/importer.py", line 1351, in lookup_candidates
task.lookup_candidates()
File "/usr/lib/python3.8/site-packages/beets/importer.py", line 892, in lookup_candidates
prop = autotag.tag_item(self.item, search_ids=self.search_ids)
File "/usr/lib/python3.8/site-packages/beets/autotag/match.py", line 513, in tag_item
for track_info in hooks.item_candidates(item, search_artist, search_title):
File "/usr/lib/python3.8/site-packages/beets/plugins.py", line 574, in decorated
for v in generator(*args, **kwargs):
File "/usr/lib/python3.8/site-packages/beets/autotag/hooks.py", line 640, in item_candidates
for candidate in plugins.item_candidates(item, artist, title):
File "/usr/lib/python3.8/site-packages/beets/plugins.py", line 392, in item_candidates
for item_candidate in plugin.item_candidates(item, artist, title):
File "/usr/lib/python3.8/site-packages/beetsplug/bandcamp.py", line 96, in item_candidates
return self.get_tracks(item.title)
File "/usr/lib/python3.8/site-packages/beetsplug/bandcamp.py", line 166, in get_tracks
return [self.get_track_info(url) for url in track_urls]
File "/usr/lib/python3.8/site-packages/beetsplug/bandcamp.py", line 166, in <listcomp>
return [self.get_track_info(url) for url in track_urls]
File "/usr/lib/python3.8/site-packages/beetsplug/bandcamp.py", line 174, in get_track_info
title = name_section.find(attrs={'itemprop': 'name'}).text.strip()
AttributeError: 'NoneType' object has no attribute 'text'
I edited this to add a bit more information. The output above is using the -vv flag.
Hi guys,
after upgrading to beets 1.4.7 recently it looks like bandcamp plugin is broken.
While trying to import an album with tagging from bandcamp I am receving following error:
NameError: name 'basestring' is not defined
StackTrace is as follows:
Traceback (most recent call last):
File "/usr/local/bin/beet", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python3.6/site-packages/beets/ui/__init__.py", line 1256, in main
_raw_main(args)
File "/usr/local/lib/python3.6/site-packages/beets/ui/__init__.py", line 1243, in _raw_main
subcommand.func(lib, suboptions, subargs)
File "/usr/local/lib/python3.6/site-packages/beets/ui/commands.py", line 943, in import_func
import_files(lib, paths, query)
File "/usr/local/lib/python3.6/site-packages/beets/ui/commands.py", line 913, in import_files
session.run()
File "/usr/local/lib/python3.6/site-packages/beets/importer.py", line 329, in run
pl.run_parallel(QUEUE_SIZE)
File "/usr/local/lib/python3.6/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.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/beets/util/pipeline.py", line 312, in run
out = self.coro.send(msg)
File "/usr/local/lib/python3.6/site-packages/beets/util/pipeline.py", line 194, in coro
func(*(args + (task,)))
File "/usr/local/lib/python3.6/site-packages/beets/importer.py", line 1511, in plugin_stage
func(session, task)
File "/usr/local/lib/python3.6/site-packages/beets/plugins.py", line 140, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/beetsplug/fetchart.py", line 807, in fetch_art
candidate = self.art_for_album(task.album, task.paths, local)
File "/usr/local/lib/python3.6/site-packages/beetsplug/fetchart.py", line 873, in art_for_album
for candidate in source.get(album, self, paths):
File "/usr/local/lib/python3.6/site-packages/beetsplug/bandcamp.py", line 296, in get
if isinstance(album.mb_albumid, basestring) and u'bandcamp' in album.mb_albumid:
NameError: name 'basestring' is not defined
beet version
gives me:
beets version 1.4.7
Python version 3.6.5
plugins: bandcamp, chroma, discogs, duplicates, edit, embedart, fetchart, lastgenre, missing, scrub, zero
In my config I have bandcamp art enabled:
bandcamp:
art: true
And I am using the latest version of beets-bandcamp 0.1.2
If there is anything else I need to provide I will gladly do.
Disabling art in config gives me the ability to import - so as a workaround one can download the art and put into the import folder.
Thanx!
Hello, and thank you so much for this plugin! Unfortunately, I'm attempting to use it with a new install of Beets and not currently having any luck, I'm afraid.
My current configuration works otherwise, but when trying to add the album EP2
by AceMoMA
which is only on Bandcamp and not on Discogs or MusicBrainz, the follow occurs after running beet import /Users/*****/*****/Music/Bandcamp/library/AceMoMA/2020\ -\ EP2
Finding tags for album "AceMoMA - EP2".
Candidates:
1. Matthew Dear - EP2 (43.8%) (tracks, artist, source, ...) (Discogs, Vinyl, 2003, US, Spectral Sound, SPC-07)
2. Dego And Kaidi Tatham - EP2 (43.0%) (tracks, artist, source, ...) (Discogs, Vinyl, 2015, UK, Eglo Records, EGLO42)
3. AceMoMa - AceMoMa (41.3%) (tracks, album, year) (Digital Media, 2019, XW, Jenkem Recordings, JR-02)
4. Young Liar - EP2 (39.9%) (tracks, artist, year) (Digital Media, 2012, XW, The Calico Print)
5. Young Liar - EP2 (39.9%) (tracks, artist, year) (CD, 2012, GB, The Calico Print, TCP008)
6. FKA Twigs - EP2 (39.8%) (tracks, artist, source, ...) (Discogs, Vinyl, 2013, UK, Young Turks, YT098)
7. Headlights - EP2 (38.2%) (tracks, artist)
8. Fujiya & Miyagi - EP2 (36.3%) (tracks, artist, year) (CD, 2016, Impossible Objects Of Desire)
9. AceMoMa - A New Dawn [HOA007] (35.5%) (missing tracks, tracks, album) (Digital Media, 2020, US)
10. we. the pigs - EP2 (33.2%) (tracks, artist, year) (Digital Media, 2017, XW, Discos de Kirlian, DK48)
11. Various Artists - Sounds Blasts! EP2 (28.5%) (tracks, album, source, ...) (Discogs, Vinyl, 1989, UK, Sounds (9), BLASTS! 2)
12. Terre Thaemlitz - Deproduction EP2 (20.7%) (tracks, artist, album, ...) (Discogs, Vinyl, 2018, Japan, Comatonse Recordings, C.027.EP2)
# selection (default 1), Skip, Use as-is, as Tracks, Group albums,
Enter search, enter Id, aBort, eDit, edit Candidates?
So, I try to use I
to add the Id as the URL of the album on Bandcamp:
Enter release ID: https://acemomabk.bandcamp.com/album/ep2
No matching release found for 4 tracks.
For help, see: http://beets.readthedocs.org/en/latest/faq.html#nomatch
Results from beet --version
beets version 1.4.9
Python version 2.7.16
plugins: bandcamp, discogs, duplicates, edit, embedart, fetchart, fromfilename, lastgenre, mbsync, missing
Here is my current configuration, and everything else seems to be working without issue:
# Root directory of your music
directory: /Users/*****/*****/Music/Library
# Location where your beets database is saved
library: /Users/*****/*****/Music/Library/musiclibrary.db
# Configure the importing process
import:
move: yes
log: /Users/*****/*****/Music/Library/beet.log
paths:
default: %if{$label,$label,Not on Label}/$albumartist - $album%aunique{} [$year]/$track $title
singleton: Singles/$artist/$title [$year]
comp: $label/$album%aunique{} [$year]/$track $title
threaded: yes
# Install these requirements if you want to use all the plugins. If you only want to use some, the required dependencies stand behind the plugins as well.
# pip install --user beets[fetchart,lastgenre] requests requests_oauthlib discogs-client pylast beets-bandcamp
plugins:
# Assist autotagger
- fromfilename
# Add Discogs as a metadata source
- discogs # pip install --user discogs-client
# Add Bandcamp as a metadata source
- bandcamp # pip install --user beets-bandcamp
# Activate `beet mbsync` command to allow updating tags
- mbsync
# Active `beet missing` command to allow seeing missing albums and tracks
- missing
# Activate `beet duplicates` command
- duplicates
# Edit metadata of songs or albums with a text editor like vim or micro
- edit
# Downloads genres from last.fm
- lastgenre # pip install --user pylast
# Downloads Covers
- fetchart # pip install --user requests
# Adds the cover art to the metadata of the audio files
- embedart
# Set User Token for Discogs API
discogs:
user_token: *********************
bandcamp:
lyrics: false
art: false
# Configure the edit plugin. Defines which fields are available for editing.
# To choose your favorite editor change the $EDITOR environment variable
edit:
itemfields:
- album
- albumartist
- artist
- track
- title
- year
albumfields:
- albumartist
- album
- year
- albumtype
lastgenre:
auto: yes
source: album
fetchart:
auto: yes
# Activates the embed art plugin and adds the cover to the audio files metadata
embedart:
auto: yes
Thank you very much for your time, and please let me know if there's anything I can do to try and help with debugging or any other information I could provide to be helpful.
hallo, this is exactly the plugin I was hoping to find with beets! I get a lot of my music from bandcamp, and it'd be neat if genre data could be retrieved as well as other metadata. is it possible to add this functionality? it's annoying that bc don't provide genre data as it is on downloaded files, since my music collection is now a mess of unclassified albums.
anyway, if you think this is possible, that'd be so great!
thanks for your hard work on this regardless!
bandcamp: Searching album, page 1
Sending event: albuminfo_received
Candidate: https://artist.bandcamp.com - https://artist.bandcamp.com/album/album (artist)
Traceback (most recent call last):
File "/home/arogl/.local/bin/beet", line 33, in <module>
sys.exit(load_entry_point('beets', 'console_scripts', 'beet')())
File "/mnt/h/Git/beets/beets/ui/__init__.py", line 1267, in main
_raw_main(args)
File "/mnt/h/Git/beets/beets/ui/__init__.py", line 1254, in _raw_main
subcommand.func(lib, suboptions, subargs)
File "/mnt/h/Git/beets/beets/ui/commands.py", line 956, in import_func
import_files(lib, paths, query)
File "/mnt/h/Git/beets/beets/ui/commands.py", line 926, in import_files
session.run()
File "/mnt/h/Git/beets/beets/importer.py", line 329, in run
pl.run_parallel(QUEUE_SIZE)
File "/mnt/h/Git/beets/beets/util/pipeline.py", line 445, in run_parallel
six.reraise(exc_info[0], exc_info[1], exc_info[2])
File "/usr/lib/python3/dist-packages/six.py", line 703, in reraise
raise value
File "/mnt/h/Git/beets/beets/util/pipeline.py", line 312, in run
out = self.coro.send(msg)
File "/mnt/h/Git/beets/beets/util/pipeline.py", line 194, in coro
func(*(args + (task,)))
File "/mnt/h/Git/beets/beets/importer.py", line 1353, in lookup_candidates
task.lookup_candidates()
File "/mnt/h/Git/beets/beets/importer.py", line 641, in lookup_candidates
autotag.tag_album(self.items, search_ids=self.search_ids)
File "/mnt/h/Git/beets/beets/autotag/match.py", line 468, in tag_album
_add_candidate(items, candidates, matched_candidate)
File "/mnt/h/Git/beets/beets/autotag/match.py", line 374, in _add_candidate
mapping, extra_items, extra_tracks = assign_items(items, info.tracks)
File "/mnt/h/Git/beets/beets/autotag/match.py", line 102, in assign_items
row.append(track_distance(item, track))
File "/mnt/h/Git/beets/beets/autotag/match.py", line 134, in track_distance
if track_info.length:
AttributeError: 'str' object has no attribute 'length'
I have tried debugging and I do not see how or when the function album_distance is called once the candidate has been identified.
Debugging shows possible MusicBrainz candidates but not the last one from Bandcamp.
Hoping you can help?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.