Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
--write-description fails on Bandcamp #25056
Comments
|
Was able to replicate this on my machine. It looks like BandcampIE (the extractor for individual tracks on Bandcamp) doesn't include any code for retrieving the description, so this is a missing feature rather than a bug. Currently, BandcampIE pulls all its metadata out of a JSON object in the page: the Here's some untested code for BandcampIE's current = self._parse_json(
self._search_regex(
r'current\s*:\s*\[\s*({.+?})\s*\]\s*,\s*?\n',
webpage, 'current', default='{}'), title)
if current:
about = str_or_none(current.get('about'))
lyrics = str_or_none(current.get('lyrics'))
description = "\n\n".join(filter(None, (about, lyrics)))If only one of the two values is set, then This code is based on the existing You could also add the same functionality to BandcampAlbumIE with similar code. However, albums don't have lyrics, so you would only need the |
|
Here’s what I came up with, based on your code: tralbumdata_current = self._parse_json(
self._search_regex(
r'TralbumData\s*=\s*\{.*?current\s*:\s*(\{.*?\})',
webpage, 'track description', default='{}'), title)
description = None
if tralbumdata_current:
description = '\r\n\r\n'.join(filter(None, (
str_or_none(tralbumdata_current.get('about')),
str_or_none(tralbumdata_current.get('lyrics')))))My modifications explained:
I have also added Also a side question: What happens when |
Checklist
Verbose log
Description
Attempting to download a track description from Bandcamp using
--write-descriptionresults inWARNING: There's no description to write.and no file being written, even though a description is present.As you can see here, the track used above does have a description.
Is this maybe not supported at all for Bandcamp yet, making this more of a feature request? (In that case, the current warning is giving the user the wrong idea.)