this post was submitted on 29 Nov 2021
9 points (100.0% liked)

Lemmy

12468 readers
1 users here now

Everything about Lemmy; bugs, gripes, praises, and advocacy.

For discussion about the lemmy.ml instance, go to !meta@lemmy.ml.

founded 4 years ago
MODERATORS
 

Hi lemmy; I've made a program that will download all the post and images for a lemmy community. It downloads them into a html file. This way users don't have to worry about losing all their post because they can download the whole community themselves.

Demo https://files.catbox.moe/8wgbm4.mp4

I hope someone finds this useful. Someone asked me for it so I provided it.

all 25 comments
sorted by: hot top controversial new old
[–] downdaemon@lemmy.ml 4 points 2 years ago

Thanks for this. It's Thief btw ;-)

[–] nutomic@lemmy.ml 3 points 2 years ago (1 children)

Seems like a very useful project. You can add a link to it in the Lemmy docs if you want.

Btw instead of copy-pasting the structs from Lemmy into your project, you could pull them directly from crates.io. Disadvantage is that it will force you to pull in lot of dependencies that have to be compiled, but that could probably be avoided in the future by adding feature flags to Lemmy crates.

[–] TheImpressiveX@lemmy.ml 2 points 2 years ago

Thanks for creating this!

[–] krolden@lemmy.ml 2 points 2 years ago

Very cool I'll be sure to give this a try when I get a chance.

[–] leslieriver@fapsi.be 2 points 2 years ago (2 children)
[–] masterofballs@wolfballs.com 2 points 2 years ago (1 children)

I put paging back so large communities won't use up to much memory. I made limit optional and it default at 10 so it will download 10 at a time. I like how you changed it to download all images. It's all merged. Gonna try to add a basic license tonight too.

[–] leslieriver@fapsi.be 2 points 2 years ago (1 children)

I put paging back so large communities won’t use up to much memory.

i don't see how that helps since the user has no control over the paging. you're making a lot of additional requests to get the same data

[–] masterofballs@wolfballs.com 1 points 2 years ago* (last edited 2 years ago) (1 children)

You dont want to get 1,000 post in one request. Im not even sure lemmy would allow that. Im not sure what you mean by no control. It’s downloading an entire community.

And yes you want to make additional request so it doesn’t timeout.

[–] leslieriver@fapsi.be 1 points 2 years ago (1 children)

actually lemmy allows getting any number of posts with one request.

[–] masterofballs@wolfballs.com 1 points 2 years ago* (last edited 2 years ago)

I still don’t think it’s a great idea to get an entire large community at once. Ill play with trying an entire large community like memes later when I get a minute. Either way the way I have it you can still specify a really large limit. Pass in 700 and it will attempt 700 at once. Pass in 50 and it will do it in chunks of 50. In either case it will get the entire community and not stop at the number provided .

edit: Manages to get all 601 post from /c/memes in a few seconds. Which is cool. I'm just gonna make the default page size at like 100 instead of 10.

[–] downdaemon@lemmy.ml 1 points 2 years ago

*Thief btw (thanks for making it!)

[–] squashkin@wolfballs.com 1 points 2 years ago (1 children)

so can we do this with our proflies and therefore download all our posts

[–] masterofballs@wolfballs.com 3 points 2 years ago (1 children)

It currently downloads a entire community and not a single user. I guess we could add that if that's more interesting to you.

[–] squashkin@wolfballs.com 1 points 2 years ago (1 children)

could be useful, I back my stuff up prior to posting but also if my computer and backups crashed I guess this would serve as an additional backup

it just downloads the pics and titles right tho, not text within text posts?

[–] masterofballs@wolfballs.com 3 points 2 years ago

Pics title and body. Not any pictures uploaded within the body. And no comments yet. All these could be added.

this does back up the most important bits and was pretty minimal in effort

[–] leslieriver@fapsi.be 0 points 2 years ago (1 children)

looks interesting please add a license

[–] masterofballs@wolfballs.com 1 points 2 years ago (1 children)
[–] leslieriver@fapsi.be 1 points 2 years ago

don't know, i would love to host it somewhere else if i make some changes, anything that permits that will be nice