From e0c545b14526c07392f222f6571802c7cfd61fc4 Mon Sep 17 00:00:00 2001 From: garret1317 Date: Mon, 14 Jul 2025 14:45:30 +0100 Subject: [PATCH] only smuggle when track has track_license_id set --- yt_dlp/extractor/bandcamp.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/yt_dlp/extractor/bandcamp.py b/yt_dlp/extractor/bandcamp.py index da838338eb..32190c19a6 100644 --- a/yt_dlp/extractor/bandcamp.py +++ b/yt_dlp/extractor/bandcamp.py @@ -368,12 +368,17 @@ def _real_extract(self, url): if not track_info: raise ExtractorError('The page doesn\'t contain any tracks') # Only tracks with duration info have songs - entries = [ - self.url_result( - smuggle_url(urljoin(url, t['title_link']), t), BandcampIE.ie_key(), - str_or_none(t.get('track_id') or t.get('id')), t.get('title')) - for t in track_info - if t.get('duration')] + entries = [] + for t in track_info: + if t.get('duration'): + url = urljoin(url, t['title_link']) + if t.get('track_license_id'): + # tracks with this set don't have a usable tralbum on their pages + url = smuggle_url(url, t) + entries.append(self.url_result( + url, BandcampIE.ie_key(), + str_or_none(t.get('track_id') or t.get('id')), t.get('title'), + )) current = tralbum.get('current') or {}