Ytm-extractor: Import YouTube Music listens to ListenBrainz

YouTube Music to ListenBrainz

Submit your YTM listens from your Google Takeout.

Note:

This is not fool-proof, some listens are under Various Artists or Release and as such will not be properly matched. However, from my experience importing a year of listens (12k listens), 95-99% of listens get properly matched and a couple are left to do by hand.

Disclaimer:

  • I’m not responsible for messed up histories, unmatched listens, thermonuclear war, or you getting fired because your taste in music is bad.
  • YOU are choosing to use this software, and if you point the finger at me for messing up your ListenBrainz history, I will laugh at you.

Downloads: Release 1.0: First Release · defvs/ytm-extractor · GitHub

Source: GitHub - defvs/ytm-extractor

Usage

1. Getting the Takeout data

Go through this link, and request your YouTube History: https://takeout.google.com/settings/takeout

You should find the necessary file under Takeout/YouTube and YouTube Music/history/watch-history.html

2. Getting your ListenBrainz Token

You will need to get your ListenBrainz token through: ListenBrainz

3a. Submitting everything

java -jar ytm-extractor.jar -i "path/to/watch-history.html" -t "listenbrainz token"

3b. Submitting after/before (with Unix epoch, in seconds.)

java -jar ytm-extractor.jar -i "path/to/watch-history.html" -t "listenbrainz token" --before 1722791449 --after 1722532249

Let me know if there’s any issue, feel free to raise one on the repo in GitHub. Cheers!

7 Likes

Has anyone had success with this ytm-extractor for submitting historical YouTube watch data into ListenBrainz? I’ve been having issues getting a complete watch-history.json export from Google Takeout (it’s truncated at 6 MB while my watch-history.html file is 60 MB). I’m hoping to use this to import my historical YouTube watch data, when I’ve watched music videos or listened to music through the YouTube app on my TV (not through YouTube Music).

I ran it on Linux and it worked! It did however quit after showing the following,

from 1606625393 to 161497315

Do I need to worry that it didn’t submit all the listens to ListenBrainz?