anonymous-archiver / pastebin-dl

Command line tool for downloading pastes from pastebin.
3 stars 0 forks source link

Repeating Grab requests on pastebins (Feature Request) #6

Open Tumultuous-RGR-SiM opened 4 years ago

Tumultuous-RGR-SiM commented 4 years ago

I think this is how you're asking it to be formatted.

Sometimes, I'll need to use the tool to grab from a pastebin again. Normally, it'll to be grab updated versions of the existing paste, or to grab new pastes that the author has made since my last grab. Or maybe I get a temp IP ban for downloading too many pastes at once and have to download the last 10 or so pastes, but don't want to re-download the other 250 pastes I grabbed.

What will happen if I run the tool again? You mentioned that the paste will be appended. Does that mean that I'll get another full copy of the paste contents in the same .txt file, or does that mean that the paste will update the "retrieved on:" date and just add any updates that were given to the paste?

anonymous-archiver commented 4 years ago

Doing something like skipping a file if it exists or overwriting it would be simple. The difficult part would be if you wanted to do something like only update the file if there was any difference. This means that we'd have to figure out the last update time of the file, the difference in the text on the file and the paste you're looking at and then appending/changing the differences. It may be easier to do a "read the 'last update' date if file exists and overwrite the file if there are differences in the update date" kind of thing. Would need to think and plan out the cases for if the file exists.