Note: Some of the menu-points, folder and files may have different names depending on the lagnuage you selected for your Google Account.
Go to Google Takeouts
You can deselect all products except "YouTube and YouTube Music".
Ofcourse you don't have to do this but the download time is faster the lesser products are selected.
Scroll down to "YouTube and YouTube Music" click on "Multiple formats" and select for History "JSON" instead of "HTML".
You can now click through the next steps, and wait till the download is ready.
Download and unzip the folder. Go to YouTube and YouTube Music
-> history
.
Send the files watch-history.json
and search-history.json
the bot.