I want to write a program building a database of my audio file in google drive. The language is python. Does anyone know of a method to retrieve audio metadata of file from google drive api? What I want to do is using the id of the file from google drive api,I want to load the file into memory and use Mutagen to load the metadata. My problem is how to load the file from google drive api. If possible also, I would like to load only a part of the file containing the metadata but not the audio itself. From my understanding also, I am not sure it mutagen can load file already in memory.
Asked
Active
Viewed 661 times
0
-
I think it is still possible to use the drive api. I am trying to partially download the file using drive api and use some python library to extract the metadata. I was planning to do it myself and post a code here afterward. But if you want to close it , that is fine. – Calcius Apr 11 '17 at 03:36
-
Whether you use Python, Java, Javascript, Objective-C, all the metadata that Drive can give you is listed [here](https://developers.google.com/drive/v3/reference/files), regardless of the language you'll use to fetch them. So if the information is not there, Drive API is not the tool for your task. – ReyAnthonyRenacia Apr 11 '17 at 03:39
-
I am not downloading these drive metadata. I am downloading some bytes at the beginning of the real files. The audio metadata are there. – Calcius Apr 11 '17 at 03:48
-
Ok so you found the metadata that you want from the link I gave you? Good, that means, you can fetch it. What are the names of the properties? I'm curious. – ReyAnthonyRenacia Apr 11 '17 at 03:53
-
No, your link did not help at all. These metadata of yours are useless. My solution is to partially download my mp3 file . Not the whole mp3 but some bytes at the beginning. Load that in the buffer. Then I use a python library to extract the audio id3 metadata from that file. What I haven't solved yet is how to download only partial bytes of the file . And how to use python to extract id3 metadata from the buffer in memory without saving the file into local disk. – Calcius Apr 11 '17 at 03:59
2 Answers
0
You can obtain the metadata of a file from your Google Drive using Files.get. You can try it here in the API Explorer. In the fields section, click "Use fields editor" and tick "all" so it returns all info about the file.
This is what Drive has to offer. Some audio metadata may not be available as Drive was not built for that niche.

ReyAnthonyRenacia
- 17,219
- 5
- 37
- 56
0
Nop. It's not possible using the Drive API.
Metadata in files.get() is the best you can get from the API. For accessing further information about a file in Drive like audio metadata, you will have to download the entire file and proceed with the local copy.

Divins Mathew
- 2,908
- 4
- 22
- 34