NewPipeExtractor icon indicating copy to clipboard operation
NewPipeExtractor copied to clipboard

Load additional Bandcamp comments

Open fynngodau opened this issue 4 years ago • 1 comments

Follow-up to #586 and #620.

Currently, we are only loading the first batch of comments (max. 3).

Example of an album where multiple pages of comments are available: https://alfamist.bandcamp.com/album/bring-backs

fynngodau avatar May 02 '21 13:05 fynngodau

The request Bandcamp makes after loading more comments looks like this: https://alfamist.bandcamp.com/api/tralbumcollectors/2/reviews. I presume alfamist can be replaced with any artist slug. It's a POST request that sends form data.

{
  "tralbum_type": "a",
  "tralbum_id": 87634066,
  "token": "1:1615548668:6888782:1:1:0",
  "count": 7,
  "exclude_fan_ids": []
}

For tralbum_type, I assume a is for "album", and that t might be for "track." The initial token parameter, which acts as a cursor, can be fount in the JSON blob at div#collectors-data[data-blob] of the initial HTML document at root['reviews'][5]['token'].

The request returns JSON that has the same shape as what can be found in the HTML doc, so everyone should be familiar with it already.

I've attached an HTTP Archive to this comment detailing an anonymous browser session to the page linked in OP which simply loads the page and clicks the more... button. You can view it using Google's HAR Analyzer or Jan Odvarko's HTTP Archive Viewer.

alfamist.bandcamp.com_redacted.har.txt

SuperSonicHub1 avatar Jun 03 '21 21:06 SuperSonicHub1