Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 16013

How to get YouTube PlayList video links.

$
0
0
Hi, I am trying to create a simple tool that will save the link and title from my playlist as many times a video is being deleted and there is no way to retrieve the name of it. Such a pity..
So, I've been googling a lot and there is a way using YouTube Api.
I'd like to make it easier and my main idea was to get playlist list html, but since videos links are not formatted as links, I have to skip this idea.
Endeed the html for every video in the videos list in playlist is:
Code:

{"videoId":"j6QkVTx2d88","thumbnail":{"thumbnails":[{"url":"https://i.ytimg.com/vi/j6QkVTx2d88/hqdefault.jpg?sqp=-oaymwEYCKgBEF5IVfKriqkDCwgBFQAAiEIYAXAB\u0026rs=AOn4CLCIkWbekWo0sw5Ck8jcB5KpW6u_dA","width":168,"height":94},{"url":"https://i.ytimg.com/vi/j6QkVTx2d88/hqdefault.jpg?sqp=-oaymwEYCMQBEG5IVfKriqkDCwgBFQAAiEIYAXAB\u0026rs=AOn4CLB9LSSNe63WE--MINkBx1O400nCvA","width":196,"height":110},{"url":"https://i.ytimg.com/vi/j6QkVTx2d88/hqdefault.jpg?sqp=-oaymwEZCPYBEIoBSFXyq4qpAwsIARUAAIhCGAFwAQ==\u0026rs=AOn4CLA6fL6ji2ouMF9lYjOQEXTkbn7XIw","width":246,"height":138},{"url":"https://i.ytimg.com/vi/j6QkVTx2d88/hqdefault.jpg?sqp=-oaymwEZCNACELwBSFXyq4qpAwsIARUAAIhCGAFwAQ==\u0026rs=AOn4CLA0TpWD5sBE_Os4RjHmhlqIlfjpjA","width":336,"height":188}]},"title":{"runs":[{"text":"Peter Tosh - Legalize It"}],"accessibility":{"accessibilityData":{"label":"Peter Tosh - Legalize It di Bondade é Nosso Hábito 8 anni fa 4 minuti e 46 secondi"}}},"index":{"simpleText":"1"},"shortBylineText":{"runs":[{"text":"Bondade é Nosso Hábito","navigationEndpoint":{"clickTrackingParams":"CEcQxjQYACITCKu_rqefzuwCFTPASQcdz2IKWg==","commandMetadata":{"webCommandMetadata":{"url":"/user/Bruno12170","webPageType":"WEB_PAGE_TYPE_CHANNEL","rootVe":3611}},"browseEndpoint":{"browseId":"UCY1IJY2IYNVfD7R-JbgQGbQ","canonicalBaseUrl":"/user/Bruno12170"}}}]},"lengthText":{"accessibility":{"accessibilityData":{"label":"4 minuti e 46 secondi"}},"simpleText":"4:46"},"navigationEndpoint":{"clickTrackingParams":"CEcQxjQYACITCKu_rqefzuwCFTPASQcdz2IKWjIKcGxwcF92aWRlb1okVkxQTDRfRHg4OGRwdTdlcGZINnlid3FKcGY5dUwydEFsMzY4mgEDEPos","commandMetadata":{"webCommandMetadata":{"url":"/watch?v=j6QkVTx2d88\u0026list=PL4_Dx88dpu7epfH6ybwqJpf9uL2tAl368\u0026index=1","webPageType":"WEB_PAGE_TYPE_WATCH","rootVe":3832}},"watchEndpoint":
The 3 string in red are what I would like to extract.
So, I tried with the last one using:
Code:

Dim textafter As String = """,""webPageType"       
Dim textbefore As String = """url"":""/watch?v="
        Dim startPosition As Integer = RichTextBox1.Text.IndexOf(textbefore)
        startPosition += textbefore.Length
        Dim endPosition As Integer = RichTextBox1.Text.IndexOf(textafter, startPosition)
        Dim textFound As String = RichTextBox1.Text.Substring(startPosition, endPosition - startPosition)
        RichTextBox1.AppendText(textFound)

This code output is : "j6QkVTx2d88\u0026list=PL4_Dx88dpu7epfH6ybwqJpf9uL2tAl368\u0026index=1" as it is supposed to do. But in the playlist page, there are obviously more than one video. How can I use For each Loop in this case and Is it possible to extract videoId, text(title) and url all together using my code? Thanks


Viewing all articles
Browse latest Browse all 16013

Latest Images

Trending Articles



Latest Images