Skip to content

Instantly share code, notes, and snippets.

@pixeldesu
Created March 4, 2022 20:28
Show Gist options
  • Save pixeldesu/5bcdcc9d0963114592e637b2de9ff5b5 to your computer and use it in GitHub Desktop.
Save pixeldesu/5bcdcc9d0963114592e637b2de9ff5b5 to your computer and use it in GitHub Desktop.
Small script to get the (almost) total of tracks present in an entire Bandcamp collection
/* Open your (or any other) Bandcamp profile, press the "show all x items" button and scroll to the very bottom of the
* page, with this you populate the collection item cache which we then can use to mess around with data
*/
let tracks = 0;
(Object.values(ItemCache.collection)).forEach((tra) => {
tracks += parseInt(tra.num_streamable_tracks)
});
console.log(`Your collection contains ${tracks} streamable tracks (this means the actual track count might be slightly higher)`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment