Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export function buildMostPopularVideosRequest(amount = 12, loadDescription = false, nextPageToken) {
- let fields = 'nextPageToken,prevPageToken,items(contentDetails/duration,id,snippet(channelId,channelTitle,localized/title,publishedAt,thumbnails/medium,title),statistics/viewCount),pageInfo(totalResults)';
- if (loadDescription) {
- fields += ',items/snippet/description';
- }
- return buildApiRequest('GET',
- '/youtube/v3/videos',
- {
- part: 'snippet,statistics,contentDetails',
- chart: 'mostPopular',
- maxResults: amount,
- regionCode: 'US',
- pageToken: nextPageToken,
- fields,
- }, null);
- }
Add Comment
Please, Sign In to add comment