Dniel97 / orpheusdl-beatport

An OrpheusDL Beatport module
25 stars 10 forks source link

Lossless Support #5

Open zhordon opened 3 days ago

zhordon commented 3 days ago

Now that Lossless Streaming support has been added to Beatport Professional, is it possible to get an update for the module to support this output?

https://support.beatport.com/hc/en-us/articles/27893825412500-What-is-the-audio-quality-like-with-Beatport-Streaming

image

zhordon commented 3 days ago

In an update to this after switching the quality to Lossless. Files download accordingly, however it is downloading .FLAC into a .m4a container. Once you replace .m4a to .flac the track works as intended.

With that being said, the codec line doesn't display the correct information as it still believes it's a 256 AAC file.

=== Downloading track Curvism (Original Mix) (503008) ===
        Album: Minimal Pop EP (98809)
        Artists: Balthazar, JackRock, PFS 303 (20286)
        Release year: 2008
        Duration: 06m:00s
        Service: Beatport
        Codec: AAC-LC, bitrate: 256kbps, sample rate: 44.1kHz

        Downloading track file
        100%|██████████████████████████████| 29.8M/29.8M [00:01<00:00, 28.6MB/s]
        Downloading artwork
        Tagging file
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/mutagen/mp4/__init__.py", line 1053, in load
    moov = atoms[b"moov"]
           ~~~~~^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/mutagen/mp4/_atom.py", line 188, in __getitem__
    raise KeyError("%r not found" % names[0])
KeyError: "b'moov' not found"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/Music/OrpheusDL/orpheus.py", line 225, in <module>
    main()
  File "/Users/Music/OrpheusDL/orpheus.py", line 220, in main
    orpheus_core_download(orpheus, media_to_download, tpm, sdm, path)
  File "/Users/Music/OrpheusDL/orpheus/core.py", line 399, in orpheus_core_download
    downloader.download_track(media_id, extra_kwargs=media.extra_kwargs)
  File "/Users/Music/OrpheusDL/orpheus/music_downloader.py", line 625, in download_track
    tag_file(track_location, cover_temp_location if self.global_settings['covers']['embed_cover'] else None,
  File "/Users/Music/OrpheusDL/orpheus/tagging.py", line 46, in tag_file
    tagger = EasyMP4(file_path)
             ^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/mutagen/_file.py", line 48, in __init__
    self.load(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/mutagen/_util.py", line 156, in wrapper
    return func(self, h, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/mutagen/mp4/__init__.py", line 1184, in load
    self.info.load(atoms, fileobj)
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/mutagen/_util.py", line 185, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/mutagen/mp4/__init__.py", line 1055, in load
    raise MP4StreamInfoError("not a MP4 file")
mutagen.mp4.MP4StreamInfoError: not a MP4 file