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

Playlist pagination not working as expected #396

Open
JohnnyVim opened this issue Sep 2, 2021 · 3 comments
Open

Playlist pagination not working as expected #396

JohnnyVim opened this issue Sep 2, 2021 · 3 comments

Comments

@JohnnyVim
Copy link

Hi, I am currently struggling with opening a playlist at a certain page of results.

$ youtube-viewer --page=4 "https://www.youtube.com/playlist?list=<*****>"
[400 Bad Request] Error occurred on URL: https://www.googleapis.com/youtube/v3/playlistItems?key=[...]&maxResults=20&pageToken=CLwAEAA&part=contentDetails,snippet&playlistId=<*****>&prettyPrint=false

[!] Inexistent playlist...

Opening the playlist without --page and entering :n 3 times still works. However, when open, directly jumping to a page via :page=4 or :end also fails:

> :page=4

:: Jumping to page 4
[400 Bad Request] Error occurred on URL: https://www.googleapis.com/youtube/v3/playlistItems?key=[...]&maxResults=20&part=contentDetails,snippet&playlistId=<*****>&prettyPrint=false&pageToken=CLwAEAA

[!] No video results!
> :end

:: Jumping to page 34
[400 Bad Request] Error occurred on URL: https://www.googleapis.com/youtube/v3/playlistItems?key=[...]&maxResults=20&part=contentDetails,snippet&playlistId=<*****>&prettyPrint=false&pageToken=CJQFEAA

[!] No video results!

As you can see from the output of the :end command, the playlist has 34 pages, so the page 4 I am trying to access is certainly in range.
I tried other playlists as well, all leading to the same error. Additionally, I tried doing the same with pipe-viewer. This did not error but opened the results at page 1 when setting --page=4 which is obviously also not what I wanted.

Is this intended to work the way I am trying to use it? Is there anything else I should provide?

I am running Void (Linux). yv is up-to-date:

$ youtube-viewer --version
YouTube Viewer 3.9.4
@trizen
Copy link
Owner

trizen commented Sep 2, 2021

Thanks for reporting the issue. I will have to look into this.

A quick workaround would be to save the playlist locally:

youtube-viewer --save-playlist <PLAYLIST_ID>

and then list the saved playlist with:

youtube-viewer -lp <PLAYLIST_ID>

which works OK with the options :beg, :end and :page=i.

@ZaxonXP
Copy link

ZaxonXP commented Sep 8, 2021

The same happen when you use --page parameter > 1 with the -uv <channel_id>.

@ZaxonXP
Copy link

ZaxonXP commented Nov 19, 2021

I see the --save-playlist is not working at the moment (#405). Here is how I found the workaround.
I use Suckless simple terminal, which has the possibility to capture all what is visible on the terminal, so I opened it like this:

st -o playlist.txt

Then inside that terminal I open the youtube-viewer like this:

youtube-viewer --no-use-colors  --custom-layout='  *TIME* | *ID* | *PUBLISHED* | *TITLE*' -uv=UC_aEa8K-EOJ3D6gOs7HcyNg

then I pressed enter as long there was no more new records. Afterwards I closed the terminal and edited out the weeds.
The list I use to play the videos using my supporting scripts.

Hope this helps in the time being. :)

Regards,
Zaxon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants