I want to check the audio or video file duration in python. Basically I am working on a platform similar to TikTok, where the user has restrictions for uploading the video or audio of a specific duration. I need to develop a web API that will access the file posted and check first of all, whether the uploaded file is a video or audio, I have achieved this using the library https://pypi.org/project/filetype/ Now I want to check whether the uploaded content has the time duration less than or equal to 1 minute and 30 seconds. How can I achieve this?
Thanks in advance.