how many fps does a webp video have?

I have this code that converts a webp file to x265 video but I have not found a way to save what fps each webp file has, so I set all files to 30 = fps by default

I would like to know if someone achieved a code that could determine how many fps a webp file has

That sounds like a job for FFMPEG. You can call on it from Python code, and ffprobe can produce JSON output.

Aye. I use this incantation myself:

 argv = [
       ffprobe_exe, '-v', '0', '-print_format', 'json', '-show_format',
       '-show_streams', '-show_programs', '-show_chapters', '-i', input_file
 ]

then use json.loads on the returned JSON.