nathom / streamrip

A scriptable music downloader for Qobuz, Tidal, SoundCloud, and Deezer
GNU General Public License v3.0
2.73k stars 247 forks source link

[BUG] Track number, disc number, total discs, total tracks should not have any zero padding #620

Open expresidx opened 9 months ago

expresidx commented 9 months ago

Describe the bug

As far as I know those metadata tags should not have any zero padding as part of the standard. If user preferred to use zero padding then it should have option for that.

Command Used

rip --no-db -vvv url https://tidal.com/browse/playlist/fc0786d4-c0c8-438e-81db-6c890dbb2526

Debug Traceback

⠏ Resolving URLs...[09:32:17] DEBUG    {'uuid': 'fc0786d4-c0c8-438e-81db-6c890dbb2526', 'title': 'TODO',         tidal.py:104
                    'numberOfTracks': 1, 'numberOfVideos': 0, 'creator': {'id': 196623134},
                    'description': '', 'duration': 553, 'lastUpdated':
                    '2024-02-07T02:25:48.941+0000', 'created':
                    '2024-01-16T09:00:22.316+0000', 'type': 'USER', 'publicPlaylist': False,
                    'url':
                    'http://www.tidal.com/playlist/fc0786d4-c0c8-438e-81db-6c890dbb2526',
                    'image': '634801d0-c8ee-4222-ae86-790734334d54', 'popularity': 0,
                    'squareImage': '90180971-aac9-4713-bb31-0a190f19c0b3', 'promotedArtists':
                    [], 'lastItemAddedAt': '2024-02-07T02:25:48.941+0000', 'tracks': [{'id':
                    2400319, 'title': 'Violin Concerto No. 4 In D Major Kv 218: I. Allegro',
                    'duration': 553, 'replayGain': -3.6, 'peak': 0.802526, 'allowStreaming':
                    True, 'streamReady': True, 'adSupportedStreamReady': True, 'djReady':
                    True, 'stemReady': False, 'streamStartDate':
                    '2019-01-14T00:00:00.000+0000', 'premiumStreamingOnly': False,
                    'trackNumber': 1, 'volumeNumber': 1, 'version': None, 'popularity': 36,
                    'copyright': '(P) 2009 2L (Lindberg Lyd, Norway)', 'description': None,
                    'url': 'http://www.tidal.com/track/2400319', 'isrc': 'NOMPP0606010',
                    'editable': False, 'explicit': False, 'audioQuality': 'HI_RES',
                    'audioModes': ['STEREO'], 'mediaMetadata': {'tags': ['LOSSLESS', 'MQA']},
                    'artist': {'id': 20269, 'name': 'Trondheimsolistene', 'type': 'MAIN',
                    'picture': None}, 'artists': [{'id': 20269, 'name': 'Trondheimsolistene',
                    'type': 'MAIN', 'picture': None}, {'id': 4945930, 'name': '2L Audiophile
                    Reference Recordings', 'type': 'MAIN', 'picture': None}, {'id': 3635392,
                    'name': 'Marianne Thorsen', 'type': 'MAIN', 'picture':
                    '6c535aa4-fe8c-4c31-930d-beaeacb73e9f'}], 'album': {'id': 2400318,
                    'title': '2L — The Nordic Sound', 'cover':
                    '2a5da185-eced-4fa2-aa92-360596c03300', 'vibrantColor': '#89c0e3',
                    'videoCover': None, 'releaseDate': '2009-05-26'}, 'mixes': {'TRACK_MIX':
                    '0017637030fea52517e6d7fdb47674'}, 'dateAdded':
                    '2024-02-07T02:25:48.941+0000', 'index': 100000, 'itemUuid':
                    'd668a32d-7bb1-4b93-b7b4-9964e7ea2a05'}]}
           DEBUG    {'id': 2400319, 'title': 'Violin Concerto No. 4 In D Major Kv 218: I.     tidal.py:104
                    Allegro', 'duration': 553, 'replayGain': -3.6, 'peak': 0.802526,
                    'allowStreaming': True, 'streamReady': True, 'adSupportedStreamReady':
                    True, 'djReady': True, 'stemReady': False, 'streamStartDate':
                    '2019-01-14T00:00:00.000+0000', 'premiumStreamingOnly': False,
                    'trackNumber': 1, 'volumeNumber': 1, 'version': None, 'popularity': 36,
                    'copyright': '(P) 2009 2L (Lindberg Lyd, Norway)', 'url':
                    'http://www.tidal.com/track/2400319', 'isrc': 'NOMPP0606010', 'editable':
                    False, 'explicit': False, 'audioQuality': 'HI_RES', 'audioModes':
                    ['STEREO'], 'mediaMetadata': {'tags': ['LOSSLESS', 'MQA']}, 'artist':
                    {'id': 20269, 'name': 'Trondheimsolistene', 'type': 'MAIN', 'picture':
                    None}, 'artists': [{'id': 20269, 'name': 'Trondheimsolistene', 'type':
                    'MAIN', 'picture': None}, {'id': 4945930, 'name': '2L Audiophile
                    Reference Recordings', 'type': 'MAIN', 'picture': None}, {'id': 3635392,
                    'name': 'Marianne Thorsen', 'type': 'MAIN', 'picture':
                    '6c535aa4-fe8c-4c31-930d-beaeacb73e9f'}], 'album': {'id': 2400318,
                    'title': '2L — The Nordic Sound', 'cover':
                    '2a5da185-eced-4fa2-aa92-360596c03300', 'vibrantColor': '#89c0e3',
                    'videoCover': None}, 'mixes': {'TRACK_MIX':
                    '0017637030fea52517e6d7fdb47674'}}
[09:32:18] DEBUG    {'trackId': 2400319, 'assetPresentation': 'FULL', 'audioMode': 'STEREO',  tidal.py:137
                    'audioQuality': 'HI_RES', 'manifestMimeType':
                    'application/vnd.tidal.bts', 'manifestHash':
                    'tjPLQozhoo7RwHUywYfahOO11nL4tB5Pkjr0bg/Q69Q=', 'manifest':
                    'eyJtaW1lVHlwZSI6ImF1ZGlvL2ZsYWMiLCJjb2RlY3MiOiJtcWEiLCJlbmNyeXB0aW9uVHlw
                    ZSI6Ik5PTkUiLCJ1cmxzIjpbImh0dHBzOi8vc3AtcHItY2YuYXVkaW8udGlkYWwuY29tL21lZ
                    GlhdHJhY2tzL0NBRWFLUkluT1dZM09UTXhZek5qTVRNMk1EZGxNV0ppTWpobE1XUmxZV00yWl
                    RCbU1XWmZOakF1YlhBMC8wLmZsYWM/RXhwaXJlcz0xNzA3Mjc2NzM4JlNpZ25hdHVyZT1iOVJ
                    NQlpvaWNWcVZEU1Y5YUs3VkVZdW5WVU9YVmdmcHRqTXQ2UzY4amFxUkotdTV2Qm9jN1I4dUJH
                    cmdmfmxVYTAwMUM3ZTZ5bn5xNFBabUl5LUVrYm4xczR1OGRZNkc5UHdnSVJGUlF6RExYa3dDW
                    nRCZzhtcFJEZ0UtM0NpS1hpOEJTTjJpcEpQYWFMeFdiVG1PR1NjdXN2cEpnaU82dG9UZUdLN2
                    R1ZHQweFdpa1ZudE0teHdVbkxHU3A4T2h5MnFKUG5XNTgxOExaTzlmYXlhdE85Y2k0SjNSVWp
                    rV2xkNlJvczdPZU9TLUgyRlprTDBDbTdob3N+NU5GWVRCckd5SjBKZm9ScUJ4ZH54dDVFeEZW
                    aFZmUWx0QUUxN3U4SW04dUp2dmtXT0NqUnlWVXZVVGxyekNBUUJlM1UtNTN5ODJpLU1KWnllY
                    VZrMUNwT2M2UHdfXyZLZXktUGFpci1JZD1LMTRMWkNaOVFVSTRKTCJdfQ==',
                    'albumReplayGain': -3.6, 'albumPeakAmplitude': 0.97619,
                    'trackReplayGain': -0.06, 'trackPeakAmplitude': 0.802526}
           DEBUG    {'mimeType': 'audio/flac', 'codecs': 'mqa', 'encryptionType': 'NONE',     tidal.py:143
                    'urls':
                    ['https://sp-pr-cf.audio.tidal.com/mediatracks/CAEaKRInOWY3OTMxYzNjMTM2MD
                    dlMWJiMjhlMWRlYWM2ZTBmMWZfNjAubXA0/0.flac?Expires=1707276738&Signature=b9
                    RMBZoicVqVDSV9aK7VEYunVUOXVgfptjMt6S68jaqRJ-u5vBoc7R8uBGrgf~lUa001C7e6yn~
                    q4PZmIy-Ekbn1s4u8dY6G9PwgIRFRQzDLXkwCZtBg8mpRDgE-3CiKXi8BSN2ipJPaaLxWbTmO
                    GScusvpJgiO6toTeGK7dudt0xWikVntM-xwUnLGSp8Ohy2qJPnW5818LZO9fayatO9ci4J3RU
                    jkWld6Ros7OeOS-H2FZkL0Cm7hos~5NFYTBrGyJ0JfoRqBxd~xt5ExFVhVfQltAE17u8Im8uJ
                    vvkWOCjRyVUvUTlrzCAQBe3U-53y82i-MJZyeaVk1CpOc6Pw__&Key-Pair-Id=K14LZCZ9QU
                    I4JL']}
[09:32:30] DEBUG    Tagging with [('TITLE', 'Violin Concerto No. 4 In D Major Kv 218: I.     tagger.py:253
                    Allegro'), ('ARTIST', 'Trondheimsolistene, 2L Audiophile Reference
                    Recordings, Marianne Thorsen'), ('ALBUM', '2L — The Nordic Sound'),
                    ('ALBUMARTIST', 'Trondheimsolistene, 2L Audiophile Reference Recordings,
                    Marianne Thorsen'), ('YEAR', '2019'), ('COPYRIGHT', '℗ 2009 2L (Lindberg
                    Lyd, Norway)'), ('TRACKNUMBER', '01'), ('DISCNUMBER', '01'),
                    ('TRACKTOTAL', '01'), ('DISCTOTAL', '01'), ('DATE',
                    '2019-01-14T00:00:00.000+0000'), ('ISRC', 'NOMPP0606010')]
──────────────────────────────────────────── Downloading TODO ────────────────────────────────────────────
           DEBUG    Removing dirs {'~/StreamripDownloads/TODO/__artwork'}

Config File

[metadata]
set_playlist_to_album = false
renumber_playlist_tracks = false

Operating System

Linux

streamrip version

2.0.5

Screenshots and recordings

No response

Additional context

No response

snnnnkko commented 4 months ago

https://github.com/nathom/streamrip/blob/dev/streamrip/metadata/tagger.py#L132C1-L132C26

This block is responsible. If you want to have your musicbrainz-style track numbering and until there's a config for this, you can shrimply remove it in the source and install your own bootleg version of streamrip by running pip install . in the directory with pyproject.toml.