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

Fetch comment details if given a comment permalink #54

Open
dgw opened this issue Aug 15, 2023 · 0 comments · May be fixed by #69
Open

Fetch comment details if given a comment permalink #54

dgw opened this issue Aug 15, 2023 · 0 comments · May be fixed by #69
Milestone

Comments

@dgw
Copy link
Member

dgw commented Aug 15, 2023

It would be useful to show basic information like:

  • Author (display name)
  • When the comment was posted (absolute or relative, probably seconds_to_human())
  • Comment score (like count)
  • Reply count, if top-level
  • Comment text up to the truncation limit for a single IRC line

Comment permalinks (obtained by right-clicking the timestamp on desktop YouTube; unsure if possible to obtain via mobile app) look like https://www.youtube.com/watch?v=[video_id]&lc=[comment_id]; the lc parameter is what we'll need to ask the YouTube Data API for more info about the comment/thread.

However the request is authorized (API key, OAuth), the API endpoint to get details of a specific comment is very simple, as I discovered by clicking around the YouTube API documentation for a few minutes and using the built-in "Try it" panel: https://youtube.googleapis.com/youtube/v3/comments?part=id%2Csnippet&id=Ugwh1UzoscaCmeYtNL14AaABAg

The equivalent for this plugin would be the comments resource's list() method, e.g. yt_client.comments().list('id,snippet', id=the_comment_id). Alternatively, the commentThreads resource gives better access to data such as whether the comment is a child (if it has a parentId, though replies' IDs often appear to have the format parent_ID.child_ID) and how many replies exist (totalReplyCount, which is always 0 for child comments as YouTube currently supports only one nesting level).

@dgw dgw added this to the 0.7.0 milestone Aug 18, 2024
@dgw dgw linked a pull request Aug 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant