Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Optimize metadata support for OS X #8089
Comments
|
This AppleScript successfully copies the xattr user.dublincore.description to the Finder/Spotlight comment. |
|
This still hasn’t been changed. Can someone please get on this? It would make a world of difference when sorting through files. |
|
Apparently
|
|
I finally figured it out. All of the metadata appears to be dropped when I use MP4, but when outputting to Matroska the metadata is preserved just fine. |
|
Extended attributes should be independent of file types. @Saklad5 could you explain more about "use MP4"? For example the command you use and the environment (OS version, ffmpeg/avconv version, etc.) |
|
output.txt |
|
I'm glad that my feature request got attention after some time. In my next spare time I'm going to test the implementation and will give some feedback probably. |
|
By the way, there's a request for |
|
|
|
Any progress on this issue? |
|
I downloaded http://yt-dl.org/downloads/latest/youtube-dl with Safari. There are some extended attributes associated with the downloaded file:
However, mdls can't read it:
Using Sierra 10.12.1. Is there other way to check whether |
|
|
Metadata functions in youtube-dl
youtube-dl comes with these metadata related arguments:
--add-metadataand--xattrs.--add-metadatawrites into the metadata section of the container format where possible/supported whereas--xattrsinto the filesystem's metadata section.Metadata on OS X
Mac users' default search feature Spotlight (and its background process
mds, the metadata server) to my research seems to index only xattr variables from the namespace com.apple.* whereas youtube-dl writes intouser.dublincore.*(contributor | date | description | format | title) anduser.xdg.referrer.url.Therefore the
--xattrsis completely inaccessible to Spotlight, and--add-metadataonly accessible if youtube-dl can 1) write into the container format and 2) Spotlight supports parsing the container's metadata and 3) Spotlight maps the variables correctly (to a certain degree).Example:
kMDItemDescriptiongot filled by Spotlight for a 3gp file with--add-metadatabut not for a mp4 file with--add-metadata.Feature request
It would be fine if there would be an option --spotlight which would write the metadata into the appropriate OS X specific metadata locations.
Implementation hints
I'm no savvy developer, but would like to provide some resources at least:
Apple Developer Documentation on Spotlight Metadata Attributes, i.e.:
kMDItemWhereFromswould be the ideal destination for the URL.kMDItemDescriptionwould be the ideal destination for the description.…
Writing metadata seems to be done with:
xattr -w com.apple.metadata:<properVariable "<MetadataValueHere>" <file>But it seems to be a bit tricky, as some metadata exists in multiple places (legacy) and must thus be properly synchronized in order to show up in Spotlight as well as showing up in the Finder info windows, and it seems that the value cannot be written as plaintext, but must be encapsulated as PLIST (XML format for Apple property list) or binary PLIST.