无需下载整个文件即可读取 ID3 标签
是否可以读取 MP3 文件的 ID3 标签(持续时间、艺术家、标题...)而无需下载整个文件?
我做了一些测试,只需下载 MP3 文件的几个字节就可以获得艺术家和标题标签。但我不确定是否可以获取持续时间和其他标签。
谢谢。
Is it possible to read ID3 tags (Duration, Artist, title...) of an MP3 file without having to download the whole file?
I did a few tests and I was able to get the Artist and title tags with only downloading a few bytes of the MP3 file.. but I'm not sure if it's possible for Duration and other tags..
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我刚刚发现 ffmpeg 可以读取远程文件的 ID3 标签,而无需下载整个文件:
I just find out that ffmpeg can read ID3 tags of a remote file without having to download the whole file:
取决于您想读取 ID3v1 还是 ID3v2。 ID3v1 始终位于文件末尾,因此如果您有兴趣阅读,请不要阅读。 ID3v2通常出现在文件的开头,但不能保证这一点。
因此,如果您不想意外错过任何标签,则必须读取整个文件。 ID3v1问题可以通过从文件末尾读取来解决,但这对ID3v2没有帮助。
Depends on if you want to read ID3v1 or ID3v2. ID3v1 is always at the end of the file, so if you are interested in reading that no go. ID3v2 usually occurs at the start of the file, but there's no guarantee for that.
So if you don't want to accidentally miss any tags, you have to read the whole file. The ID3v1 problem can be solved by reading from the end of the file, but that doesn't help with ID3v2.