According to https://specifications.freedesktop.org/trash-spec/trashspec-latest.html [free desktop . org], every file in the Trash/Recycle bin MUST have a corresponding .trashinfo file in $TRASH/info/ with the original path+filename of the file and the deletion date in YYYY-MM-DDThh:mm:ss format.
Again, someone’s homemade script probably does not do this, but if you’re reading this, your next script should follow the standard to allow easier recovery.
*If* this is followed, it should be possible to write a “mass undelete” script to put all the files that are currently in the Trash/Recycle bin back in their original spots