Editing MP3 metadata in a file-like object in Python?

We create MP3 files on the fly in Python and must edit the ID3 headers in memory using a file object.

All ID3 libraries on PyPI seem to require passing the file system path as a string. I find it pretty frustrating!

Writing our generated MP3 disc to disc (or ramdisk) simply to add ID3 tags is unacceptable for a number of reasons, especially for performance.

Given the many ID3 libraries, is there an ID3 library that just works with file-like objects?

+3
source share
4 answers

, , . , -, MP3- python. , .

0

, , mutagen, MP3 , - ( "filething" ).

https://mutagen.readthedocs.io/en/latest/user/filelike.html:

, FileType Metadata, , , StringIO (BytesIO Python 3), , .

MP3("myfile.mp3")
MP3(myfileobj)
+2

AFAIR . , .

In addition, you might consider storing them temporarily on a file system such as tmpfs (ramdisk).

-1
source

Source: https://habr.com/ru/post/1719561/


All Articles