cdown / srt

A simple library and set of tools for parsing, modifying, and composing SRT files.
MIT License
473 stars 44 forks source link

Keep getting "expected string or bytes-like object" error #47

Closed arashmath closed 5 years ago

arashmath commented 5 years ago

Hi. While using this library on both English and Farsi subtitles, I keep getting the error in the picture. Can you help me with that? Thank you. 11

cdown commented 5 years ago

As the error message says, srt.parse takes a string, not a file object.

You need sub = srt.parse(file.read())

arashmath commented 5 years ago

As the error message says, srt.parse takes a string, not a file object.

You need sub = srt.parse(file.read())

Thank you so much for your help.

cdown commented 5 years ago

No worries! 1fbe58e1ee93096068e656ae7d1631afc386f839 will also allow this in next srt release.