Snapchat download all memories at once
Asked Answered
P

2

10

Over the years on snapchat I have saved lots of photos that I would like to retrieve now, The problem is they do not make it easy to export, but luckily if you go online you can request all the data (thats great)

I can see all my photos download link and using the local HTML file if I click download it starts downloading.

Here's where the tricky part is, I have around 15,000 downloads I need to do and manually clicking each individual one will take ages, I've tried extracting all of the links through the download button and this creates lots of Urls (Great) but the problem is, if you past the url into the browser then ("Error: HTTP method GET is not supported by this URL") appears.

I've tried a multitude of different chrome extensions and none of them show the actually download, just the HTML which is on the left-hand side.

Here is what the local file looks like

The download button is a clickable link that just starts the download in the tab. It belongs under Href A

I'm trying to figure out what the best way of bulk downloading each of these individual files is.

Partook answered 6/4, 2020 at 11:22 Comment(0)
A
13

So, I just watched their code by downloading my own memories. They use a custom JavaScript function to download your data (a POST request with ID's in the body).

You can replicate this request, but you can also just use their method. Open your console and use downloadMemories(<url>)

Or if you don't have the urls you can retrieve them yourself:

var links = document.getElementsByTagName("table")[0].getElementsByTagName("a");
eval(links[0].href);

UPDATE

I made a script for this: https://github.com/ToTheMax/Snapchat-All-Memories-Downloader

Avellaneda answered 6/4, 2020 at 12:21 Comment(5)
Hey! Thanks for the reply. Your second bit of code works perfectly. Should I just make it so it does + 1 each time it is entered ? Im unfamiliar. I know if change the evaluate link [0] to [1] it does the second one etc etc. So what would be the quickest way of increasing that number ?Partook
Yes a loop is perfect in this case! I quickly tried making one but my browser limits the number of synchronous downloads. Some kind of timeout is needed which checks if the previous download succeeded before starting the next download. I don't have time tonight to make a working script but if you are interested I will come back to it!Avellaneda
Thank you very much man! I made a loop, and instead I used Safari which gets rid of that annoying multiple download limit! xD I figured it out with your help. Thanks very much. Have a lovely evening/dayPartook
Ah nice to hear! No problem :)Avellaneda
Is there a possibility in javascript to define the file name before saving? it would be nice to save the files with the capture-date to sort them? what you think? - OK I see in your node app, you do exactly this.. hehe thx!Constitutionality
A
4

Using the .json file you can download them one by one with python:

req = requests.post(url, allow_redirects=True)
response = req.text
file = requests.get(response)

Then get the correct extension and the date:

day = date.split(" ")[0]
time = date.split(" ")[1].replace(':', '-')
filename = f'memories/{day}_{time}.mp4' if type == 'VIDEO' else f'memories/{day}_{time}.jpg'

And then write it to file:

with open(filename, 'wb') as f:
    f.write(file.content)

I've made a bot to download all memories.

You can download it here

It doesn't require any additional installation, just place the memories_history.json file in the same directory and run it. It skips the files that have already been downloaded.

Arwood answered 10/8, 2020 at 19:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.