Another seemingly hidden feature with yt-dlp is the ability to save the YouTube video comments into a JSON file.
With yt-dlp downloading the video comments into a JSON file is done with the --write-comments
flag.
yt-dlp --write-comments VIDEO_URL
For popular videos with a lot of comments, this can take several minutes.
An example of a comment in the JSON file:
{ "id": "UgzewWuFZvI0FsncvKR4AaABAg", "text": "These double ads are really getting on my nerves", "timestamp": 1614816000, "time_text": "1 year ago", "like_count": 1, "is_favorited": false, "author": "Michael M", "author_id": "UCKYW7m35n1kBassjpjakd7g", "author_thumbnail": "https://yt3.ggpht.com/ytc/AKedOLRr_ZwtCbdnb_qiqsKkwnTT4Y0eSW9SpgklicNt=s176-c-k-c0x00ffffff-no-rj", "author_is_uploader": false, "parent": "root" }
This flag is a part of the --write-info-json
section where video metadata gets saved to the JSON file too. If you only want the video comments add --no-write-info-json
.
A drained and empty Kennington reservoir images from a drone in early July 2024. The…
Merrimu Reservoir from drone. Click images to view larger.
Using FTP and PHP to get an array of file details such as size and…
Creating and using Laravel form requests to create cleaner code, separation and reusability for your…
Improving the default Laravel login and register views in such a simple manner but making…
Laravel validation for checking if a field value exists in the database. The validation rule…