]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[bandcamp] Extract track_number (closes #17266)
authorParmjit Virk <pvirk@mts.net>
Thu, 30 Aug 2018 19:32:35 +0000 (14:32 -0500)
committerSergey M <dstftw@gmail.com>
Thu, 30 Aug 2018 19:32:35 +0000 (02:32 +0700)
youtube_dl/extractor/bandcamp.py

index b8514734d5780a380d6997efdc9fa09e96f7042a..bc4c5165af7282b9fe1af68a6a766b62e38d0c2f 100644 (file)
@@ -44,6 +44,17 @@ class BandcampIE(InfoExtractor):
             'title': 'Ben Prunty - Lanius (Battle)',
             'uploader': 'Ben Prunty',
         },
+    }, {
+        'url': 'https://relapsealumni.bandcamp.com/track/hail-to-fire',
+        'info_dict': {
+            'id': '2584466013',
+            'ext': 'mp3',
+            'title': 'Hail to Fire',
+            'track_number': 5,
+        },
+        'params': {
+            'skip_download': True,
+        },
     }]
 
     def _real_extract(self, url):
@@ -82,6 +93,7 @@ class BandcampIE(InfoExtractor):
                     'thumbnail': thumbnail,
                     'formats': formats,
                     'duration': float_or_none(data.get('duration')),
+                    'track_number': int_or_none(data.get('track_num')),
                 }
             else:
                 raise ExtractorError('No free songs found')