So on the above picture you can see that, I have opened Liked playlist in YouTube. And to see the 5000th liked video I have to scroll all down. But is there any way to fetch the 5000th video, in next loading or in any way.
I have tried to changing the index number as in HTML code it was "id = index", so I though it will work but it didn't.
so if there way please tell me.
https://www.youtube.com/watch?v=?????????
if you try right click on your page and select view page source option or as in URL browser
view-source:https://www.youtube.com/watch?v=?????????
will see HTML source code and searching the id of video id inside HTML source code by find it (ctr+f)
?????????/ = id is hashing from specific private algo on YouTube code
This shell command using youtube-dl will return you the ids of the given playlist.
youtube-dl -j --flat-playlist "PLAYLIST_ID" | jq -r '.id'
Example of unlisted YouTube playlist with 4,000 videos: PL8wZFyWE1ZaI2HE7PYHvpx0_yv4oJjwAZ
Problem is: items (videos) inside a playlist are loaded dynamically.
You have you either scroll down in the page until you scroll at the end of it and no more videos loads or use the answer provided by Benjamin Loison and then, you can get the video at any given index position.
Even using the YouTube API, you have to use a pageToken to get the results of the next page / next batch of results.
I'm afraid that (if none of the options mentioned here are valir to you), then, there is no other way to get your desired outcome.