def extractClips(self, specsFilePathOrStr, outputDir=None, zipOutput=False):
clips = SpecsParser.parse(specsFilePathOrStr)<EOL>if not outputDir:<EOL><INDENT>outputDir = os.path.abspath('<STR_LIT:.>')<EOL><DEDENT>zipFile = None<EOL>if zipOutput:<EOL><INDENT>bname = os.path.splitext(os.path.basename(specsFilePathOrStr))[<NUM_LIT:0>]<EOL>zipPath = "<STR_LIT>" % bname<EOL>zipFile = zipfile.ZipFile(os.path.join(outputDir, zipPath), mode='<STR_LIT:w>')<EOL><DEDENT>for i, clip in enumerate(clips):<EOL><INDENT>filenameFormat = '<STR_LIT>' % len(str(len(clips)))<EOL>filepath = os.path.join(outputDir, filenameFormat % (i+<NUM_LIT:1>))<EOL>clipData = self._extractClipData(clip)<EOL>with open(filepath, '<STR_LIT:wb>') as f_out:<EOL><INDENT>f_out.write(clipData)<EOL><DEDENT>if zipFile:<EOL><INDENT>zipFile.write(filepath, arcname=os.path.basename(filepath))<EOL>os.unlink(filepath)<EOL><DEDENT><DEDENT>if zipFile:<EOL><INDENT>zipFile.close()<EOL><DEDENT>
Extract clips according to the specification file or string.

        Arguments:
            specsFilePathOrStr (str): Specification file path or string
            outputDir (str): Location of the extracted clips
            zipOutput (bool): Archive extracted clips' flag

        Specifications format:
            <begin:seconds> <end:seconds> [<text_metadata>]

            20.5    59.75   Discussion about dogs
            105.3   200.3   Cat story

        Notes:
            <text_metadata> is completely optional