Feat: Add Snapchat import adapter#1342
Open
jakobbjelver wants to merge 1 commit into
Open
Conversation
|
I can attest to this I just used the source from the merging repo to import ~18gb of snapchat memories to my 2.7.5 instance. Thank you so much that would've been a pain! |
|
I saw a recent release of https://github.com/leofleischmann/chats-and-memories-vault-for-snapchat-export that I used last month for this. That new release allows to sync to an existing immich server, instead of having one created with the docker compose, and then having to use immich go to copy from server to server (like I did). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the light of Snapchat's more or less recent changes to included free cloud storage (from unlimited to 5 GB), more people are looking to make the switch in order to avoid losing their media library or pay the monthly subscription fee to Snapchat - effective September 2026.
Some projects targeted for this already exist, but they are either broken, paid/closed source, Windows-only, or lacks crucial features. And none are of course compatible with Immich (as far as I know).
I believe adding a Snapchat adapter to immich-go, which otherwise is a great tool for getting started and making the switch to Immich, is a valid and timely addition.
Since the Snapchat "My Data" export data structure is not as straightforward as the Google Photos "Takeout" feature's is, this was a bit more complicated to accomplish - this is why my assessment concluded a Snapchat adapter would be the most natural approach. Also, the standard duplicate detection was found to be insufficient - most likely because of how Snapchat differs in how it saved to the local camera roll and to its own cloud storage - which was fixed with an optional option/parameter:
--conservative-duplicateswhich worked for my case.The following code written with assistance from an AI agent, since I myself am not literate in the Go language. But I do work as a software engineer, so I can vouch for its consistency in terms of general code quality. Although I would appreciate someone sufficient in the language and framework to give some feedback or corrections. I could have just kept it for myself, since it helped me successfully migrate my Snapchat library to Immich, but since I enjoyed this project so much for my initial Google Photos migration, I wanted to give back to it.
I hope this can be useful for someone else out there with the same circumstances as me.
Summary
upload from-snapchatarchive from-snapchatjson/memories_history.json, map metadata by bothsidandmid, and import Memories media frommemories/*-main.*.-overlay.pnginto corresponding-mainmedia (images in-process, videos via ffmpeg), with safe fallback to main media when merge fails.Duplicate detection improvements
--conservative-duplicatesmode for upload.YYYY-MM-DD_<id>-main.ext↔ serverSnapchat-*Tracking and stability fixes
snapchat-merged:<source>:mergedSetProcessed: asset not founderrors for merged assets seen in previous logs.Tests
sidandmidNotes from dry-run validation
SetProcessed/SetDiscarded/SetError: asset not foundtracker errorsserver has duplicateevents observed at scale)--dry-run.Example usage