Not knowing the format of these Facebook posts, there is one thing I would like to suggest and that is to extend the checks for duplicate files.
Currently you check if this run of the script wants to reuse the same filename, but there is no check whether any given file is already existing from a previous run. In other words, you’re currently running the risk of overwriting previous runs of your script without any warnings.
You could potentially also look into some format conversion if that is applicable, but getting started is half the work, so keep at it. When you got something which you feel workable, feel free to post it with an explanation in Share & showcase .
Sir, I have exactly the same problem. Many chaotic fb posts and comments. But I can’t code. Is there a tutorial for newbies on how to do what you accomplished here? Thx!