Discussion:
[mb-devel] automatically adding artists' subscriptions via python-musicbrainz2 or musicbrainzngs
Maximilian Bräutigam
2015-03-19 14:00:40 UTC
Permalink
Dear all,

I generated a huge list (python pickled) of artists' IDs to which I want
to subscribe. Unfortunately, I cannot find the entry to do this.
Obviously, with python-musicbrainzngs I can add them to my collection,
but I want to subscribe to them.

Any comments, tips, and remarks are highly appreciated.

Best wishes,
Max
Alastair Porter
2015-03-19 14:35:17 UTC
Permalink
Hi Max,

You're right, the API doesn't support subscribing to entities, so we don't
expose that in musicbrainzngs.

Subscribing is just a matter of visiting a specific url:
https://musicbrainz.org/account/subscriptions/artist/add?id=859749
while you are logged in. If you're comfortable with python-requests or
scrapy you could do this yourself.

Unfortunately the biggest problem is that these urls take row ids instead
of musicbrainz ids. We spoke about it a bit (
http://chatlogs.musicbrainz.org/musicbrainz-devel/2015/2015-03/2015-03-19.html#T14-20-26-909477)
and the easiest way is probably to load the artist page, find the subscribe
link, and click on it automatically.
Meanwhile, we've filed some issues (
http://tickets.musicbrainz.org/browse/MBS-8305) to make this easier in the
future.

Alastair
Post by Maximilian Bräutigam
Dear all,
I generated a huge list (python pickled) of artists' IDs to which I want
to subscribe. Unfortunately, I cannot find the entry to do this.
Obviously, with python-musicbrainzngs I can add them to my collection,
but I want to subscribe to them.
Any comments, tips, and remarks are highly appreciated.
Best wishes,
Max
_______________________________________________
MusicBrainz-devel mailing list
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-devel
Maximilian Bräutigam
2015-03-19 14:45:54 UTC
Permalink
Hi Alastair,

thanks a lot for your answer. I was really afraid that the solution will
be so bloated since it means a lot of traffic and requests on the mb
database. Anyway, I do not see a better solution and just wanted to get
a second opinion on this.

Thank you very much again!
Best wishes,
Max
Post by Alastair Porter
Hi Max,
You're right, the API doesn't support subscribing to entities, so we
don't expose that in musicbrainzngs.
https://musicbrainz.org/account/subscriptions/artist/add?id=859749
while you are logged in. If you're comfortable with python-requests or
scrapy you could do this yourself.
Unfortunately the biggest problem is that these urls take row ids
instead of musicbrainz ids. We spoke about it a bit
(http://chatlogs.musicbrainz.org/musicbrainz-devel/2015/2015-03/2015-03-19.html#T14-20-26-909477)
and the easiest way is probably to load the artist page, find the
subscribe link, and click on it automatically.
Meanwhile, we've filed some issues
(http://tickets.musicbrainz.org/browse/MBS-8305) to make this easier in
the future.
Alastair
Dear all,
I generated a huge list (python pickled) of artists' IDs to which I want
to subscribe. Unfortunately, I cannot find the entry to do this.
Obviously, with python-musicbrainzngs I can add them to my collection,
but I want to subscribe to them.
Any comments, tips, and remarks are highly appreciated.
Best wishes,
Max
Maximilian Bräutigam
2015-03-20 10:42:57 UTC
Permalink
Post by Maximilian Bräutigam
Hi Alastair,
thanks a lot for your answer. I was really afraid that the solution will
be so bloated since it means a lot of traffic and requests on the mb
database. Anyway, I do not see a better solution and just wanted to get
a second opinion on this.
Thank you very much again!
Best wishes,
Max
Post by Alastair Porter
Hi Max,
You're right, the API doesn't support subscribing to entities, so we
don't expose that in musicbrainzngs.
https://musicbrainz.org/account/subscriptions/artist/add?id=859749
while you are logged in. If you're comfortable with python-requests or
scrapy you could do this yourself.
Unfortunately the biggest problem is that these urls take row ids
instead of musicbrainz ids. We spoke about it a bit
(http://chatlogs.musicbrainz.org/musicbrainz-devel/2015/2015-03/2015-03-19.html#T14-20-26-909477)
and the easiest way is probably to load the artist page, find the
subscribe link, and click on it automatically.
Meanwhile, we've filed some issues
(http://tickets.musicbrainz.org/browse/MBS-8305) to make this easier in
the future.
Alastair
Dear all,
I generated a huge list (python pickled) of artists' IDs to which I want
to subscribe. Unfortunately, I cannot find the entry to do this.
Obviously, with python-musicbrainzngs I can add them to my collection,
but I want to subscribe to them.
Any comments, tips, and remarks are highly appreciated.
Best wishes,
Max
Just for completeness, here is what I did:

$ ./artistid2rownumber.py > rows
$ wget --save-cookies cookies.txt --keep-session-cookies \
--post-data 'username=eew4Weap&password=W4fkaVfj' \
https://musicbrainz.org/login
$ ./subscribe.sh

It took about 1 hour or so for 1800 subscriptions.

Best wishes,
Max
Ulrich Klauer
2015-03-20 11:40:48 UTC
Permalink
Post by Maximilian Bräutigam
$ wget --save-cookies cookies.txt --keep-session-cookies \
--post-data 'username=X&password=Y' \
https://musicbrainz.org/login
If that were real login data in your message, you should absolutely
change your password.

Ulrich
Maximilian Bräutigam
2015-03-20 12:02:38 UTC
Permalink
Post by Ulrich Klauer
Post by Maximilian Bräutigam
$ wget --save-cookies cookies.txt --keep-session-cookies \
--post-data 'username=X&password=Y' \
https://musicbrainz.org/login
If that were real login data in your message, you should absolutely
change your password.
Ulrich
Of course, it was not the real data. ;)

Loading...