RustyRin / bandcamp-api

A simple way to get info from Bandcamp
GNU General Public License v3.0
10 stars 2 forks source link

Weird results for tracks listed at album level #6

Closed matkoniecz closed 1 year ago

matkoniecz commented 1 year ago

https://lesfriction.bandcamp.com/music lists some tracks at album level what results in interesting issues:

from bandcamp_api import Bandcamp

bc = Bandcamp()
data = bc.get_artist(artist_url = "https://lesfriction.bandcamp.com/album/les-friction")
print('https://lesfriction.bandcamp.com/track/who-will-save-you-now-instrumental' in data.album_urls)
print({'artist': data.artist_title, 'link': data.artist_url, 'album_urls': data.album_urls})
album = bc.get_album(album_url='https://lesfriction.bandcamp.com/track/who-will-save-you-now-instrumental')
print(album.tracks)
print(album.tracks[0].price)
print(album.price)

https://lesfriction.bandcamp.com/track/who-will-save-you-now-instrumental is in data.album_urls

Its data can be fetched with bc.get_album - but album.tracks[0].price gives price of the entire discography

And album.price is None

matkoniecz commented 1 year ago

Not sure how it should be fixed - add data.track_urls? Allow parsing tracks as albums? List album-level tracks in data.album_urls but throw exception on passing them to get_album, and user should on their own fetch track data for them?

RustyRin commented 1 year ago

I am actually already remaking the track objects currently!
Should be fixed when I finish the rework

matkoniecz commented 1 year ago

oh, in such case I guess that making PR would not be a good idea

RustyRin commented 1 year ago

Yeah, its a near total rework

RustyRin commented 1 year ago

I do think this is now fixed in 0.2.1 I will update the docs in a day or two

RustyRin commented 1 year ago

Closed!