How to recover a deleted file which is open in QuickTime?

I don't know in what location Quicktime has stored the file. However, a possible workaround to obtain a copy of the video is to start a screen recording and record it while it plays.

To be safe I would not use Quicktime to record the screen. I am not sure if it will keep the video you're trying to recover open. Instead download some other screen recording software (e.g. OBS Studiono affiliation) and use that to record the screen while the video plays.