从命令行获取 Mac 电影信息

从命令行获取 Mac 电影信息

有没有办法从 Mac 上的 TV(即 iTunes)应用程序中获取电影信息?我说的不是“mdls”中的技术信息;我说的是应用程序信息框中的信息:即导演、演员、剧组人员等。这些信息肯定在系统的某个地方,那么我该如何获取它呢?

答案1

我认为您可以使用 AppleScript 来实现这一点,它的好处是可以直接与 iTunes 对话,但通过命令行以这种方式使用它并不那么容易。

如果你想要命令行访问,我强烈推荐MP4工具。我认为你需要自己编译它,除非有它的“端口”(MacPorts)或 Homebrew。你也可以使用 ffprobe,它是 ffmpeg 套件的一部分,你绝对可以通过 MacPorts 和/或 Homebrew 获得它,我忘了我使用的是哪个了。

更新:

ffprobe 的输出:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Lawrence of Arabia.m4v':
  Metadata:
    major_brand     : M4V 
    minor_version   : 0
    compatible_brands: M4V mp42isom
    creation_time   : 2012-06-12T12:41:36.000000Z
    title           : Lawrence of Arabia 
    artist          : Peter O'Toole
    genre           : Action & Adventure
    date            : 1962
    compilation     : 0
    sort_artist     : O'Toole, Peter
    description     : This monumental story recounts the true-life experiences of T.E Lawrence, better known to the world as Lawrence of Arabia. 
    synopsis        : One of the screen's grandest epics, this monumental story recounts the true-life experiences of T.E. Lawrence, better known to the world as Lawrence of Arabia. A young, idealistic British officer in WWI, Lawrence (Peter O'Toole) is assigned to the camp of
    copyright       : © 1962 renewed 1990 Columbia Pictures Industries, Inc. All Rights Reserved.
    purchase_date   : 2014-05-06 13:48:29
    podcast         : 0
    hd_video        : 1
    media_type      : 9
    rating          : 0
    gapless_playback: 0
    account_id      : (redacted)
    account_type    : 0
    iTunMOVI        : <?xml version="1.0" encoding="UTF-8"?>
                    : <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
                    : <plist version="1.0">
                    : <dict>
                    :   <key>cast</key>
                    :   <array>
                    :       <dict>
                    :           <key>name</key>
                    :           <string>Peter O'Toole</string>
                    :       </dict>
                    :       <dict>
                    :           <key>name</key>
                    :           <string>Alec Guinness</string>
                    :       </dict>
                    :       <dict>
                    :           <key>name</key>
                    :           <string>Anthony Quinn</string>
                    :       </dict>
                    :       <dict>
                    :           <key>name</key>
                    :           <string>Jack Hawkins</string>
                    :       </dict>
                    :       <dict>
                    :           <key>name</key>
                    :           <string>Omar Sharif</string>
                    :       </dict>
                    :       <dict>
                    :           <key>name</key>
                    :           <string>Jose Ferrer</string>
                    :       </dict>
                    :       <dict>
                    :           <key>name</key>
                    :           <string>Anthony Quayle</string>
                    :       </dict>
                    :       <dict>
                    :           <key>name</key>
                    :           <string>Claude Rains</string>
                    :       </dict>
                    :       <dict>
                    :           <key>name</key>
                    :           <string>Arthur Kennedy</string>
                    :       </dict>
                    :   </array>
                    :   <key>codirectors</key>
                    :   <array/>
                    :   <key>directors</key>
                    :   <array>
                    :       <dict>
                    :           <key>name</key>
                    :           <string>David Lean</string>
                    :       </dict>
                    :   </array>
                    :   <key>producers</key>
                    :   <array>
                    :       <dict>
                    :           <key>name</key>
                    :           <string>Sam Spiegel</string>
                    :       </dict>
                    :   </array>
                    :   <key>screenwriters</key>
                    :   <array>
                    :       <dict>
                    :           <key>name</key>
                    :           <string>Robert Bolt</string>
                    :       </dict>
                    :       <dict>
                    :           <key>name</key>
                    :           <string>Michael Wilson</string>
                    :       </dict>
                    :   </array>
                    :   <key>studio</key>
                    :   <string>Horizon Pictures</string>
                    : </dict>
                    : </plist>
                    : 
    iTunEXTC        : mpaa|PG|200|
  Duration: 03:42:11.68, start: 0.000000, bitrate: 4643 kb/s
...

mp4info 的输出:

 Name: Lawrence of Arabia 
 Artist: Peter O'Toole
 Sort Artist: O'Toole, Peter
 Release Date: 1962
 Genre: Action & Adventure
 Part of Compilation: no
 Part of Gapless Album: no
 Cover Art pieces: 1
 Copyright: © 1962 renewed 1990 Columbia Pictures Industries, Inc. All Rights Reserved.
 Content Rating: None
 HD Video: yes
 Media Type: Movie
 Short Description: This monumental story recounts the true-life experiences of T.E Lawrence, better known to the world as Lawrence of Arabia. 
 Long Description: One of the screen's grandest epics, this monumental story recounts the true-life experiences of T.E. Lawrence, better known to the world as Lawrence of Arabia. A young, idealistic British officer in WWI, Lawrence (Peter O'Toole) is assigned to the camp of Prince Feisal (Alec Guinness), an Arab tribal chieftain and leader in a revolt against the Turks. In a series of brilliant tactical maneuvers, Lawrence leads fifty of Feisal's men in a tortured three-week crossing of the Nefud Desert to attack the strategic Turkish-held port of Aqaba. And following his successful raids against Turkish troops and trains, Lawrence's triumphant leadership and unyielding courage gain him nearly god-like status among his Arab brothers.
 Podcast: no
 Content ID: 533825997
 Artist ID: 56514470
 Playlist ID: 0
 Genre ID: 0
 iTunes Account: (redacted)
 iTunes Account Type: iTunes
 Purchase Date: 2014-05-06 13:48:29
 iTunes Store Country: United States

相关内容