nathom / streamrip

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

[BUG] Unable to handle long album titles in paths #386

Closed Wim1975 closed 1 year ago

Wim1975 commented 1 year ago

Describe the bug

When the title of an album on Qobuz is too long, like in the example below : Downloading The Doctor (Comfortably Numb) [The Wall Work In Progress, Pt. 2, 1979] [Programme 1] [Band Demo] (2011 Remaster) Streamrip is truncating the path (to 125 characters?) and trying to add "..." (128 characters) and then tries to create the folder D:\Q\Pink Floyd\The Doctor (Comfortably Numb) [The Wall Work In Progress, Pt. 2, 1979] [Programme 1] [Band Demo] (2011 Remas...

but Windows doesn't like ellipsis "..." (or any dots!) at the end and removes it anyway, so the folder created becomes : D:\Q\Pink Floyd\The Doctor (Comfortably Numb) [The Wall Work In Progress, Pt. 2, 1979] [Programme 1] [Band Demo] (2011 Remas

Next Streamrip is trying to save the cover.jpg in D:\Q\Pink Floyd\The Doctor (Comfortably Numb) [The Wall Work In Progress, Pt. 2, 1979] [Programme 1] [Band Demo] (2011 Remas...\cover.jpg But of course this doesn't work as a folder with that ellipsis doesn't exist.

Can one please remove that truncation? (Windows can be set to accept 260 characters and this truncated path is now around 125 (128 with dots) also longer pathnames are possible by adding a key in registry so truncating isn't necessary at all) Thank you

Command Used

rip url https://open.qobuz.com/album/r8yd7rtarhada

Debug Traceback

C:\>rip url https://open.qobuz.com/album/r8yd7rtarhada --ignore-db -vvv
DEBUG:streamrip:Config loaded
DEBUG:streamrip:Parsed urls: [('qobuz', 'album', 'r8yd7rtarhada')]
DEBUG:streamrip:Searching for {'id': 'r8yd7rtarhada'} in database
Logging into qobuz
DEBUG:streamrip:Raw request signature: trackgetFileUrlformat_id7intentstreamtrack_id195125741673958816.476678410b251c286cfbf64d6b7105f253d9a2e
DEBUG:streamrip:Hashed request signature: 945ae5a5f57c58dc709f2cf94f80dc0e
DEBUG:streamrip:Raw request signature: trackgetFileUrlformat_id7intentstreamtrack_id195125741673958816.477682979549437fcc4a3faad4867b5cd25dcb
DEBUG:streamrip:Hashed request signature: 88b4311dcd26023e3eef304a26bbc8ed
DEBUG:streamrip:{"message":"Invalid Request Signature parameter (request_sig) (Root=1-63c695a0-0ccac3690d1196823876dc22)","code":400,"status":"error"}
DEBUG:streamrip:Test for 10b251c286cfbf64d6b7105f253d9a2e secret didn't work: Invalid app secret from params {'request_ts': 1673958816.4766784, 'request_sig': '945ae5a5f57c58dc709f2cf94f80dc0e', 'track_id': '19512574', 'format_id': 7, 'intent': 'stream'}
DEBUG:streamrip:{"track_id":19512574,"duration":30,"url":"https:\/\/streaming-qobuz-std.akamaized.net\/file?eid=19512574&fmt=7&profile=raw&range=20-30&app_id=950096963&etsp=1673962416&hmac=zNlOyL8ybGay2UtBSeTpBABupaA","format_id":7,"mime_type":"audio\/flac","sample":true,"restrictions":[{"code":"UserUnauthenticated"}],"sampling_rate":96,"bit_depth":24}
DEBUG:streamrip:{"user":{"id":1513939,"publicId":"qobuz:user:QlZljtrdEMqvn","email":"xxxxxxxxxxx","login":"_xxxxxxxxxx","firstname":"xxx","lastname":"xxxxxxx","display_name":"xxx xxxxxx","country_code":"BE","language_code":"nl","zone":"BE","store":"BE-nl","country":"BE","avatar":"https:\/\/graph.facebook.com\/3476025242435422\/picture?type=square","genre":"male","age":1,"creation_date":"2020-11-25","subscription":{"offer":"sublime+","periodicity":"annual","end_date":"2023-03-10","is_canceled":false},"credential":{"id":1360963,"label":"streaming-hifi-sublime-plus","description":"Abonnee Qobuz Hi-Fi Sublime+","parameters":{"lossy_streaming":true,"lossless_streaming":true,"hires_streaming":true,"hires_purchases_streaming":true,"mobile_streaming":true,"offline_streaming":true,"hfp_purchase":true,"included_format_group_ids":[1,2,3,4],"color_scheme":{"logo":"#B8D729"},"label":"Qobuz Hi-Fi Sublime+","short_label":"Hi-Fi Sublime+","source":"subscription"}},"last_update":{"favorite":1673915342,"playlist":1673377048,"purchase":1673294833},"player_settings":[],"externals":{"lastfm":{"name":"xxxxxxxxxx","key":"o6m9YovaMn95SiBXOl3QkjBKnIC0por9","settings":{"scrobbling":"1"}},"facebook":{"id":"3476025242435422","access_token":"xxxxxxxxxxxxxxxxxxxx","settings":{"news.reads":true,"music.listens":true}}}},"user_auth_token":"xxxxxxxxxxxxxxxxxx"}
INFO:streamrip:Logged in to Qobuz
DEBUG:streamrip:Logged into Qobuz
DEBUG:streamrip:Qobuz client is ready to use
DEBUG:streamrip:{'downloads': {'folder': 'D:\\Q', 'source_subdirectories': False, 'concurrency': {'enabled': True, 'max_connections': 3}}, 'qobuz': {'quality': 4, 'download_booklets': True, 'email': 'xxxxxxxxxxxxx', 'password': 'xxxxxxxxxxxxxxxxxx', 'app_id': '950096963', 'secrets': ['10b251c286cfbf64d6b7105f253d9a2e', '979549437fcc4a3faad4867b5cd25dcb']}, 'tidal': {'quality': 3, 'download_videos': True, 'user_id': 173848888, 'country_code': 'BE', 'access_token': 'eyJraWQiOiJ2OU1GbFhqWSIsImFsZyI6IkVTMjU2In0.eyJ0eXBlIjoibzJfYWNjZXNzIiwidWlkIjoxNzM4NDg4ODgsInNjb3BlIjoid19zdWIgcl91c3Igd191c3IiLCJnVmVyIjowLCJzVmVyIjowLCJjaWQiOjIyMTksImV4cCI6MTYzOTYxNTE4MSwic2lkIjoiM2ZlMWRlM2UtNmU5ZS00MzM0LTg1MDYtY2JhZjViYmIzNDRhIiwiaXNzIjoiaHR0cHM6Ly9hdXRoLnRpZGFsLmNvbS92MSJ9.jq55DJZkLdF098iC_kTBOERxpKJ1NNjArN3OBbZ-snxl-MEzlxGTyBFc5aIn3diFb1ueTIoXlz1hyLG8_Pys0Q', 'refresh_token': 'eyJraWQiOiJoUzFKYTdVMCIsImFsZyI6IkVTNTEyIn0.eyJ0eXBlIjoibzJfcmVmcmVzaCIsInVpZCI6MTczODQ4ODg4LCJzY29wZSI6Indfc3ViIHJfdXNyIHdfdXNyIiwiY2lkIjoyMjE5LCJzVmVyIjowLCJnVmVyIjowLCJpc3MiOiJodHRwczovL2F1dGgudGlkYWwuY29tL3YxIn0.ALLcBr4ZahwJ6-15UsgicPVdV9qeuwqdzdkM7usWUpSmWQ_fgIpRdGCrxGXtAjHwvDk56kCOP3erN27VJUjvjU-GAPd-iq4Yn51BCkn0xUsnHaR0Il5y3ITaiVn-hSppeTdj3CpCYgeVPRipFLcjxFYBbvSreplAgPWxldzyc9shfjbS', 'token_expiry': 1639615182.3192697}, 'deezer': {'quality': 2, 'arl': '', 'use_deezloader': True, 'deezloader_warnings': True}, 'soundcloud': {'quality': 0, 'client_id': '', 'app_version': ''}, 'youtube': {'quality': 0, 'download_videos': False, 'video_downloads_folder': ''}, 'database': {'enabled': False, 'downloads': {'enabled': True, 'path': 'C:\\Users\\hulpi\\AppData\\Local\\streamrip\\streamrip\\downloads.db'}, 'failed_downloads': {'enabled': True, 'path': 'C:\\Users\\hulpi\\AppData\\Local\\streamrip\\streamrip\\failed_downloads.db'}}, 'conversion': {'enabled': False, 'codec': 'ALAC', 'sampling_rate': 48000, 'bit_depth': 24, 'lossy_bitrate': 320}, 'filters': {'extras': False, 'repeats': False, 'non_albums': False, 'features': True, 'non_studio_albums': False, 'non_remaster': False}, 'artwork': {'embed': True, 'size': 'large', 'max_width': -1, 'max_height': -1, 'keep_hires_cover': True}, 'metadata': {'set_playlist_to_album': False, 'new_playlist_tracknumbers': True, 'exclude': []}, 'filepaths': {'add_singles_to_folder': False, 'folder_format': '{albumartist}\\{title} - [{year}] - {bit_depth}-{sampling_rate} - #{id}', 'track_format': '{tracknumber}. {artist} - {title}', 'restrict_characters': False}, 'lastfm': {'source': 'qobuz', 'fallback_source': 'deezer'}, 'theme': {'progress_bar': 'dainty'}, 'misc': {'version': '1.9.2'}}
DEBUG:streamrip:Arguments from config: {'restrict_filenames': False, 'parent_folder': 'D:\\Q', 'folder_format': '{albumartist}\\{title} - [{year}] - {bit_depth}-{sampling_rate} - #{id}', 'track_format': '{tracknumber}. {artist} - {title}', 'embed_cover': True, 'embed_cover_size': 'large', 'keep_hires_cover': True, 'set_playlist_to_album': False, 'stay_temp': False, 'conversion': {'enabled': False, 'codec': 'ALAC', 'sampling_rate': 48000, 'bit_depth': 24, 'lossy_bitrate': 320}, 'concurrent_downloads': True, 'max_connections': 3, 'new_tracknumbers': True, 'download_videos': True, 'download_booklets': True, 'download_youtube_videos': False, 'youtube_video_downloads_folder': '', 'add_singles_to_folder': False, 'max_artwork_width': -1, 'max_artwork_height': -1, 'exclude_tags': []}
DEBUG:streamrip:Loading metadata
DEBUG:streamrip:request params: {'app_id': '950096963', 'album_id': 'r8yd7rtarhada', 'limit': 500, 'offset': 0}
DEBUG:streamrip:{"maximum_bit_depth":16,"image":{"small":"https:\/\/static.qobuz.com\/images\/covers\/da\/ha\/r8yd7rtarhada_230.jpg","thumbnail":"https:\/\/static.qobuz.com\/images\/covers\/da\/ha\/r8yd7rtarhada_50.jpg","large":"https:\/\/static.qobuz.com\/images\/covers\/da\/ha\/r8yd7rtarhada_600.jpg","back":null},"media_count":1,"artist":{"image":null,"name":"Pink Floyd","id":38324,"albums_count":324,"slug":"pink-floyd","picture":null},"artists":[{"id":38324,"name":"Pink Floyd","roles":["main-artist"]}],"upc":"0190295213732","released_at":1330297200,"label":{"name":"Rhino - Parlophone","id":146441,"albums_count":44,"supplier_id":5,"slug":"rhino-parlophone"},"title":"The Doctor (Comfortably Numb) [The Wall Work In Progress, Pt. 2, 1979] [Programme 1] [Band Demo] ","qobuz_id":97010484,"version":"2011 Remaster","url":"https:\/\/www.qobuz.com\/fr-fr\/album\/the-doctor-comfortably-numb-the-wall-work-in-progress-pt-2-1979-programme-1-band-demo-pink-floyd\/r8yd7rtarhada","duration":195,"parental_warning":false,"popularity":0,"tracks_count":1,"genre":{"path":[112,119],"color":"#5eabc1","name":"Rock","id":119,"slug":"rock"},"maximum_channel_count":2,"id":"r8yd7rtarhada","maximum_sampling_rate":44.1,"articles":[],"release_date_original":"2012-02-27","release_date_download":"2012-02-27","release_date_stream":"2012-02-27","purchasable":true,"streamable":true,"previewable":true,"sampleable":true,"downloadable":true,"displayable":true,"purchasable_at":1649800800,"streamable_at":1649800800,"hires":false,"hires_streamable":false,"awards":[],"goodies":[],"area":null,"catchline":"","composer":{"id":573076,"name":"Various Composers","slug":"various-composers","albums_count":583621,"picture":null,"image":null},"created_at":1593840514,"genres_list":["Pop\/Rock","Pop\/Rock\u2192Rock"],"period":null,"copyright":"\u00a9 2020 Pink Floyd Music Ltd. marketed and distributed by Parlophone Records Limited, \u2117 2020 Pink Floyd Music Ltd","is_official":true,"maximum_technical_specifications":"","product_sales_factors_monthly":0,"product_sales_factors_weekly":0,"product_sales_factors_yearly":1,"product_type":"single","product_url":"\/fr-fr\/album\/the-doctor-comfortably-numb-the-wall-work-in-progress-pt-2-1979-programme-1-band-demo-pink-floyd\/r8yd7rtarhada","recording_information":"","relative_url":"\/album\/the-doctor-comfortably-numb-the-wall-work-in-progress-pt-2-1979-programme-1-band-demo-pink-floyd\/r8yd7rtarhada","release_tags":["remaster"],"release_type":"single","slug":"the-doctor-comfortably-numb-the-wall-work-in-progress-pt-2-1979-programme-1-band-demo-pink-floyd","subtitle":"Pink Floyd","tracks":{"offset":0,"limit":500,"total":1,"items":[{"maximum_bit_depth":16,"copyright":"\u00a9 2020 Pink Floyd Music Ltd. \u2117 2011 Pink Floyd Music Ltd., marketed and distributed by Parlophone Records Ltd., a Warner Music Group Company","performers":"Bruce Johnston, Vocals - Toni Tennille, Vocals - Bob Ezrin, Producer - Brian Christian, Engineer - Rick Hart, Chief Engineer - David Gilmour, Composer, Producer, Keyboards, Vocals, Rap, Boy Soprano, Album Sequencer, Kora, Vocoder, Sequencer Programmer - Roger Waters, Composer, Producer, Keyboards, Vocals, Boy Soprano, Vocoder - Joe Chemay, Vocals - Pink Floyd, MainArtist - James Guthrie, Producer, Engineer, Masterer - Joel Plante, Masterer, MasteringEngineer - Phil Taylor, Engineer - Richard Wright, Organ, Music, Bass Pedals, Kora, Vocoder, SciFi - Nick Mason, Drums, Saw - JOHN MCCLURE, Engineer - Jim Haas, Vocals - Stan Farber, Backing Vocals - John Joyce, Vocals - Patrice Quef, Engineer - Nick Griffiths, Engineer","audio_info":{"replaygain_track_peak":0.775177,"replaygain_track_gain":0.18},"performer":{"name":"Pink Floyd","id":38324},"work":null,"composer":{"name":"David Gilmour","id":81808},"isrc":"GBN9Y1100253","title":"The Doctor (Comfortably Numb) [The Wall Work In Progress, Pt. 2, 1979] [Programme 1] [Band Demo] ","version":"2011 Remaster","duration":195,"parental_warning":false,"track_number":1,"maximum_channel_count":2,"id":97010485,"media_number":1,"maximum_sampling_rate":44.1,"release_date_original":null,"release_date_download":null,"release_date_stream":null,"purchasable":true,"streamable":true,"previewable":true,"sampleable":true,"downloadable":true,"displayable":true,"purchasable_at":1649800800,"streamable_at":1649800800,"hires":false,"hires_streamable":false}]},"description":""}
--- Logging error ---
Traceback (most recent call last):
  File "C:\Users\hulpi\AppData\Local\Programs\Python\Python39\lib\logging\__init__.py", line 1086, in emit
    stream.write(msg + self.terminator)
  File "C:\Users\hulpi\AppData\Local\Programs\Python\Python39\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2192' in position 1873: character maps to <undefined>
Call stack:
  File "C:\Users\hulpi\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\hulpi\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\hulpi\AppData\Local\Programs\Python\Python39\Scripts\rip.exe\__main__.py", line 7, in <module>
    sys.exit(main())
  File "C:\Users\hulpi\AppData\Local\Programs\Python\Python39\lib\site-packages\rip\cli.py", line 830, in main
    application.run()
  File "C:\Users\hulpi\AppData\Local\Programs\Python\Python39\lib\site-packages\cleo\application.py", line 330, in run
    exit_code = self._run(io)
  File "C:\Users\hulpi\AppData\Local\Programs\Python\Python39\lib\site-packages\rip\cli.py", line 760, in _run
    super()._run(io)
  File "C:\Users\hulpi\AppData\Local\Programs\Python\Python39\lib\site-packages\cleo\application.py", line 425, in _run
    exit_code = self._run_command(command, io)
  File "C:\Users\hulpi\AppData\Local\Programs\Python\Python39\lib\site-packages\cleo\application.py", line 432, in _run_command
    return command.run(io)
  File "C:\Users\hulpi\AppData\Local\Programs\Python\Python39\lib\site-packages\cleo\commands\base_command.py", line 118, in run
    status_code = self.execute(io)
  File "C:\Users\hulpi\AppData\Local\Programs\Python\Python39\lib\site-packages\cleo\commands\command.py", line 85, in execute
    return self.handle()
  File "C:\Users\hulpi\AppData\Local\Programs\Python\Python39\lib\site-packages\rip\cli.py", line 124, in handle
    core.download()
  File "C:\Users\hulpi\AppData\Local\Programs\Python\Python39\lib\site-packages\rip\core.py", line 306, in download
    item.load_meta(**arguments)
  File "C:\Users\hulpi\AppData\Local\Programs\Python\Python39\lib\site-packages\streamrip\media.py", line 1470, in load_meta
    resp = self.client.get(self.id, media_type="album")
  File "C:\Users\hulpi\AppData\Local\Programs\Python\Python39\lib\site-packages\streamrip\clients.py", line 201, in get
    logger.debug(resp)
Message: {'maximum_bit_depth': 16, 'image': {'small': 'https://static.qobuz.com/images/covers/da/ha/r8yd7rtarhada_230.jpg', 'thumbnail': 'https://static.qobuz.com/images/covers/da/ha/r8yd7rtarhada_50.jpg', 'large': 'https://static.qobuz.com/images/covers/da/ha/r8yd7rtarhada_600.jpg', 'back': None}, 'media_count': 1, 'artist': {'image': None, 'name': 'Pink Floyd', 'id': 38324, 'albums_count': 324, 'slug': 'pink-floyd', 'picture': None}, 'artists': [{'id': 38324, 'name': 'Pink Floyd', 'roles': ['main-artist']}], 'upc': '0190295213732', 'released_at': 1330297200, 'label': {'name': 'Rhino - Parlophone', 'id': 146441, 'albums_count': 44, 'supplier_id': 5, 'slug': 'rhino-parlophone'}, 'title': 'The Doctor (Comfortably Numb) [The Wall Work In Progress, Pt. 2, 1979] [Programme 1] [Band Demo] ', 'qobuz_id': 97010484, 'version': '2011 Remaster', 'url': 'https://www.qobuz.com/fr-fr/album/the-doctor-comfortably-numb-the-wall-work-in-progress-pt-2-1979-programme-1-band-demo-pink-floyd/r8yd7rtarhada', 'duration': 195, 'parental_warning': False, 'popularity': 0, 'tracks_count': 1, 'genre': {'path': [112, 119], 'color': '#5eabc1', 'name': 'Rock', 'id': 119, 'slug': 'rock'}, 'maximum_channel_count': 2, 'id': 'r8yd7rtarhada', 'maximum_sampling_rate': 44.1, 'articles': [], 'release_date_original': '2012-02-27', 'release_date_download': '2012-02-27', 'release_date_stream': '2012-02-27', 'purchasable': True, 'streamable': True, 'previewable': True, 'sampleable': True, 'downloadable': True, 'displayable': True, 'purchasable_at': 1649800800, 'streamable_at': 1649800800, 'hires': False, 'hires_streamable': False, 'awards': [], 'goodies': [], 'area': None, 'catchline': '', 'composer': {'id': 573076, 'name': 'Various Composers', 'slug': 'various-composers', 'albums_count': 583621, 'picture': None, 'image': None}, 'created_at': 1593840514, 'genres_list': ['Pop/Rock', 'Pop/Rock→Rock'], 'period': None, 'copyright': '© 2020 Pink Floyd Music Ltd. marketed and distributed by Parlophone Records Limited, ℗ 2020 Pink Floyd Music Ltd', 'is_official': True, 'maximum_technical_specifications': '', 'product_sales_factors_monthly': 0, 'product_sales_factors_weekly': 0, 'product_sales_factors_yearly': 1, 'product_type': 'single', 'product_url': '/fr-fr/album/the-doctor-comfortably-numb-the-wall-work-in-progress-pt-2-1979-programme-1-band-demo-pink-floyd/r8yd7rtarhada', 'recording_information': '', 'relative_url': '/album/the-doctor-comfortably-numb-the-wall-work-in-progress-pt-2-1979-programme-1-band-demo-pink-floyd/r8yd7rtarhada', 'release_tags': ['remaster'], 'release_type': 'single', 'slug': 'the-doctor-comfortably-numb-the-wall-work-in-progress-pt-2-1979-programme-1-band-demo-pink-floyd', 'subtitle': 'Pink Floyd', 'tracks': {'offset': 0, 'limit': 500, 'total': 1, 'items': [{'maximum_bit_depth': 16, 'copyright': '© 2020 Pink Floyd Music Ltd. ℗ 2011 Pink Floyd Music Ltd., marketed and distributed by Parlophone Records Ltd., a Warner Music Group Company', 'performers': 'Bruce Johnston, Vocals - Toni Tennille, Vocals - Bob Ezrin, Producer - Brian Christian, Engineer - Rick Hart, Chief Engineer - David Gilmour, Composer, Producer, Keyboards, Vocals, Rap, Boy Soprano, Album Sequencer, Kora, Vocoder, Sequencer Programmer - Roger Waters, Composer, Producer, Keyboards, Vocals, Boy Soprano, Vocoder - Joe Chemay, Vocals - Pink Floyd, MainArtist - James Guthrie, Producer, Engineer, Masterer - Joel Plante, Masterer, MasteringEngineer - Phil Taylor, Engineer - Richard Wright, Organ, Music, Bass Pedals, Kora, Vocoder, SciFi - Nick Mason, Drums, Saw - JOHN MCCLURE, Engineer - Jim Haas, Vocals - Stan Farber, Backing Vocals - John Joyce, Vocals - Patrice Quef, Engineer - Nick Griffiths, Engineer', 'audio_info': {'replaygain_track_peak': 0.775177, 'replaygain_track_gain': 0.18}, 'performer': {'name': 'Pink Floyd', 'id': 38324}, 'work': None, 'composer': {'name': 'David Gilmour', 'id': 81808}, 'isrc': 'GBN9Y1100253', 'title': 'The Doctor (Comfortably Numb) [The Wall Work In Progress, Pt. 2, 1979] [Programme 1] [Band Demo] ', 'version': '2011 Remaster', 'duration': 195, 'parental_warning': False, 'track_number': 1, 'maximum_channel_count': 2, 'id': 97010485, 'media_number': 1, 'maximum_sampling_rate': 44.1, 'release_date_original': None, 'release_date_download': None, 'release_date_stream': None, 'purchasable': True, 'streamable': True, 'previewable': True, 'sampleable': True, 'downloadable': True, 'displayable': True, 'purchasable_at': 1649800800, 'streamable_at': 1649800800, 'hires': False, 'hires_streamable': False}]}, 'description': ''}
Arguments: ()
DEBUG:streamrip:{'maximum_bit_depth': 16, 'image': {'small': 'https://static.qobuz.com/images/covers/da/ha/r8yd7rtarhada_230.jpg', 'thumbnail': 'https://static.qobuz.com/images/covers/da/ha/r8yd7rtarhada_50.jpg', 'large': 'https://static.qobuz.com/images/covers/da/ha/r8yd7rtarhada_600.jpg', 'back': None}, 'media_count': 1, 'artist': {'image': None, 'name': 'Pink Floyd', 'id': 38324, 'albums_count': 324, 'slug': 'pink-floyd', 'picture': None}, 'artists': [{'id': 38324, 'name': 'Pink Floyd', 'roles': ['main-artist']}], 'upc': '0190295213732', 'released_at': 1330297200, 'label': {'name': 'Rhino - Parlophone', 'id': 146441, 'albums_count': 44, 'supplier_id': 5, 'slug': 'rhino-parlophone'}, 'title': 'The Doctor (Comfortably Numb) [The Wall Work In Progress, Pt. 2, 1979] [Programme 1] [Band Demo] ', 'qobuz_id': 97010484, 'version': '2011 Remaster', 'url': 'https://www.qobuz.com/fr-fr/album/the-doctor-comfortably-numb-the-wall-work-in-progress-pt-2-1979-programme-1-band-demo-pink-floyd/r8yd7rtarhada', 'duration': 195, 'parental_warning': False, 'popularity': 0, 'tracks_count': 1, 'genre': {'path': [112, 119], 'color': '#5eabc1', 'name': 'Rock', 'id': 119, 'slug': 'rock'}, 'maximum_channel_count': 2, 'id': 'r8yd7rtarhada', 'maximum_sampling_rate': 44.1, 'articles': [], 'release_date_original': '2012-02-27', 'release_date_download': '2012-02-27', 'release_date_stream': '2012-02-27', 'purchasable': True, 'streamable': True, 'previewable': True, 'sampleable': True, 'downloadable': True, 'displayable': True, 'purchasable_at': 1649800800, 'streamable_at': 1649800800, 'hires': False, 'hires_streamable': False, 'awards': [], 'goodies': [], 'area': None, 'catchline': '', 'composer': {'id': 573076, 'name': 'Various Composers', 'slug': 'various-composers', 'albums_count': 583621, 'picture': None, 'image': None}, 'created_at': 1593840514, 'genres_list': ['Pop/Rock', 'Pop/Rock→Rock'], 'period': None, 'copyright': '© 2020 Pink Floyd Music Ltd. marketed and distributed by Parlophone Records Limited, ℗ 2020 Pink Floyd Music Ltd', 'is_official': True, 'maximum_technical_specifications': '', 'product_sales_factors_monthly': 0, 'product_sales_factors_weekly': 0, 'product_sales_factors_yearly': 1, 'product_type': 'single', 'product_url': '/fr-fr/album/the-doctor-comfortably-numb-the-wall-work-in-progress-pt-2-1979-programme-1-band-demo-pink-floyd/r8yd7rtarhada', 'recording_information': '', 'relative_url': '/album/the-doctor-comfortably-numb-the-wall-work-in-progress-pt-2-1979-programme-1-band-demo-pink-floyd/r8yd7rtarhada', 'release_tags': ['remaster'], 'release_type': 'single', 'slug': 'the-doctor-comfortably-numb-the-wall-work-in-progress-pt-2-1979-programme-1-band-demo-pink-floyd', 'subtitle': 'Pink Floyd', 'tracks': {'offset': 0, 'limit': 500, 'total': 1, 'items': [{'maximum_bit_depth': 16, 'copyright': '© 2020 Pink Floyd Music Ltd. ℗ 2011 Pink Floyd Music Ltd., marketed and distributed by Parlophone Records Ltd., a Warner Music Group Company', 'performers': 'Bruce Johnston, Vocals - Toni Tennille, Vocals - Bob Ezrin, Producer - Brian Christian, Engineer - Rick Hart, Chief Engineer - David Gilmour, Composer, Producer, Keyboards, Vocals, Rap, Boy Soprano, Album Sequencer, Kora, Vocoder, Sequencer Programmer - Roger Waters, Composer, Producer, Keyboards, Vocals, Boy Soprano, Vocoder - Joe Chemay, Vocals - Pink Floyd, MainArtist - James Guthrie, Producer, Engineer, Masterer - Joel Plante, Masterer, MasteringEngineer - Phil Taylor, Engineer - Richard Wright, Organ, Music, Bass Pedals, Kora, Vocoder, SciFi - Nick Mason, Drums, Saw - JOHN MCCLURE, Engineer - Jim Haas, Vocals - Stan Farber, Backing Vocals - John Joyce, Vocals - Patrice Quef, Engineer - Nick Griffiths, Engineer', 'audio_info': {'replaygain_track_peak': 0.775177, 'replaygain_track_gain': 0.18}, 'performer': {'name': 'Pink Floyd', 'id': 38324}, 'work': None, 'composer': {'name': 'David Gilmour', 'id': 81808}, 'isrc': 'GBN9Y1100253', 'title': 'The Doctor (Comfortably Numb) [The Wall Work In Progress, Pt. 2, 1979] [Programme 1] [Band Demo] ', 'version': '2011 Remaster', 'duration': 195, 'parental_warning': False, 'track_number': 1, 'maximum_channel_count': 2, 'id': 97010485, 'media_number': 1, 'maximum_sampling_rate': 44.1, 'release_date_original': None, 'release_date_download': None, 'release_date_stream': None, 'purchasable': True, 'streamable': True, 'previewable': True, 'sampleable': True, 'downloadable': True, 'displayable': True, 'purchasable_at': 1649800800, 'streamable_at': 1649800800, 'hires': False, 'hires_streamable': False}]}, 'description': ''}
DEBUG:streamrip:{'meta': <TrackMetadata object -0xdde505aec1be5eb>, 'id': 97010485, 'part_of_tracklist': True}
DEBUG:streamrip:Sampling rate, bit depth = (16, 44100.0)
DEBUG:streamrip:Formatter: {'albumartist': 'Pink Floyd', 'title': 'The Doctor (Comfortably Numb) [The Wall Work In Progress, Pt. 2, 1979] [Programme 1] [Band Demo]  (2011 Remaster)', 'year': '2012', 'bit_depth': 16, 'sampling_rate': 44.1, 'container': 'FLAC', 'albumcomposer': 'Various Composers', 'id': 'r8yd7rtarhada'}
DEBUG:streamrip:Formatter keys: {albumartist}\{title} - [{year}] - {bit_depth}-{sampling_rate} - #{id}
DEBUG:streamrip:'albumartist'
DEBUG:streamrip:Pink Floyd
DEBUG:streamrip:1
DEBUG:streamrip:'title'
DEBUG:streamrip:The Doctor (Comfortably Numb) [The Wall Work In Progress, Pt. 2, 1979] [Programme 1] [Band Demo]  (2011 Remaster)
DEBUG:streamrip:1
DEBUG:streamrip:'year'
DEBUG:streamrip:2012
DEBUG:streamrip:1
DEBUG:streamrip:'bit_depth'
DEBUG:streamrip:16
DEBUG:streamrip:2
DEBUG:streamrip:'sampling_rate'
DEBUG:streamrip:44.1
DEBUG:streamrip:1
DEBUG:streamrip:'id'
DEBUG:streamrip:r8yd7rtarhada
DEBUG:streamrip:1

Downloading The Doctor (Comfortably Numb) [The Wall Work In Progress, Pt. 2, 1979] [Programme 1] [Band Demo]  (2011 Remaster) (Album)

Downloading cover art (large)
DEBUG:streamrip:Chosen cover url: https://static.qobuz.com/images/covers/da/ha/r8yd7rtarhada_600.jpg
DEBUG:streamrip:Downloading hires cover

  Stack trace:

  12  AppData\Local\Programs\Python\Python39\lib\site-packages\cleo\application.py:330 in run
       328│
       329│             try:
     → 330│                 exit_code = self._run(io)
       331│             except Exception as e:
       332│                 if not self._catch_exceptions:

  11  AppData\Local\Programs\Python\Python39\lib\site-packages\rip\cli.py:760 in _run
       758│             logger.addHandler(fh)
       759│
     → 760│         super()._run(io)
       761│
       762│     def create_io(self, input=None, output=None, error_output=None):

  10  AppData\Local\Programs\Python\Python39\lib\site-packages\cleo\application.py:425 in _run
       423│                 io.set_input(ArgvInput(argv))
       424│
     → 425│         exit_code = self._run_command(command, io)
       426│         self._running_command = None
       427│

   9  AppData\Local\Programs\Python\Python39\lib\site-packages\cleo\application.py:432 in _run_command
       430│     def _run_command(self, command: Command, io: IO) -> int:
       431│         if self._event_dispatcher is None:
     → 432│             return command.run(io)
       433│
       434│         # Bind before the console.command event,

   8  AppData\Local\Programs\Python\Python39\lib\site-packages\cleo\commands\base_command.py:118 in run
       116│         io.input.validate()
       117│
     → 118│         status_code = self.execute(io)
       119│
       120│         if status_code is None:

   7  AppData\Local\Programs\Python\Python39\lib\site-packages\cleo\commands\command.py:85 in execute
        83│
        84│         try:
     →  85│             return self.handle()
        86│         except KeyboardInterrupt:
        87│             return 1

   6  AppData\Local\Programs\Python\Python39\lib\site-packages\rip\cli.py:124 in handle
       122│
       123│         if len(core) > 0:
     → 124│             core.download()
       125│         elif not urls and path is None:
       126│             self.line("Must pass arguments. See rip url -h.")

   5  AppData\Local\Programs\Python\Python39\lib\site-packages\rip\core.py:313 in download
       311│
       312│             try:
     → 313│                 item.download(**arguments)
       314│                 for item_id in item.downloaded_ids:
       315│                     self.db.add([item_id])

   4  AppData\Local\Programs\Python\Python39\lib\site-packages\streamrip\media.py:1163 in download
       1161│         :param kwargs:
       1162│         """
     → 1163│         self._prepare_download(**kwargs)
       1164│         if kwargs.get("conversion", False):
       1165│             has_conversion = kwargs["conversion"]["enabled"]

   3  AppData\Local\Programs\Python\Python39\lib\site-packages\streamrip\media.py:1529 in _prepare_download
       1527│
       1528│         cover_path = (
     → 1529│             _choose_and_download_cover(
       1530│                 self.cover_urls,
       1531│                 kwargs.get("embed_cover_size", "large"),

   2  AppData\Local\Programs\Python\Python39\lib\site-packages\streamrip\media.py:2363 in _choose_and_download_cover
       2361│     if keep_hires_cover and not os.path.exists(hires_cov_path):
       2362│         logger.debug("Downloading hires cover")
     → 2363│         _cover_download(cover_urls["original"], hires_cov_path)
       2364│
       2365│     cover_size = os.path.getsize(temp_cover_path)

   1  AppData\Local\Programs\Python\Python39\lib\site-packages\streamrip\media.py:2316 in _cover_download
       2314│
       2315│ def _cover_download(url: str, path: str):
     → 2316│     _quick_download(url, path, style("Cover", fg="blue"))
       2317│
       2318│

  FileNotFoundError

  [Errno 2] No such file or directory: 'D:\\Q\\Pink Floyd\\The Doctor (Comfortably Numb) [The Wall Work In Progress, Pt. 2, 1979] [Programme 1] [Band Demo]  (2011 Remas...\\cover.jpg'

  at AppData\Local\Programs\Python\Python39\lib\site-packages\streamrip\media.py:2310 in _quick_download
      2306│     raise NotImplementedError(source)
      2307│
      2308│
      2309│ def _quick_download(url: str, path: str, desc: str = None):
    → 2310│     with open(path, "wb") as file:
      2311│         for chunk in tqdm_stream(DownloadStream(url), desc=desc):
      2312│             file.write(chunk)
      2313│
      2314│

If this was unexpected, please open a Bug Report at https://github.com/nathom/streamrip/issues/new/choose

C:\>

Config File

[downloads]
# Folder where tracks are downloaded to
folder = "D:\\Q"
# Put Qobuz albums in a 'Qobuz' folder, Tidal albums in 'Tidal' etc.
source_subdirectories = false

[downloads.concurrency]
# Download (and convert) tracks all at once, instead of sequentially. 
# If you are converting the tracks, or have fast internet, this will 
# substantially improve processing speed.
enabled = true
# The maximum number of tracks to download at once
# If you have very fast internet, you will benefit from a higher value,
# A value that is too high for your bandwidth may cause slowdowns
max_connections = 3

[qobuz]
# 1: 320kbps MP3, 2: 16/44.1, 3: 24/<=96, 4: 24/>=96
quality = 4
# This will download booklet pdfs that are included with some albums
download_booklets = true

email = "hulpia.wim@gmail.com"
# This is an md5 hash of the plaintext password
password = "ba690def01a020800c42744dfe29512a"
# Do not change
app_id = "950096963"
# Do not change
secrets = ["10b251c286cfbf64d6b7105f253d9a2e", "979549437fcc4a3faad4867b5cd25dcb"]

[tidal]
# 0: 256kbps AAC, 1: 320kbps AAC, 2: 16/44.1 "HiFi" FLAC, 3: 24/44.1 "MQA" FLAC
quality = 3
# This will download videos included in Video Albums.
download_videos = true

# Do not change any of the fields below
user_id = 173848888
country_code = "BE"
access_token = "eyJraWQiOiJ2OU1GbFhqWSIsImFsZyI6IkVTMjU2In0.eyJ0eXBlIjoibzJfYWNjZXNzIiwidWlkIjoxNzM4NDg4ODgsInNjb3BlIjoid19zdWIgcl91c3Igd191c3IiLCJnVmVyIjowLCJzVmVyIjowLCJjaWQiOjIyMTksImV4cCI6MTYzOTYxNTE4MSwic2lkIjoiM2ZlMWRlM2UtNmU5ZS00MzM0LTg1MDYtY2JhZjViYmIzNDRhIiwiaXNzIjoiaHR0cHM6Ly9hdXRoLnRpZGFsLmNvbS92MSJ9.jq55DJZkLdF098iC_kTBOERxpKJ1NNjArN3OBbZ-snxl-MEzlxGTyBFc5aIn3diFb1ueTIoXlz1hyLG8_Pys0Q"
refresh_token = "eyJraWQiOiJoUzFKYTdVMCIsImFsZyI6IkVTNTEyIn0.eyJ0eXBlIjoibzJfcmVmcmVzaCIsInVpZCI6MTczODQ4ODg4LCJzY29wZSI6Indfc3ViIHJfdXNyIHdfdXNyIiwiY2lkIjoyMjE5LCJzVmVyIjowLCJnVmVyIjowLCJpc3MiOiJodHRwczovL2F1dGgudGlkYWwuY29tL3YxIn0.ALLcBr4ZahwJ6-15UsgicPVdV9qeuwqdzdkM7usWUpSmWQ_fgIpRdGCrxGXtAjHwvDk56kCOP3erN27VJUjvjU-GAPd-iq4Yn51BCkn0xUsnHaR0Il5y3ITaiVn-hSppeTdj3CpCYgeVPRipFLcjxFYBbvSreplAgPWxldzyc9shfjbS"
# Tokens last 1 week after refresh. This is the Unix timestamp of the expiration
# time. If you haven't used streamrip in more than a week, you may have to log
# in again using `rip config --tidal`
token_expiry = 1639615182.3192697

[deezer]
# 0, 1, or 2
# This only applies to paid Deezer subscriptions. Those using deezloader
# are automatically limited to quality = 1
quality = 2
# An authentication cookie that allows streamrip to use your Deezer account
# See https://github.com/nathom/streamrip/wiki/Finding-Your-Deezer-ARL-Cookie
# for instructions on how to find this
arl = ""
# This allows for free 320kbps MP3 downloads from Deezer
# If an arl is provided, deezloader is never used
use_deezloader = true
# This warns you when the paid deezer account is not logged in and rip falls
# back to deezloader, which is unreliable
deezloader_warnings = true

[soundcloud]
# Only 0 is available for now
quality = 0
# This changes periodically, so it needs to be updated
client_id = ""
app_version = ""

[youtube]
# Only 0 is available for now
quality = 0
# Download the video along with the audio
download_videos = false
# The path to download the videos to
video_downloads_folder = ""

# This stores a list of item IDs so that repeats are not downloaded.

[database.downloads]
enabled = true
path = "C:\\Users\\hulpi\\AppData\\Local\\streamrip\\streamrip\\downloads.db"

# If a download fails, the item ID is stored here. Then, `rip repair` can be
# called to retry the downloads

[database.failed_downloads]
enabled = true
path = "C:\\Users\\hulpi\\AppData\\Local\\streamrip\\streamrip\\failed_downloads.db"

# Convert tracks to a codec after downloading them.

[conversion]
enabled = false
# FLAC, ALAC, OPUS, MP3, VORBIS, or AAC
codec = "ALAC"
# In Hz. Tracks are downsampled if their sampling rate is greater than this. 
# Value of 48000 is recommended to maximize quality and minimize space
sampling_rate = 48000
# Only 16 and 24 are available. It is only applied when the bit depth is higher
# than this value.
bit_depth = 24
# Only applicable for lossy codecs
lossy_bitrate = 320

# Filter a Qobuz artist's discography. Set to 'true' to turn on a filter.

[filters]
# Remove Collectors Editions, live recordings, etc.
extras = false
# Picks the highest quality out of albums with identical titles.
repeats = false
# Remove EPs and Singles
non_albums = false
# Remove albums whose artist is not the one requested
features = true
# Skip non studio albums
non_studio_albums = false
# Only download remastered albums
non_remaster = false

[artwork]
# Write the image to the audio file
embed = true
# The size of the artwork to embed. Options: thumbnail, small, large, original.
# "original" images can be up to 30MB, and may fail embedding. 
# Using "large" is recommended.
size = "large"
# Both of these options limit the size of the embedded artwork. If their values
# are larger than the actual dimensions of the image, they will be ignored.
# If either value is -1, the image is left untouched.
max_width = -1
max_height = -1
# Save the cover image at the highest quality as a seperate jpg file
keep_hires_cover = true

[metadata]
# Sets the value of the 'ALBUM' field in the metadata to the playlist's name. 
# This is useful if your music library software organizes tracks based on album name.
set_playlist_to_album = false
# Replaces the original track's tracknumber with it's position in the playlist
new_playlist_tracknumbers = true
# The following metadata tags won't be applied
# See https://github.com/nathom/streamrip/wiki/Metadata-Tag-Names for more info
exclude = []

# Changes the folder and file names generated by streamrip.

[filepaths]
# Create folders for single tracks within the downloads directory using the folder_format
# template
add_singles_to_folder = false

# Available keys: "albumartist", "title", "year", "bit_depth", "sampling_rate",
# "container", "id", and "albumcomposer"

folder_format = "{albumartist}\\{title} - [{year}] - {bit_depth}-{sampling_rate} - #{id}"

# Available keys: "tracknumber", "artist", "albumartist", "composer", "title",
# and "albumcomposer"

track_format = "{tracknumber}. {artist} - {title}"

# Only allow printable ASCII characters in filenames.
restrict_characters = false

# Last.fm playlists are downloaded by searching for the titles of the tracks

[lastfm]
# The source on which to search for the tracks.
source = "qobuz"
# If no results were found with the primary source, the item is searched for 
# on this one.
fallback_source = "deezer"

[theme]
# Options: "dainty" or "plain"
progress_bar = "dainty"

[misc]
# Metadata to identify this config file. Do not change.
version = "1.9.2"

Operating System

Win (10 and 11)

streamrip version

1.9.5

Screenshots and recordings

No response

Additional context

No response

fancellu commented 1 year ago

Ditto. e.g. try ripping https://deezer.page.link/qCypJkAcAZoJTv3G7

Wim1975 commented 1 year ago

Found it...

It's in media.py I replaced

if len(formatted_folder) > 120:
            formatted_folder = f"{formatted_folder[:120]}..."

with

if len(formatted_folder) > 250:
            formatted_folder = f"{formatted_folder[:250]}"

And it works... I will test if this works, as I haven't checked the rest of the code and there might be other issues increasing the value and removing the three dots, but I could download an album that failed before, so fingers crossed !!

fancellu commented 1 year ago

Works for me too.

popeye2468 commented 1 year ago

where would this be located on windows please

fancellu commented 1 year ago

For me C:\Users\[username]\AppData\Local\Programs\Python\Python38\Lib\site-packages\streamrip

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.