]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[bandcamp:album] Extract track titles
authorLuca Steeb <contact@luca-steeb.com>
Sun, 20 Aug 2017 16:32:33 +0000 (09:32 -0700)
committerSergey M <dstftw@gmail.com>
Sun, 20 Aug 2017 16:32:33 +0000 (23:32 +0700)
youtube_dl/extractor/bandcamp.py

index 9ddb9af1725467ff67c8407f46ce1f891ed701de..be41bd5a22477fce2aca4a043799574e148fdc57 100644 (file)
@@ -242,7 +242,12 @@ class BandcampAlbumIE(InfoExtractor):
             raise ExtractorError('The page doesn\'t contain any tracks')
         # Only tracks with duration info have songs
         entries = [
-            self.url_result(compat_urlparse.urljoin(url, t_path), ie=BandcampIE.ie_key())
+            self.url_result(
+                compat_urlparse.urljoin(url, t_path),
+                ie=BandcampIE.ie_key(),
+                video_title=self._search_regex(
+                    r'<span\b[^>]+\bitemprop=["\']name["\'][^>]*>([^<]+)',
+                    elem_content, 'track title', fatal=False))
             for elem_content, t_path in track_elements
             if self._html_search_meta('duration', elem_content, default=None)]