srt.tools.find

Find subtitles by timestamp.

find_by_timestamp(subs, timestamp_one=datetime.timedelta(0), timestamp_two=datetime.timedelta(0), adjust=False)

Finds subtitles from subtitles by timestamp. When timestamp one > timestamp two, subtitles up to timestamp two and subtitles after timestamp one will be found.

Parameters
  • subsSubtitle objects

  • timestamp_one (datetime.timedelta) – The timestamp to find from.

  • timestamp_two (datetime.timedelta) – The timestamp to find to.

  • adjust (boolean) – Whether to adjust the timestamps of found subtitles.

Return type

generator of Subtitle objects