-
-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import watch history from Youtube. #6408
Comments
Could you please share an example file? (It's sufficient if you remove anything but a single video) |
@Bnyro json option looks like this (by default html exports): [{
"header": "YouTube",
"title": "Watched MASTER BOOT RECORD - CPU",
"titleUrl": "https://www.youtube.com/watch?v\u003dRNOUJZlR0p4",
"subtitles": [{
"name": "MASTER BOOT RECORD",
"url": "https://www.youtube.com/channel/UCEVndLRqBDNcZhBdWo5oepg"
}],
"time": "2024-09-03T17:58:45.124Z",
"products": ["YouTube"],
"activityControls": ["YouTube watch history"]
},{
"header": "YouTube",
"title": "Watched ",
"titleUrl": "https://www.youtube.com/watch?v\u003daUG--f5qZjo",
"subtitles": [{
"name": "made from dreams",
"url": "https://www.youtube.com/channel/UCI7ZJqTa3KZ_BzU24O3ex8w"
}],
"time": "2024-09-03T16:14:01.445Z",
"products": ["YouTube"],
"activityControls": ["YouTube watch history"]
}] |
That export would be importable without any thumbnails just fine, but if we want the thumbnails we would need to do one API request per video to get additional info such as the thumbnail, duration and channel avatar which will make the import very slow and unreliable. Alternatively, we can "guess" the thumbnail URLs such as That way everything would be there except for
If that's okay for you, I'll probably implement that before the next release - otherwise I think we should drop this feature because I doubt that doing one API request per video import will work well and would be worth it, we've already had several issues doing so when importing playlists. |
Honestly that sounds fine, if you wanna give it the green light I feel like that should be sufficient. |
The timestamp YouTube provides is the time you watched the video - not the time it got uploaded, so we're missing that field too :/ So we can import (tested with your sample)
|
An error occurs when importing |
When importing what? |
I've successfully tested the file above. |
I tried json and html formats, it gives an error |
@Notesure did you change the format before exporting? |
I have imported Json and html kotlinx.serialization.json.internal.JsonDecodingException: Unexpected JSON token at offset 0: Expected start of the array '[', but had '<' instead at path: $ |
It only supports JSON imports, not HTML. |
But still there is an error, maybe my watch history is too long |
That's HTML what you inserted there ... |
kotlinx.serialization.MissingFieldException: Field 'subtitles' is required for type with serial name 'com.github.libretube.obj.YouTubeWatchHistoryFileItem', but it was missing at path: $[0] |
@Bnyro I just tried it and I have the same error... It turns out, that for private videos the scheme is like this. Sorry for misleading {
"header": "YouTube",
"title": "Watched https://www.youtube.com/watch?v\u003d2TXxQQ9ImKU",
"titleUrl": "https://www.youtube.com/watch?v\u003d2TXxQQ9ImKU",
"time": "2023-02-10T21:58:42.390Z",
"products": ["YouTube"],
"activityControls": ["YouTube watch history"]
} |
I used genson on my watch-history.json file and it produced this json schema: schema.json |
I assume we should just skip all private videos? They can't be watched via LibreTube anyways. |
I think so, anyway, there is no information about them in the file except for the link |
Describe your suggested feature
Not sure if this has been discussed before, I searched for it in closed and open issues and didn't find any mention of it. Sorry if i missed it.
Feature request for importing Youtube watch history.
I see the current in app watch history implementation has certain "keys" such as "uploadDate", "uploader", "uploaderUrl", "uploaderAvatar", "thumbnailUrl" and "duration watched"
The Youtube .csv only contains some basic "keys" - "header", "url", "titleURL", "title" and "name".
Idk if certain parts can be omitted and still have a functional watch history or if this would require refactoring the entire watch history feature.
Other details
No response
Acknowledgements
The text was updated successfully, but these errors were encountered: