egbertbouman / youtube-comment-downloader

Simple script for downloading Youtube comments without using the Youtube API
MIT License
881 stars 223 forks source link

Add the parent of the comment #98

Closed Breizhux closed 2 years ago

Breizhux commented 2 years ago

Hello, Thanks for the scrapper which works very well in my case. However there is one thing missing that would be very useful I think, that is to reference the parent of the comment. Without this information, it is impossible to differentiate a comment from a video to a comment from a comment. I know that youtube-dl has this option (--write-comments) and the result contains the key "parent" followed by the value "root" for the direct comment, or the identifier of the post to which it refers. I don't have time right now to look into how to solve this problem, but maybe later... Sincerely, Breizhux ;)

egbertbouman commented 2 years ago

While it's true the the ID of the parent in not explicitly stated in the output JSON, you can determine the parent by looking at the comment ID. If the ID has a . in the middle, the part before the . is the ID of the parent (see also https://github.com/egbertbouman/youtube-comment-downloader/issues/77#issuecomment-854324937).