从 jumblr 客户端获取 tumblr 博客的 "is_nsfw" 标志

Get "is_nsfw" flag from jumblr client for a tumblr blog

我觉得我遗漏了一些明显的东西,但我似乎无法弄清楚。我需要找出从给定的 URL 到 tumblr 博客帖子,如果该博客发布在 "is nsfw".

API 控制台提示可以通过博客找到信息:Info "This method returns general information about the blog, such as the title, number of posts, and other high-level data"

控制台中使用 JumblrClient 的 Java 代码示例如下

// Authenticate via API Key
JumblrClient client = new JumblrClient("AUTH");
// Make the request
Blog blog = client.blogInfo("asksunshineandmoonbeams");

并且示例输出确实包含该标志 is_nsfw

{
  "meta": {
    "status": 200,
    "msg": "OK"
  },
  "response": {
    "blog": {
      "title": "Ask Sunshine and Moonbeams",
      "name": "asksunshineandmoonbeams",
      "posts": 106,
      "url": "http://asksunshineandmoonbeams.tumblr.com/",
      "updated": 1455995792,
      "description": "Sisterly love at its finest.",
      "is_nsfw": false,
      "ask": true,
      "ask_page_title": "Give us stuff to do ^^",
      "ask_anon": true,
      "submission_page_title": "Any gifts for us? :3",
      "share_likes": true,
      "likes": 230
    }
  }
}

但上面 Java 中创建的 Blog 对象似乎没有提供该信息? javadoc 也没有列出任何获取它的方法 http://tumblr.github.io/jumblr/javadoc/index.html?com/tumblr/jumblr/JumblrClient.html

那么,是否有另一种方法可以使用 JumblrClient 获取该标志的状态,或者我必须走另一条路吗?

因此,事实证明 JumblrClient 目前确实不支持此功能。

如果其他人偶然发现了这个问题,直到它在新版本中得到解决,我现在最终通过 api.tumblr.com/v2/blog/{blog-identifier}/info 直接查询来获取该信息?api_key={键} 如此处所述 https://www.tumblr.com/docs/en/api/v2#blog-info

所以对于上面的例子 https://api.tumblr.com/v2/blog/asksunshineandmoonbeams.tumblr.com/info?api_key={键} 产生问题中看到的 JSON。