def duration(self):
        """Returns the duration in seconds of this audio or video file"""

        if self.filetype not in ("video", "audio"):
            raise RuntimeError("Only videos and audio have durations")
        return self.info.get("length") or self.info.get("duration")
def duration ( self ) : if self . filetype not in ( "video" , "audio" ) : raise RuntimeError ( "Only videos and audio have durations" ) return self . info . get ( "length" ) or self . info . get ( "duration" )
Returns the duration in seconds of this audio or video file