jjjake/internetarchive

mtime reporting as "null"

Closed this issue · 2 comments

I would like to return only the mtime field, but when I use the recommended method, the result is null every time. Is this expected or is there another way I can pull this information from a record without seeing all of the fields?

Sample code

ia metadata cunytv_UMA02799 | jq '.metadata.mtime'

@metacynicv2 mtime is a value located in file metadata (i.e. not under the top-level metadata key, but the top-level files key). Note that files is a list as well, as opposed to a dict like metadata. You will have to treat it differently than you would accessing keys in metadata. The following command will give you the name and mtime of every file in the item:

ia metadata cunytv_UMA02799 | jq -r '.files[] | [.name, .mtime] | @tsv'

And, this is an example of getting the mtime for a specific file:

» ia metadata cunytv_UMA02799 | jq -r '.files[] | select(.name == "cunytv_UMA02799.thumbs/UMA02799_003358.jpg").mtime'
1651876584

Hope this helps, please let me know if you have any other questions!

Perfect! Thank you for the speedy, helpful reply.