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.
Some early September spring shots from a bushwalk, It is still too early for wildflowers.
I recently needed to clone over a smaller NVMe to a 2TB SK Hynix Platinum…
If you ever needed a simple solution in Laravel to delete an entire directory and…
How to enforce only one user to register or be registered in a Laravel web…