Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Continuation for browse method not working #49

Closed
1Mr-Newton opened this issue Jul 16, 2023 · 4 comments
Closed

🐛 Continuation for browse method not working #49

1Mr-Newton opened this issue Jul 16, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@1Mr-Newton
Copy link

Maybe I'm doing it wrongly, I tried the client.browse method to get a channel's videos, it returned the first 30 videos, then I used the continuation argument and passed the continuation token from the first response to get the next maybe 30 videos, but still returned the same first response. I passed the params argument too.(to first navigate to the channel videos page)
Can you please provide an example on this?
Also, what does the index parameter for the .next method do? I tried to go through the codebase but couldn't understand.

@tombulled tombulled changed the title Continuation for browse method not working 🐛 Continuation for browse method not working Jul 30, 2023
@tombulled tombulled self-assigned this Jul 30, 2023
@tombulled tombulled added the bug Something isn't working label Jul 30, 2023
@tombulled
Copy link
Owner

Hi @1Mr-Newton, apologies for the late reply - I'll look into this for you now

@tombulled
Copy link
Owner

So if I remember correctly, the index parameter for the next() endpoint is used to tell YouTube that you're playing a video at a specific index in a playlist. For example, if you navigate to a playlist, for example https://www.youtube.com/playlist?list=PL1vLrQQudDhZtZVuTSpQIfNCvjiFuY37U, then click the second video in the list, a request is sent off to next() with an index of 1 (as it's zero-based).

However in the process of testing this, it appears that YouTube has now renamed this parameter to playlistIndex!

@tombulled
Copy link
Owner

Ok so there were a couple of things YouTube has changed recently that were affecting this from working properly with newer clients. I've bumped the client versions for YouTube Web (WEB) and YouTube Music Web (WEB_REMIX) and have fixed those issues (#50 and #53).

I've created an example script here - https://github.com/tombulled/innertube/blob/22d1166c179db34faba7d00ee20d91042d8cfd2c/examples/list-channel-videos.py - that demonstrates how to list videos for a channel by using the .browse() method and the continuation token used to continue the data.

The example script is not very defensive in design, however hopefully it helps provide a bit of a steer!

@tombulled
Copy link
Owner

I've released innertube version 2.1.9 to PyPI with the above fixes in :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants