beetbox / mediafile

elegant audio file tagging
http://mediafile.readthedocs.io/
MIT License
97 stars 24 forks source link

Support filelike objects, not only pathes #35

Closed JuniorJPDJ closed 2 years ago

JuniorJPDJ commented 3 years ago

Hi! I'm trying to use this library with remote files defined as file-likes in python. mutagen supports file-like interface, why tho mediafile doesn't? Docs say it needs local file path as first argument.

sampsyo commented 3 years ago

Sounds like a reasonable addition! A PR would be welcome.

JuniorJPDJ commented 3 years ago

It works, would just need rename of path to filelike

sampsyo commented 3 years ago

OK! Updates to the naming and the docs would still be welcome in a PR. (But we wouldn't want to call it filelike because it can also be a path. :smiley:)

JuniorJPDJ commented 3 years ago

Nvm, saving doesn't work if using filelike.

JuniorJPDJ commented 3 years ago

What if we use loadfile decorator from mutagen itself and provide filething argument? MediaFile would be usable the same as mutagen.File itself.

If you are OK with this I can try doing it.

sampsyo commented 3 years ago

Sure! That seems worth a shot. Thanks for looking into it!