egbertbouman / youtube-comment-downloader

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

Add reply functionality #117

Closed ajskateboarder closed 2 years ago

ajskateboarder commented 2 years ago

This PR will allow users to distinguish comments from replies. Any comment yielded from YoutubeCommentDownloader will have reply: bool This would make data processing far easier!

egbertbouman commented 2 years ago

Unfortunately, this doesn't appear to be working for me.

Replies can be identified by checking if there is a dot in the comment ID. So, you can just add a 'reply': '.' in comment['commentId'] field to the resulting dict.

ajskateboarder commented 2 years ago

Thanks for looking over this PR! I have made the changes requested, although it's a pretty minor change you could add yourself :laughing:

egbertbouman commented 2 years ago

Could you please tell me what the purpose is of the other changes?

ajskateboarder commented 2 years ago

The purpose is to simply to check if a comment is replying to another comment. This can be useful for sentiment analysis since you probably don't want comments unrelated to a topic video.

I didn't really know you could just search for a period in a comment ID to check if it's a reply.

egbertbouman commented 2 years ago

In that case, please remove them so I can merge this PR.

ajskateboarder commented 2 years ago

I already have. Reply checking now uses 'reply': '.' in comment['commentId'] in every comment dict yielded.

ajskateboarder commented 2 years ago

Whoops, I forgot about those. That was just during development :)

egbertbouman commented 2 years ago

Thanks!