简答
下载自动执行此过程的桌面应用程序。
访问downloadmysnapchatmemories.com 下载应用程序。您可以观看this tutorial 指导您完成整个过程。
简而言之,该应用程序会读取 Snapchat 提供的 memories_history.json 文件并将每个记忆下载到您的计算机上。
长答案(上述应用的工作原理)
我们可以遍历您从 Snapchat 下载的数据中找到的 memories_history.json 文件中的每个记忆。
对于每个内存,我们向存储为内存Download Link 的 URL 发出一个POST 请求。响应将是文件本身的 URL。
然后,我们可以向返回的 URL 发出 GET 请求以检索文件。
示例
这是一个使用NodeJS获取和下载单个内存的简化示例:
假设我们在fakeMemory.json 中存储了以下内存:
{
"Date": "2022-01-26 12:00:00 UTC",
"Media Type": "Image",
"Download Link": "https://app.snapchat.com/..."
}
我们可以做到以下几点:
// import required libraries
const fetch = require('node-fetch'); // Needed for making fetch requests
const fs = require('fs'); // Needed for writing to filesystem
const memory = JSON.parse(fs.readFileSync('fakeMemory.json'));
const response = await fetch(memory['Download Link'], { method: 'POST' });
const url = await response.text(); // returns URL to file
// We can now use the `url` to download the file.
const download = await fetch(url, { method: 'GET' });
const fileName = 'memory.jpg'; // file name we want this saved as
const fileData = download.body; // contents of the file
// Write the contents of the file to this computer using Node's file system
const fileStream = fs.createWriteStream(fileName);
fileData.pipe(fileStream);
fileStream.on('finish', () => {
console.log('memory successfully downloaded as memory.jpg');
});