Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An unexpected error occurred! #96

Open
2V3EvG4LMJFdRe opened this issue Aug 6, 2024 · 0 comments
Open

An unexpected error occurred! #96

2V3EvG4LMJFdRe opened this issue Aug 6, 2024 · 0 comments

Comments

@2V3EvG4LMJFdRe
Copy link

2V3EvG4LMJFdRe commented Aug 6, 2024

Running as part of an automated workflow:

# Function to extract album name from KHInsider URL
extract_album_name() {
    local url="$1"
    if [[ "$url" =~ album/([^/]+) ]]; then
        echo "${BASH_REMATCH[1]}"
    else
        echo ""
    fi
}

# Function to call downloader
            album_name=$(extract_album_name "$1")
            download_dir=~/Downloads/KHInsider/"${album_name}"
            mkdir -p "${download_dir}"
            /Library/Frameworks/Python.framework/Versions/3.12/bin/khinsider.py "$1" "${download_dir}/"

I got the following error:

An unexpected error occurred! If it isn't too much to ask, please report to https://github.com/obskyr/khinsider/issues.
Attach the following error message:

Downloading to "/Users/redacted/Downloads/KHInsider/leaf-arrange-sound-track-wasshoy-lfcd-0010/".
Getting song list...
[<File: https://eta.vgmtreasurechest.com/soundtracks/leaf-arrange-sound-track-wasshoy-lfcd-0010/LFCD-0010_01.jpg>, <File: https://eta.vgmtreasurechest.com/soundtracks/leaf-arrange-sound-track-wasshoy-lfcd-0010/LFCD-0010_02.jpg>, <File: https://eta.vgmtreasurechest.com/soundtracks/leaf-arrange-sound-track-wasshoy-lfcd-0010/LFCD-0010_03.jpg>, <File: https://eta.vgmtreasurechest.com/soundtracks/leaf-arrange-sound-track-wasshoy-lfcd-0010/LFCD-0010_04.jpg>, <File: https://eta.vgmtreasurechest.com/soundtracks/leaf-arrange-sound-track-wasshoy-lfcd-0010/LFCD-0010_05.jpg>, <File: https://eta.vgmtreasurechest.com/soundtracks/leaf-arrange-sound-track-wasshoy-lfcd-0010/LFCD-0010_06.jpg>, <File: https://eta.vgmtreasurechest.com/soundtracks/leaf-arrange-sound-track-wasshoy-lfcd-0010/LFCD-0010_07.jpg>, <File: https://eta.vgmtreasurechest.com/soundtracks/leaf-arrange-sound-track-wasshoy-lfcd-0010/LFCD-0010_08.jpg>, <File: https://eta.vgmtreasurechest.com/soundtracks/leaf-arrange-sound-track-wasshoy-lfcd-0010/LFCD-0010_09.jpg>]
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/bin/khinsider.py", line 681, in <module>
    sys.exit(doIt())
  File "/Library/Frameworks/Python.framework/Versions/3.12/bin/khinsider.py", line 628, in doIt
    success = download(soundtrack, outPath, formatOrder=formatOrder, verbose=True)
  File "/Library/Frameworks/Python.framework/Versions/3.12/bin/khinsider.py", line 457, in download
    return soundtrack.download(path, makeDirs, formatOrder, verbose)
  File "/Library/Frameworks/Python.framework/Versions/3.12/bin/khinsider.py", line 371, in download
    if not friendlyDownloadFile(file, path, fileNumber, totalFiles, verbose):
  File "/Library/Frameworks/Python.framework/Versions/3.12/bin/khinsider.py", line 220, in friendlyDownloadFile
    unicodePrint("Downloading {}: {}{}...".format(numberStr, filename, byTheWay))
  File "/Library/Frameworks/Python.framework/Versions/3.12/bin/khinsider.py", line 151, in unicodePrint
    print(*args, **kwargs)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 22-27: ordinal not in range(128)
2024-08-06 11:07:15 - Error during KHInsider download

The reason I have such a convoluted calling is because I'd like to specify a default download path for the script, but the function of specifying the path doesn't create a subfolder for the given album. Therefore, simply stating "~/Downloads/KHInsider/" as output path puts all the album's mp3 on that folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant