Skip to content

Commit

Permalink
getVideos API fix
Browse files Browse the repository at this point in the history
  • Loading branch information
adasq committed Jan 4, 2023
1 parent d91d8d4 commit 8623b86
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "youtube-studio",
"version": "0.0.23",
"version": "0.0.24",
"description": "Unofficial YouTube Studio API",
"main": "index.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/youtube-studio-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ async function getVideos(pageSize = 30) {
_.set(template, 'pageSize', pageSize);
_.set(template, 'context.user.delegationContext.externalChannelId', config.CHANNEL_ID);
_.set(template, 'filter.and.operands[0].channelIdIs.value', config.CHANNEL_ID);
_.set(template, 'context.user.onBehalfOfUser', config.DELEGATED_SESSION_ID);

return fetch(`${YT_STUDIO_URL}/youtubei/v1/creator/list_creator_videos?alt=json&key=${config.INNERTUBE_API_KEY}`, {
method: 'POST',
Expand Down
1 change: 1 addition & 0 deletions src/youtube-studio-api.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ describe('for authenticated user', () => {

it('should list videos', async () => {
const result = await getVideos(60)
console.log(result.videos.length)
expect(result.videos.length).toBeGreaterThan(0)
})

Expand Down

0 comments on commit 8623b86

Please sign in to comment.