E
E
Elisey Vlasenko2020-05-13 05:56:44
Python
Elisey Vlasenko, 2020-05-13 05:56:44

How to solve error when writing metadata to file using eyeD3?

I created a script that will download all music from VK to my computer. Everything worked out, but here came some problems with eyeD3.

I'll show you the code. Anyone who knows how this is solved, please answer
(the code below is not from the script, but it is similar and gives exactly the same error as the main script)

Code:

from eyed3 import id3
import requests


def load_mp3(file_n):
    tag = id3.Tag()
    tag.parse(file_n)
    return tag


file_name = "test song - test.mp3"
path = "/home/USER/path/to/file/"

url = "https://cs1-74v4.vkuseraudio.net/p10/151f34219b8183.mp3?extra" \
      "=4njs8U_XdSnBWGryb0LQhgJjbyi3riqXk9Rb7VaC00STG9gv_hCURT3oSvd63H1fSS0pgRVz_xfqEgX19qvtRbOJ205Lkg9cGl" \
      "-UuGydHyCdwfaqdFqUpbEqV021sUjh2PxcAYkiDX05GnP9_09IEvgXzVc "

with open(path + file_name, "wb") as f:
    f.write(requests.get(url).content)

    file = load_mp3(path + file_name)
    file.title = "Name"
    file.artist = "Author"
    file.track_num = "228"

    file.save()


Mistake:

Traceback (most recent call last):
  File "/home/homus/PycharmProjects/vk_bot/TEST5.py", line 26, in <module>
    file.save()
  File "/home/homus/PycharmProjects/vk_bot/venv/lib/python3.8/site-packages/eyed3/id3/tag.py", line 897, in save
    raise NotImplementedError("Unable to write ID3 v2.2")
NotImplementedError: Unable to write ID3 v2.2


if that i'm sitting on kubuntu

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2020-05-13
@homus32

An exception NotImplementedError("Unable to write ID3 v2.2")means that this library cannot write tags for the version used in the source file. Try to specify a parameter versionin the method callsave

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question