Sanitize Bandcamp origin_url field
See original GitHub issueDescribe the bug I noticed that listens submitted to ListenBrainz can have very long URLs full of Bandcamp-specific query parameters.
How to reproduce
Search for an album name and click on the result. Start playing the album.
Here is an example of the type of originURL sent to ListenBrainz in the track_metadata:
"origin_url": "https://yidmusic.bandcamp.com/album/space-klezmer?from=search&search_item_id=266395793&search_item_type=a&search_match_part=%3F&search_page_id=2321371749&search_page_no=0&search_rank=2&logged_in_menubar=true"
I have only checked with the Bandcamp connector and submitting to LB, but the same could apply to other connectors.
Expected behavior
I would expect a URL stripped of the query parameters like so:
"origin_url": "https://yidmusic.bandcamp.com/album/space-klezmer"
Environment (please complete the following information)
- OS: Mac
- Browser: Brave (Chromuim)
- Extension version: 2.82.1
Issue Analytics
- State:
- Created 9 months ago
- Comments:5 (5 by maintainers)

Top Related StackOverflow Question
Found the issue - by default we take the full URL - this kinda makes me wonder if we should by default on all connectors exclude everything in the query string.
I could imagine that might cause some invalid data for you though since I’m sure there are some services which use that?
Indeed - but I am trying to think of what would be better.
The example found with Bandcamp looked like some internal analytics for tracking where folks came from.
But I could imagine also cases where folks run similar campaigns from other platforms - would be quite a significant effort to go through each connector though.