Youtube api v3 Get list of user's videos
来源:互联网 发布:js 获取qq音乐数据 编辑:程序博客网 时间:2024/05/17 08:29
I managed to retrieve all videos by user name using v2:
https://gdata.youtube.com/feeds/api/users/GoogleDevelopers/uploads?alt=json&start-index=1&max-results=50&v=2
I haven’t find an API to get all videos directly, however it can be done by two steps (thanks to http://stackoverflow.com/questions/22613903/youtube-api-v3-get-list-of-users-videos) :
Step 1: get the user’s relatedPlaylist (uploads) id by:
GET https://www.googleapis.com/youtube/v3/channels?part=contentDetails&forUsername=GoogleDevelopers&key={YOUR_API_KEY}
Step 2: get all videos by the id retrieved in step 1:
GET https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=UU_x5XG1OV2P6uZZ5FSM9Ttw&key={YOUR_API_KEY}&maxResults=50
by javascript
// Get Uploads Playlist$.get( "https://www.googleapis.com/youtube/v3/channels",{ part : 'contentDetails', forUsername : 'USER_CHANNEL_NAME', key: 'YOUR_API_KEY'}, function(data) { $.each( data.items, function( i, item ) { pid = item.contentDetails.relatedPlaylists.uploads; getVids(pid); }); });//Get Videosfunction getVids(pid){ $.get( "https://www.googleapis.com/youtube/v3/playlistItems",{ part : 'snippet', maxResults : 20, playlistId : pid, key: 'YOUR_API_KEY'}, function(data) { var results; $.each( data.items, function( i, item ) { results = '<li>'+ item.snippet.title +'</li>'; $('#results').append(results); }); } );}<!--In your HTML --><ul id="results"></ul>
阅读全文
0 0
- Youtube api v3 Get list of user's videos
- Download and Save Youtube Videos
- 学习记录(Youtube videos)
- 【Google Calendar API v3】get events list with OAuth 2.0 & Rest
- The 2015 Concise List of Hacker Tools and videos
- List the user's group
- Download Youtube Videos Without Any Software
- User's Guide Of Dagger2
- List of FTP user commands
- List of BAPI's
- List of Scientist`s Names
- Put videos of your p
- Script of batch converting videos.
- A Programmer's Exploration of Vista's User Account Control
- Youtube api 3.0用法
- Android LruCache : how to put and get user's data
- Get middle element of a linked-list
- get the entry of the circle list;
- SpringMVC中的参数绑定总结
- 566. Reshape the Matrix
- Java语法糖1:可变长度参数以及foreach循环原理
- Android注解与反射机制
- ios svn问题简单总结
- Youtube api v3 Get list of user's videos
- 学习Kotlin吗?
- Prime Ring Problem(素数环 深搜)
- Web应用的组件化开发(一)
- POJ
- MPI安装配置
- lower_bound的使用
- Deep Multi-scale Convolutional Neural Network for Dynamic Scene Deblurring译
- AD中Cap,Cap2,Cap Pol的区别_路在脚下