I successfully used your first script, but now I'm stuck painstakingly converting all the DDS files back into YTD with RDR2 Texture Toolkit. One at a time. For 2,000 files. This just isn't feasible.
Can you think of a way to automate this, too?
My process is this: open RDR2 Texture Toolkit > New File > Import DDS file(s) > Save as YTD
Even that isn't the whole thing, because you also have to edit the filename when you save it so it matches the original YTD in the mod. It'll take days to do this for every file, and it's not possible to just pick what I need because the names aren't obvious to what item is in game. So close, yet so far.