尝试使用 JSONhelper 在 Apple Script 中解析 JSON
Trying to parse JSON in Apple Script using JSONhelper
AppleScript 有时有点过于简单的英语,我希望我能这样说:somearray.someotherarray.0.item
无论如何,这就是我得到的:
set q to "Terminator"
tell application "JSON Helper"
set json to fetch JSON from "https://yts.mx/api/v2/list_movies.json?quality=1080p&limit=1&query_term=" & q
set value1 to the contents of the result's data's movie's torrent's 1st item's URL
end tell
谁能告诉我如何从 json 中获得第一个种子 url?这将是一个非常酷的阿尔弗雷德下载电影工作流程。
谢谢。 :)
tell the movies's first item in json's |data| to tell ¬
{its title_long} & its torrents's items to set ¬
Film to {name:1st item, |720p|:the |url| of ¬
the 2nd item, |1080p|:the |url| of the 3rd item}
在这种特殊情况下,变量 Film
会将以下信息存储为 record
:
{name:"Terminator: Dark Fate (2019)",
|720p|:"https://yts.mx/torrent/download/...",
|1080p|:"https://yts.mx/torrent/download/..."}
(显然,我自己截断了 URL;它们完整地出现在返回的实际对象中。)
AppleScript 有时有点过于简单的英语,我希望我能这样说:somearray.someotherarray.0.item
无论如何,这就是我得到的:
set q to "Terminator"
tell application "JSON Helper"
set json to fetch JSON from "https://yts.mx/api/v2/list_movies.json?quality=1080p&limit=1&query_term=" & q
set value1 to the contents of the result's data's movie's torrent's 1st item's URL
end tell
谁能告诉我如何从 json 中获得第一个种子 url?这将是一个非常酷的阿尔弗雷德下载电影工作流程。 谢谢。 :)
tell the movies's first item in json's |data| to tell ¬
{its title_long} & its torrents's items to set ¬
Film to {name:1st item, |720p|:the |url| of ¬
the 2nd item, |1080p|:the |url| of the 3rd item}
在这种特殊情况下,变量 Film
会将以下信息存储为 record
:
{name:"Terminator: Dark Fate (2019)",
|720p|:"https://yts.mx/torrent/download/...",
|1080p|:"https://yts.mx/torrent/download/..."}
(显然,我自己截断了 URL;它们完整地出现在返回的实际对象中。)