在 /youtube/v3/channels 的结果中没有看到 snippet.customUrl

2024-03-09

根据 YouTube 数据 API V3,网址为https://developers.google.com/youtube/v3/docs/channels#snippet.customUrl https://developers.google.com/youtube/v3/docs/channels#snippet.customUrl,我期待看到类似的东西

    { ... "snippet": { ...  "customUrl": ... } ... }

如果我提供具有相应自定义 URL 的频道 ID。

比如我随机发现https://www.youtube.com/c/KinoCheck https://www.youtube.com/c/KinoCheck在 YouTube 上。此自定义通道 URL 的通道 ID 为 UCOL10n-as9dXO2qtjjFUQbQ。

Passing

part=snippet,status
id=UCOL10n-as9dXO2qtjjFUQbQ

访问 Google API Explorer,网址为

Services > YouTube Data API v3 > youtube.channels.list

结果是这个 URL

https://www.googleapis.com/youtube/v3/channels?part=snippet%2Cstatus&id=UCOL10n-as9dXO2qtjjFUQbQ&key={YOUR_API_KEY}

我得到以下结果

   {
      "kind": "youtube#channelListResponse",
     "etag": "\"q5k97EMVGxODeKcDgp8gnMu79wM/3Ikdg3dfpT2WyGrGi-SpJDtdsxE\"",
     "pageInfo": {
      "totalResults": 1,
      "resultsPerPage": 1
     },
     "items": [
      {
        "kind": "youtube#channel",
       "etag": "\"q5k97EMVGxODeKcDgp8gnMu79wM/vFtLxXdyyYVC8raK8eQzs_B8My0\"",
       "id": "UCOL10n-as9dXO2qtjjFUQbQ",
       "snippet": {
        "title": "KinoCheck",
        "description": "Täglich die neuesten Film Trailer, News und Kritiken in bester Qualität! KinoCheck ist Deutschlands größter Movie-Entertainment Channel.\nEgal ob Blockbuster wie X-Men Apocalypse, Star Trek 3, Batman v. Superman, Suicide Squad, Angry Birds, Warcraft, Captain America 3 oder Indie-Film Trailer, wir haben sie alle! Zusätzlich produzieren wir original Inhalte wie Filmkritiken, Mashup's & Gewinnspiele, damit ihr wisst welcher Film ein wahrer KinoKinoFilm ist!\n\nBesuche unsere brandneue Seite https://KinoCheck.de und finde spielend leicht den richtigen Film für dich und deine Freunde.\n\nProjektleitung: Jan Pfriem | KinoCheck ein Format der some.marketing GmbH & Co. KG",
        "publishedAt": "2012-06-28T10:49:44.000Z",
        "thumbnails": {
          "default": {
            "url": "https://yt3.ggpht.com/-grf9lrD03u4/AAAAAAAAAAI/AAAAAAAAAAA/nUMotu3xp38/s88-c-k-no/photo.jpg"
         },
         "medium": {
            "url": "https://yt3.ggpht.com/-grf9lrD03u4/AAAAAAAAAAI/AAAAAAAAAAA/nUMotu3xp38/s240-c-k-no/photo.jpg"
         },
         "high": {
            "url": "https://yt3.ggpht.com/-grf9lrD03u4/AAAAAAAAAAI/AAAAAAAAAAA/nUMotu3xp38/s240-c-k-no/photo.jpg"
         }
        },
        "defaultLanguage": "de",
        "localized": {
          "title": "KinoCheck",
         "description": "Hot new movie trailer, news and reviews in highest quality on a daily basis! KinoCheck is Germany’s largest movie-entertainment channel.\nWhether blockbusters like X-Men Apocalypse, Star Trek 3, Batman v. Superman, Suicide Squad, Angry Birds, Warcraft, Captain America 3, or indie movie trailers — we’ve got them all. In addition, we create original content like reviews, mashup’s and contest, so you’ll always be up to date on the really good movies!\n\nDon’t miss to visit our brand-new website https://KinoCheck.de\n\nKinoCheck is a project of some.marketing GmbH & Co. KG"
        }
       },
       "status": {
        "privacyStatus": "public",
        "isLinked": true,
        "longUploadsStatus": "longUploadsUnspecified"
       }
      }
     ]
   }

我期待着但没有看到类似的东西

    { ... "snippet": { ...  "customUrl": "https://www.youtube.com/c/KinoCheck/" ... } ... }

我缺少什么?我需要使用不同的 API 吗?

Thanks.

免责声明

  • 我有与 Facebook 等集成的经验。
  • 两周前我刚刚开始与 Google 和 YouTube 集成。
  • 我用谷歌搜索了几个小时,但似乎找不到答案。

Youtube API 以及用户、品牌帐户和频道(ID 和 customUrl)之间的关系一直在不断发展,并且有些挑战性。

从我从你的代码中看到的,你的查询看起来应该有效。我刚刚去了YouTube 数据 API 文档 https://developers.google.com/youtube/v3/docs/channels/list并尝试了你的查询。这是一个 JavaScript 示例:

buildApiRequest('GET',
            '/youtube/v3/channels',
            {'id': 'UCOL10n-as9dXO2qtjjFUQbQ',
             'part': 'snippet,contentDetails,statistics'});

这确实产生了一个带有 customUrl 的片段:

/**
 * API response
 */
{
  "kind": "youtube#channelListResponse",
  "etag": "\"DuHzAJ-eQIiCIp7p4ldoVcVAOeY/m5Bxsm15vXTSZAmr8YPFDtFxsSk\"",
  "pageInfo": {
    "totalResults": 1,
    "resultsPerPage": 1
  },
  "items": [
    {
      "kind": "youtube#channel",
      "etag": "\"DuHzAJ-eQIiCIp7p4ldoVcVAOeY/bedKOF-LSDR5WBICufJner6bNMQ\"",
      "id": "UCOL10n-as9dXO2qtjjFUQbQ",
      "snippet": {
        "title": "KinoCheck",
        "description": "KinoCheck ist Deutschlands größtes Movie-Entertainment Netzwerk und die Plattform für neue Film Trailer, News und Kritiken in bester Qualität. Wir sind Tag und Nacht für euch im Büro, um sicher zu stellen, dass ihr keine Trailer mehr verpasst. Egal ob Blockbuster wie Deadpool, Star Wars, Fast and Furious oder Indie-Film Trailer, wir haben sie alle! Zusätzlich produzieren wir Original-Inhalte wie Filmkritiken, Mashups, Compilations & Film-Events, damit ihr wisst welcher Film ein wahrer KinoKinoFilm ist.\n\nBesuche unsere offizielle Webseite https://KinoCheck.de und finde spielend leicht den richtigen Film für dich und deine Freunde.\n\nDu sucht nach bestimmten Inhalten, dann checke unsere anderen Kanäle.\nKinoCheck International - Englische Trailer und News\nKinoCheck Home - Home Entertainment Filme auf DVD & Blu-Ray\nKinoCheck Kids - Kinderfreundliche Inhalte und Filme\nuvm.\n\nGründer: Jan Pfriem | KinoCheck™ eine Marke der some.marketing GmbH & Co. KG",
        "customUrl": "kinocheck",
        "publishedAt": "2012-06-28T10:49:44.000Z",
        "thumbnails": {
          "default": {
            "url": "https://yt3.ggpht.com/a-/AJLlDp0Hm30XcDoxdITElTIgqJbcRrWTQtrGX2q86w=s88-mo-c-c0xffffffff-rj-k-no",
            "width": 88,
            "height": 88
          },
          "medium": {
            "url": "https://yt3.ggpht.com/a-/AJLlDp0Hm30XcDoxdITElTIgqJbcRrWTQtrGX2q86w=s240-mo-c-c0xffffffff-rj-k-no",
            "width": 240,
            "height": 240
          },
          "high": {
            "url": "https://yt3.ggpht.com/a-/AJLlDp0Hm30XcDoxdITElTIgqJbcRrWTQtrGX2q86w=s800-mo-c-c0xffffffff-rj-k-no",
            "width": 800,
            "height": 800
          }
        },
        "defaultLanguage": "de",
        "localized": {
          "title": "KinoCheck",
          "description": "KinoCheck is Germany’s largest movie-entertainment network and your destination for movie trailers, news and reviews in highest quality on a daily basis! Whether blockbusters like Deadpool, Star Wars, Fast and Furious or indie movie trailers — we’ve got them all. In addition, we create original-content like reviews, mashups and compilations, so you’ll always be up to date on the most awesome movies!\n\nDon’t miss our official website https://KinoCheck.de\n\nIf you're searching a specific type of content, don't forget to check our other channels\n\nKinoCheck International - English trailers and news\nKinoCheck Home - German home entertainment DVD & Blu-Ray movie \nKinoCheck Kids - German child-friendly content and movies\netc.\n\nFounder: Jan Pfriem | KinoCheck™ a Brand of some.marketing GmbH & Co. KG"
        }
      },
      "contentDetails": {
        "relatedPlaylists": {
          "likes": "LLOL10n-as9dXO2qtjjFUQbQ",
          "uploads": "UUOL10n-as9dXO2qtjjFUQbQ",
          "watchHistory": "HL",
          "watchLater": "WL"
        }
      },
      "statistics": {
        "viewCount": "1411292351",
        "commentCount": "0",
        "subscriberCount": "1569200",
        "hiddenSubscriberCount": false,
        "videoCount": "3058"
      }
    }
  ]
}

所以我只能假设这是一个已记录的功能,但在您查询时并未像 @parn 建议的那样实现。

警告:我发现即使 API 将返回 customUrl 值(例如“kinocheck”),您也不能依赖“https://www.youtube.com/c/kinocheck https://www.youtube.com/c/kinocheck”实际上会将您带到一个有效的页面。我们注意到对于某些用户频道和一些“句柄”已更改的企业频道,会出现这种情况。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

在 /youtube/v3/channels 的结果中没有看到 snippet.customUrl 的相关文章

随机推荐

  • 如何设置 Swagger 忽略 @Asynchronous jax-rs bean 方法中的 @Suspished AsyncResponse?

    Swagger Core 似乎将 Suspished 最终 AsyncResponse asyncResponse 成员解释为请求正文参数 这显然不是有意的 也不是事实 我想告诉 swagger core 忽略此参数并将其从 api 文档中
  • 如何使用 Scipy 找到局部最小值[重复]

    这个问题在这里已经有答案了 我想从数组或列表中找到局部最小值 通过以下代码 我可以找到局部最大值 我知道存在相关问题 但我仍然想知道 是否存在任何逻辑可以使用相同的代码来查找局部最小值 Code import matplotlib pypl
  • 公司坚持对我们的所有文档使用二进制格式[关闭]

    Closed 这个问题正在寻求书籍 工具 软件库等的推荐 不满足堆栈溢出指南 help closed questions 目前不接受答案 我在一家公司工作 出于某种原因 该公司坚持所有开发文档都应采用 MS Word 格式 作为二进制格式
  • .NET 中 32 位进程如何与 64 位进程通信?

    Windows 不允许 32 位进程加载 64 位 dll 因此我尝试使用远程处理来允许 32 位进程与 64 位进程交互 问题是 虽然两个应用程序位于同一台计算机上 但一个是 32 位 另一个是 64 位 而且它们必须是这样的 同时使用
  • 从 Sql Server 2000 上的存储过程插入临时表

    我正在尝试完成这里描述的事情 http sqldev wordpress com 2008 05 06 insert into temporary table from stored procedure http sqldev wordpr
  • 使用 char * 访问 int 是否可能具有未定义的行为?

    下面用于测试字节顺序的代码预计具有实现定义的行为 int is little endian void int x 1 char p char x return p 1 但它是否有可能在特意设计的架构上具有未定义的行为 例如 表示的第一个字节
  • Javascript找不到这些变量,为什么?

    我正在使用 Phonegap 创建 Android 应用程序 录音机 但我的代码中有以下 2 个错误 ReferenceError Can t find variable Media TypeError Result of expressi
  • 针对 3.5 框架的 VS2010 上的 RESX 文件存在问题

    这是我最近遇到的一个故事和一个可能的答案 我只是想分享这个信息 因为我在 stackoverflow 上还找不到这个信息 我将我的解决方案从 VS2008 WinXP 32 位升级到 VS2010 Win7 64 位 当我对生成新 RESX
  • 将 HTML 文件转换为 PDF [关闭]

    就目前情况而言 这个问题不太适合我们的问答形式 我们希望答案得到事实 参考资料或专业知识的支持 但这个问题可能会引发辩论 争论 民意调查或扩展讨论 如果您觉得这个问题可以改进并可能重新开放 访问帮助中心 help reopen questi
  • 将 Pandas 绘制成子图

    da 是我的数据框 我想把这个图变成我将拥有的 2 个子图中的一个 当我为这个图添加 plt subplots 2 1 2 时 它最终会将该图分成一个单独的图 并且子图是一个空图 我怎样才能把这段代码变成一个子图 Thank you in
  • 它在 php/html 中的输出详细信息不正确

    我想当用户选择时显示下拉菜单中的所有问题All从问题下拉菜单中并将其输出在下面 问题是它没有这样做 更糟糕的是 它给了我未定义的偏移错误 指出 Notice Undefined offset in on line 605 605行是 ech
  • 使用 UWP 通过拖放重新排序可绑定列表视图

    我正在尝试重新排序ListView通过拖放 它在使用静态项目时与我一起工作 但是当我使用绑定数据时物品来源拖动工作正常 但我无法删除该项目 这是我的代码 C lstSrvMenu ItemsSource Menue MainItems Wh
  • 如何使用 JS 删除或重置 CSS 样式?

    我想使用 JS 删除或重置应用于特定 DOM 节点的样式 node style webkitTransitionDuration 5000ms node style webkitTransformOrigin 200px 200px nod
  • 在 Windows 10 (1803) 上,如果 WPF 透明窗口覆盖在所有应用程序上,所有应用程序都会失去触摸或手写笔功能

    如果我使用简单的空窗口 如下面所示的代码 创建一个新的 WPF 应用程序 我发现 WPF 应用程序覆盖的所有应用程序都失去了触摸或手写笔反应 仅当 Windows 10 升级到 1803 10 0 17134 0 时才能重现此情况
  • 使用 Bootstrap 4 的剩余垂直空间

    我想让 id 网格使用完整的可用垂直空间 div class container fluid div class row mb 2 div class col h2 i class fas fa map marker alt i Test
  • Vaadin 的 vaadinBootstrap.js

    我遇到了令人困惑的问题 我正在使用 Vaadin 7 框架来创建一些 安静简单的 应用程序 当我在 Eclipse 中测试它时 一切正常 但是当我将项目部署到 Tomcat 中时 一些谜团开始出现 当我从管理器应用程序 运行 应用程序时 只
  • 查看特定的 Git 提交 [重复]

    这个问题在这里已经有答案了 可能的重复 获取有关 SHA 1 提交对象的信息 https stackoverflow com questions 7610073 get information about a sha 1 commit ob
  • 如何使用 node.js 构建消息以通过 TCP 发送?

    我需要从 Node js TCP 服务器向多个 TCP 客户端发送 JSON 字符串 为了从客户端的套接字 流读取消息 我需要进行某种消息框架 实现此目的的一种方法是将消息长度作为数组作为消息前缀 然后将其转换为客户端消息的缓冲区大小 我如
  • app.use(验证器()); ^ TypeError:验证器不是函数

    我正在开展一个夏季培训项目 我被要求使用以下命令创建一个登录页面Node js但是 安装后express validator并输入我想在的代码app js文件每次运行时都会打印出一个错误app js or the www在 bin 文件中告
  • 在 /youtube/v3/channels 的结果中没有看到 snippet.customUrl

    根据 YouTube 数据 API V3 网址为https developers google com youtube v3 docs channels snippet customUrl https developers google c