Beispiel #1
0
    def downloadSubtitle(self, directory_path, file_name):
        """ Download the subtitle. The file is saved under the file_name name
            in the directory_path. The function return True if the download
            succeeded, otherwise, False.
        """
        writeLog(INFO_LOGS.SENDING_SUBTITLE_FILE_REQUEST_FOR_SUBTITLE % 
                 self.info())
        WriteDebug('Sending subtitle file request for: %s' % self.info())
        file_io = getSubProviderByName(self.provider_name)\
            .getSubtitleContent(self)
        if not file_io:
            WriteDebug('Failed getting BytesIO object from the provider.')
            return False

        return GetFile(file_io, directory_path, file_name)