ReVanced / restore-missing-youtube-watch-history

⌛ Script to import missing YouTube watch history
https://revanced.app
GNU General Public License v3.0
58 stars 6 forks source link

Watch history missing from watch_history.JSON #13

Open jmorgannz opened 7 months ago

jmorgannz commented 7 months ago

When I use Google Takeout to export 'YouTube and YouTube Music' in JSON format, the resulting watch_history.JSON file is missing the same watch history as the youtube web client and other apps are.

When looking at My Activity in Google, if I select to filter to YouTube only, the watch history is also missing.

If I select NO filtering, and manually scroll instead, I can find my missing watch history, where it is marked as from "youtube.com", as compared to the watch history which DOES show in the apps and IS in the watch_history.JSON file, which show as from"YouTube"

I don't know why I am different to other people but it's only the ReVanced client watched videos which have ended up this way - I am sure there are others who have this issue.

Can we adapt the script and instructions to be able to parse the missing watch history from a My Activity export to resolve this?

Image from my My Activity feed showing a properly recorded history entry (present in watch_history.JSON) https://imgur.com/ksorTzk

Image from my My Activity feed showing a history entry created by ReVanced which is missing in watch_history.JSON and youtube history. https://imgur.com/vWzsxSP

jmorgannz commented 7 months ago

Further to this; it appears ReVanced was somehow causing the videos to be logged as ads.
If one exports My Activity and filters only for ads, the missing watch history can be found.

{
  "header": "youtube.com",
  "title": "Visited Yuzu is dead - YouTube",
  "titleUrl": "https://www.youtube.com/watch?v\u003dgIv0AuKe01A",
  "time": "2024-03-09T13:04:22.761Z",
  "products": ["Ads"],
  "details": [{
    "name": "From Google Ads"
  }],
  "activityControls": ["additional Web \u0026 App Activity"]
}

This is intermixed with other entries which are not youtube views, but the youtube views can be distinguished via the "From Google Ads detail

jmorgannz commented 7 months ago

I am happy to manually parse this out myself into a flat list of youtube url's. Would it be possible for the script to just take a flat text file of URLs?

oSumAtrIX commented 7 months ago

I believe this applies to everyone's account now. You can open a PR that can parse the Ads export instead

jmorgannz commented 7 months ago

I'm really sick and can't code like that right now. I really hope someone else is up to the job because I really want to keep my history.