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?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With