Direct link to YouTube comments [closed]
Asked Answered
I

2

16

Is there a way to link directly to the comments section of a YouTube page?

I know that this can be done using anchors and div ids, but this has been unsuccessful when I applied it to a YouTube URL, because YouTube strips the forward slash on page load.

For example, https://www.youtube.com/watch?v=eRsGyueVLvQ/#comments becomes ?v=eRsGyueVLvQ#comments

Is this possible, or should this be chalked up to a feature request?

Insulation answered 30/8, 2017 at 18:51 Comment(0)
A
20

You can make a certain comment appear at the top of the comment section by clicking on how long ago it was posted (e.g. 2 years ago).

This will take you to the same YouTube video, but with a URL which looks something like this: https://www.youtube.com/watch?v=VIDEO_ID&lc=COMMENT_ID (just like in Mr.Rebot's answer).

You can also do this for replies as well.

Azalea answered 21/3, 2021 at 15:40 Comment(3)
OMG I can't believe it's that simple. My whole life I was clicking on peoples comments from the notifications menu and thinking "oh the YouTube algorithm actually finds the best comments and brings it to the top and highlights it". I never realised that it's just because it's the comment link I clicked on from notifications menu.Rovelli
This is a very useful, thanks. I'm looking for something though that puts the comments at the top of the page when they click the link (i.e an anchor link), such as: external-site.com/#anchorInsulation
There is no way to link and scroll to actual comment in page with url?Huh
M
3

If you will use the CommentThreads:list:

Returns a list of comment threads that match the API request parameters.

Code Snippets:

// Sample PHP code for commentThreads.list

function commentThreadsListByVideoId($service, $part, $params) {
    $params = array_filter($params);
    $response = $service->commentThreads->listCommentThreads(
        $part,
        $params
    );

    print_r($response);
}

commentThreadsListByVideoId($service,
    'snippet,replies',
    array('videoId' => 'kmXXXLBL3Nk'));

Then you can create a link with with the URL:

https://www.youtube.com/watch?v=VIDEO_ID&lc=COMMENT_ID

This link is not generated in the API so you should create a function for this.

Masakomasan answered 31/8, 2017 at 18:9 Comment(5)
Since I want to link directly to the section of the youtube page where the comments begin, I am always going to want to link to the very first comment. Would that just be https://www.youtube.com/watch?v=VIDEO_ID&lc=1 ?Insulation
There is a generated commentID for the specific comment which you can use to your link. You can follow the link provided above to get the commentID.Masakomasan
Thanks. If more recent comments are added though, will that link go further and further away from the start of the comment section? In case I didn't explain well, I want this to be an external link that takes viewers to the actual youtube page. Specifically, to the top of the comments section.Insulation
I see. So the code you posted above will generate the commentID of the most recent comment? That way, it's always the top of the comments thread?Insulation
I have just tested. I can see using this youtube.com/watch?v=VIDEO_ID&lc=COMMENT_ID it will make linked comment on top of other comments, but thats all. Can you actually scroll to comment in the page?Huh

© 2022 - 2024 — McMap. All rights reserved.