OrfiTeam / OrpheusDL

586 stars 74 forks source link

Songs with weird/long names don't save properly #6

Closed forhku closed 1 month ago

forhku commented 2 years ago

Downloading the 5th track on Flume's mixtape seems to screw up orpheus. The song title is ╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌

Module used: https://github.com/Dniel97/orpheusdl-tidal Tidal link: https://listen.tidal.com/album/105501517 OS: Ubuntu (the Zorin OS fork to be specific.)

        Track 5/17
        === Downloading track ╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌ (105501522) ===
                Artists: Flume (4060648)
                Release year: 2019
                Codec: FLAC, bit depth: 16bit, sample rate: 44.1kHz

                Downloading track file
                100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:11<00:00,  1.17s/it]
                Warning: Track download failed: [Errno 36] File name too long: 'temp/a741026835034e18026cf1549ecfe575.flac' -> './downloads/Flume - Hi This Is Flume (Mixtape)/05. Flume - ╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌.flac'
        === Track 105501522 failed ===

Other tracks with "normal" names downloads normally and properly.

Dniel97 commented 2 years ago

Can you update OrpheusDL any try it again? If the error still occurs, try changing the download_path in the settings.json file to a path which isn't that long.

forhku commented 2 years ago

Can you update OrpheusDL any try it again? If the error still occurs, try changing the download_path in the settings.json file to a path which isn't that long.

Updated and still fails, logs below

xxxx@xxxx-xxxx:~/Desktop/git/orpheusdl$ git pull
remote: Enumerating objects: 28, done.
remote: Counting objects: 100% (28/28), done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 20 (delta 15), reused 5 (delta 0), pack-reused 0
Unpacking objects: 100% (20/20), 6.64 KiB | 566.00 KiB/s, done.
From https://github.com/yarrm80s/orpheusdl
   922cc8f..ab2a3ee  master     -> origin/master
Updating 922cc8f..ab2a3ee
Fast-forward
 README.md                   | 118 +++++++++++++++++++++++++++++++++++++++-----
 orpheus/core.py             |   3 +-
 orpheus/music_downloader.py |  71 ++++++++++++++++++--------
 utils/models.py             |   1 -
 utils/utils.py              |  11 +++++
 5 files changed, 171 insertions(+), 33 deletions(-)

...

xxxx@xxxx-xxxx:~/Desktop/git/orpheusdl$ orph https://tidal.com/browse/track/105501522

   ____             _                    _____  _      
  / __ \           | |                  |  __ \| |     
 | |  | |_ __ _ __ | |__   ___ _   _ ___| |  | | |     
 | |  | | '__| '_ \| '_ \ / _ \ | | / __| |  | | |     
 | |__| | |  | |_) | | | |  __/ |_| \__ \ |__| | |____ 
  \____/|_|  | .__/|_| |_|\___|\__,_|___/_____/|______|
             | |                                       
             |_|                                       

    Refreshing token successful
=== Downloading track ╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌ (105501522) ===
        Album: Hi This Is Flume (Mixtape) (105501517)
        Artists: Flume (4060648)
        Release year: 2019
        Service: Tidal
        Codec: FLAC, bit depth: 16bit, sample rate: 44.1kHz

        Downloading track file
        100%|███████████████████████████████████| 10/10 [00:03<00:00,  2.87it/s]
        Warning: Track download failed: [Errno 36] File name too long: 'temp/fa0ca626ba9e6248c50ffcb1fff69889.flac' -> 'downloads/Flume - ╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌.flac'
=== Track 105501522 failed ===

Although I have temporarily "fixed" it by removing the song title on settings.json > global > formatting and renaming it to a shorter file name later on.

Maybe have a 15 character limit on audio file names?

OrfiDev commented 2 years ago

Oh, what's the character limit then? Maybe it's based on bytes and not characters and that's causing the issue to stay. Or maybe the limit could be exactly one too high or something... well anyways more testing by adjusting the limit Daniel added until it doesn't break is needed

Dniel97 commented 2 years ago

Keep in mind that the complete path from all parent folders should not exceed a certain length too, what is the complete path? Use pwd to get the complete path.

forhku commented 2 years ago

Oh, what's the character limit then? Maybe it's based on bytes and not characters and that's causing the issue to stay. Or maybe the limit could be exactly one too high or something... well anyways more testing by adjusting the limit Daniel added until it doesn't break is needed

According to Wikipedia the file name length for ext4 (filesystem my OS uses) is 255 bytes. Interestingly, Flume's 5th track ╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂... is 319 bytes, which is over 255. Have I found the culprit?

Keep in mind that the complete path from all parent folders should not exceed a certain length too, what is the complete path? Use pwd to get the complete path.

I used pwd on orpheus' download folder and got /home/xxxxx/Desktop/git/orpheusdl/downloads (changed my name to xs) and adding the invalid filename mentioned above, the full path would be /home/xxxxx/Desktop/git/orpheusdl/downloads/Flume - ╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌╫§╜φ°⌂▌.flac

Dniel97 commented 1 month ago

Fixed by #27.