Twitch 为用户获取视频
Twitch get videos for a user
对于应用程序,我需要获取用户发布的 videos/streams 列表。
我已通读 twitch.tv API (https://github.com/justintv/Twitch-API),但我找不到任何内容。
我能找到的只是如何获取用户已订阅的 videos/streams 列表。
谁能帮我获取用户发布的视频列表?
谢谢!
我不确定你是在谈论抽搐亮点还是过去的广播。如果您正在寻找亮点,可以从以下位置获得:
https://api.twitch.tv/kraken/channels/USERNAME/videos?limit=10
可以更改限制以获得所需的数量。结果以 JSON 形式返回,如下所示:
{
"_total": 179,
"videos": [
{
"title": "Twitch Weekly - February 6, 2015",
"description": "Twitch Weekly LIVE on February 6, 2015!",
"broadcast_id": 13019796368,
"status": "recorded",
"tag_list": "",
"_id": "c6055863",
"recorded_at": "2015-02-06T21:01:09Z",
"game": null,
"length": 4015,
"preview": "http://static-cdn.jtvnw.net/jtv.thumbs/archive-621292653-320x240.jpg",
"url": "http://www.twitch.tv/twitch/c/6055863",
"views": 318,
"broadcast_type": "highlight",
"_links": {
"self": "https://api.twitch.tv/kraken/videos/c6055863",
"channel": "https://api.twitch.tv/kraken/channels/twitch"
},
"channel": {
"name": "twitch",
"display_name": "Twitch"
}
},
...
],
"_links": {
"self": "https://api.twitch.tv/kraken/channels/twitch/videos?limit=10&offset=0",
"next": "https://api.twitch.tv/kraken/channels/twitch/videos?limit=10&offset=10"
}
}
如果您想要视频的过去广播,可以从以下位置获取:
https://api.twitch.tv/kraken/channels/USERNAME/videos?broadcasts=true
它们也作为 JSON 返回,看起来类似于:
"videos": [
{
"title": "BlizzCon Pre-Show Powered by T-Mobile",
"description": null,
"broadcast_id": 17504505664,
"status": "recorded",
"tag_list": "",
"_id": "v24147264",
"recorded_at": "2015-11-05T20:10:56Z",
"game": "Gaming Talk Shows",
"length": 4276,
"delete_at": null,
"is_muted": false,
"preview": "http://static cdn.jtvnw.net/v1/AUTH_system/vods_6d3c/twitch_17504505664_342107744/thumb/thumb0-320x240.jpg",
"url": "http://www.twitch.tv/twitch/v/24147264",
"views": 150,
"fps": {
"audio_only": 0,
"medium": 30.0000584614125,
"mobile": 19.9816431164609,
"high": 30.0000584614125,
"low": 30.0000584614125,
"chunked": 59.9998830771748
},
"resolutions": {
"medium": "852x480",
"mobile": "400x226",
"high": "1280x720",
"low": "640x360",
"chunked": "1280x720"
},
"broadcast_type": "archive",
"created_at": "2015-11-05T20:11:19Z",
"_links": {
"self": "https://api.twitch.tv/kraken/videos/v24147264",
"channel": "https://api.twitch.tv/kraken/channels/twitch"
},
"channel": {
"name": "twitch",
"display_name": "Twitch"
}
}
对于应用程序,我需要获取用户发布的 videos/streams 列表。 我已通读 twitch.tv API (https://github.com/justintv/Twitch-API),但我找不到任何内容。 我能找到的只是如何获取用户已订阅的 videos/streams 列表。
谁能帮我获取用户发布的视频列表?
谢谢!
我不确定你是在谈论抽搐亮点还是过去的广播。如果您正在寻找亮点,可以从以下位置获得:
https://api.twitch.tv/kraken/channels/USERNAME/videos?limit=10
可以更改限制以获得所需的数量。结果以 JSON 形式返回,如下所示:
{
"_total": 179,
"videos": [
{
"title": "Twitch Weekly - February 6, 2015",
"description": "Twitch Weekly LIVE on February 6, 2015!",
"broadcast_id": 13019796368,
"status": "recorded",
"tag_list": "",
"_id": "c6055863",
"recorded_at": "2015-02-06T21:01:09Z",
"game": null,
"length": 4015,
"preview": "http://static-cdn.jtvnw.net/jtv.thumbs/archive-621292653-320x240.jpg",
"url": "http://www.twitch.tv/twitch/c/6055863",
"views": 318,
"broadcast_type": "highlight",
"_links": {
"self": "https://api.twitch.tv/kraken/videos/c6055863",
"channel": "https://api.twitch.tv/kraken/channels/twitch"
},
"channel": {
"name": "twitch",
"display_name": "Twitch"
}
},
...
],
"_links": {
"self": "https://api.twitch.tv/kraken/channels/twitch/videos?limit=10&offset=0",
"next": "https://api.twitch.tv/kraken/channels/twitch/videos?limit=10&offset=10"
}
}
如果您想要视频的过去广播,可以从以下位置获取:
https://api.twitch.tv/kraken/channels/USERNAME/videos?broadcasts=true
它们也作为 JSON 返回,看起来类似于:
"videos": [
{
"title": "BlizzCon Pre-Show Powered by T-Mobile",
"description": null,
"broadcast_id": 17504505664,
"status": "recorded",
"tag_list": "",
"_id": "v24147264",
"recorded_at": "2015-11-05T20:10:56Z",
"game": "Gaming Talk Shows",
"length": 4276,
"delete_at": null,
"is_muted": false,
"preview": "http://static cdn.jtvnw.net/v1/AUTH_system/vods_6d3c/twitch_17504505664_342107744/thumb/thumb0-320x240.jpg",
"url": "http://www.twitch.tv/twitch/v/24147264",
"views": 150,
"fps": {
"audio_only": 0,
"medium": 30.0000584614125,
"mobile": 19.9816431164609,
"high": 30.0000584614125,
"low": 30.0000584614125,
"chunked": 59.9998830771748
},
"resolutions": {
"medium": "852x480",
"mobile": "400x226",
"high": "1280x720",
"low": "640x360",
"chunked": "1280x720"
},
"broadcast_type": "archive",
"created_at": "2015-11-05T20:11:19Z",
"_links": {
"self": "https://api.twitch.tv/kraken/videos/v24147264",
"channel": "https://api.twitch.tv/kraken/channels/twitch"
},
"channel": {
"name": "twitch",
"display_name": "Twitch"
}
}