Closed minamotorin closed 2 years ago
I'm not sure I understand. How would this improve the script?
Thanks for your reply, and sorry for the lack of information. This is just a new feature request.
This script can scrape comments from only YouTube videos currently, but I want to scrape comments from YouTube community posts as follows. This leads to enhancements.
youtube-comment-downloader --postid Ugkx2meuOt7vCSaQP4QsS5v4v-VG5WnVb7RU -o output.json
I don't know what will happen in the future, but at least for now, YouTube community posts can be scraped in the same method as YouTube videos. In the code below, just put a post URL instead of a video URL and it works fine. https://github.com/egbertbouman/youtube-comment-downloader/blob/b59eaf9b336d9bc39410a62de0027669d0fa33f2/youtube_comment_downloader/downloader.py#L43
OK, I get it now. I think that's a great idea! I'll probably implement this in the near future.
Perhaps I'll just add a --url
option. This way users can just copy-paste the url and it should work for both community posts and for videos.
I just added this functionality. You can now download community comments as follows:
youtube-comment-downloader --url https://www.youtube.com/post/Ugkx2meuOt7vCSaQP4QsS5v4v-VG5WnVb7RU --output output.json
It works for video URLs as well:
youtube-comment-downloader --url https://www.youtube.com/watch?v=ScMzIvxBSi4 --output output.json
Thanks so much! It's also useful for YouTube videos.
Example of post: https://www.youtube.com/post/Ugkx2meuOt7vCSaQP4QsS5v4v-VG5WnVb7RU
For adding support, no adjustments other than the interface are required. Just replace YouTube video URL of
downloader.py
with YouTube post URL as follows and it works fine.Thanks.