llistochek / yandex-music-downloader

Загрузчик музыки с сервиса Яндекс.Музыка
MIT License
248 stars 22 forks source link

Ошибка кодировки символов #82

Open Ruventium opened 1 day ago

Ruventium commented 1 day ago

1. Примерно раз в 100-200 треков возникает подобные ошибки

File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\Ruventium\AppData\Local\Programs\Python\Python313\Scripts\yandex-music-downloader.exe\__main__.py", line 7, in <module>
    sys.exit(main())
             ~~~~^^
  File "C:\Users\Ruventium\AppData\Local\Programs\Python\Python313\Lib\site-packages\ymd\cli.py", line 291, in main
    core.download_track(
    ~~~~~~~~~~~~~~~~~~~^
        track_info=downloadable,
        ^^^^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
        compatibility_level=args.compatibility_level,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\Ruventium\AppData\Local\Programs\Python\Python313\Lib\site-packages\ymd\core.py", line 243, in download_track
    f.write(lrc_lyrics)
    ~~~~~~~^^^^^^^^^^^^
  File "C:\Users\Ruventium\AppData\Local\Programs\Python\Python313\Lib\encodings\cp1251.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
           ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode character '\xe1' in position 892: character maps to <undefined>
UnicodeEncodeError: 'charmap' codec can't encode character '\xe9' in position 1022: character maps to <undefined>
UnicodeEncodeError: 'charmap' codec can't encode character '\u03c0' in position 164: character maps to <undefined>
UnicodeEncodeError: 'charmap' codec can't encode characters in position 36-45: character maps to <undefined>

2. Так же разок вылезала такая ошибка

 File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\Ruventium\AppData\Local\Programs\Python\Python313\Scripts\yandex-music-downloader.exe\__main__.py", line 7, in <module>
    sys.exit(main())
             ~~~~^^
  File "C:\Users\Ruventium\AppData\Local\Programs\Python\Python313\Lib\site-packages\ymd\cli.py", line 291, in main
    core.download_track(
    ~~~~~~~~~~~~~~~~~~~^
        track_info=downloadable,
        ^^^^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
        compatibility_level=args.compatibility_level,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\Ruventium\AppData\Local\Programs\Python\Python313\Lib\site-packages\ymd\core.py", line 267, in download_track
    set_tags(target_path, track, text_lyrics, cover, compatibility_level)
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Ruventium\AppData\Local\Programs\Python\Python313\Lib\site-packages\ymd\core.py", line 213, in set_tags
    tag.save()
    ~~~~~~~~^^
  File "C:\Users\Ruventium\AppData\Local\Programs\Python\Python313\Lib\site-packages\mutagen\_util.py", line 185, in wrapper
    return func(*args, **kwargs)
  File "C:\Users\Ruventium\AppData\Local\Programs\Python\Python313\Lib\site-packages\mutagen\_util.py", line 156, in wrapper
    return func(self, h, *args, **kwargs)
  File "C:\Users\Ruventium\AppData\Local\Programs\Python\Python313\Lib\site-packages\mutagen\flac.py", line 859, in save
    self._save(filething, self.metadata_blocks, deleteid3, padding)
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Ruventium\AppData\Local\Programs\Python\Python313\Lib\site-packages\mutagen\flac.py", line 875, in _save
    data = MetadataBlock._writeblocks(
        metadata_blocks, available, content_size, padding)
  File "C:\Users\Ruventium\AppData\Local\Programs\Python\Python313\Lib\site-packages\mutagen\flac.py", line 153, in _writeblocks
    data += cls._writeblock(block)
            ~~~~~~~~~~~~~~~^^^^^^^
  File "C:\Users\Ruventium\AppData\Local\Programs\Python\Python313\Lib\site-packages\mutagen\flac.py", line 136, in _writeblock
    raise error("block is too long to write")
mutagen.flac.error: block is too long to write

оффтоп - прошу добавить информацию для поддержки автора (хотя бы какой-нибудь крипто кошелек)