1
0
Fork 0

Load Instagram backup post list

This commit is contained in:
Sjors Provoost 2024-08-31 19:29:32 +02:00
parent 1547b9b201
commit d24980e1e6
Signed by: sjors
GPG key ID: 57FF9BDBCC301009
2 changed files with 23 additions and 3 deletions

View file

@ -13,10 +13,16 @@ git clone https://git.sprovoost.nl/instablossom.git
cd instablossom cd instablossom
``` ```
Download your Instagram archive and unzip it.
Run the script: Run the script:
```sh ```sh
deno run --allow-net main.ts deno run --allow-read --allow-net main.ts
``` ```
It will prompt for your nsec and a relay. First it will prompt for the path of your archive.
E.g. `/Users/you/Downloads/instagram-you-2024-01-01-abcdef`
Next it will prompt for your nsec and a relay.

16
main.ts
View file

@ -12,7 +12,21 @@ console.log("\nUse at your own risk!\n");
console.log("Considering trying it out with a throwaway nsec."); console.log("Considering trying it out with a throwaway nsec.");
console.log("All data will be public. Anything you upload is hard to delete.\n"); console.log("All data will be public. Anything you upload is hard to delete.\n");
const nsec_str = prompt("Please enter your nsec:"); const path = prompt("Enter Instagram backup (absolute) path (unzip first): ");
const posts = JSON.parse(await Deno.readTextFile(path + "/content/posts_1.json"));
console.log("Number of posts:", posts.length);
console.log("You can try one picture at a time, duplicates are skipped the next run.");
const n = Number(prompt("How many do you want to upload?", posts.length));
if (n == 0) { Deno.exit(0); }
assert(n > 0);
assert(n <= posts.length);
const nsec_str = prompt("\nPlease enter your nsec:");
// Sanity check format // Sanity check format
NSchema.bech32('nsec').parse(nsec_str); NSchema.bech32('nsec').parse(nsec_str);