'Search for subtitle files. Right now only VobSub is supported'

def _find_subtitles(self, filename):

    base = os.path.splitext(filename)[0]
    if (os.path.isfile((base + '.idx')) and (os.path.isfile((base + '.sub')) or os.path.isfile((base + '.rar')))):
        file = open((base + '.idx'))
        if (file.readline().find('VobSub    index    file') > 0):
            for line in file.readlines():
                if (line.find('id') == 0):
                    sub = core.Subtitle()
                    sub.language = line[4:6]
                    sub.trackno = (base + '.idx')
                    self.subtitles.append(sub)
        file.close()
