Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- here's my thoughts about downloading the images from deleted posts:
- - whenever we have a deleted post (gives us an ERROR in the API), mark down the post #
- - after we finish downloading all the working posts and images, we go through our list of deleted posts and get the image #s for the posts before and after it. we will call these 'boundary posts'
- - if we say that our deleted post is post #n, then we can create an [inclusive] range of numbers 'r' where there *may* be images we can recover. this range can be defined as being between the highest image # + 1 (due to the inclusive nature of our range) of the post #(n-1) and the lowest image # - 1 in the post #(n+1). if one of the two is a youtube link and not an image post, we either increase or decrease our boundary post #s by 1, based on which side of the range they're on (i.e. if post #(n-1) is a youtube link, we can make that boundary post #(n-2) instead)
- - now that we have our range of potential image numbers, we can cycle through each number, trying every possible image extension (probably just jpg, jpeg, png, and gif)
- - if one doesn't throw a 404 (or whatever response it gives us for an unknown file, haven't checked yet), then we create a folder for post #n, and throw it in there
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement