stops processing multiple files on pysubs2.exceptions.UnknownFPSError
Open
Nobody has claimed this yet.
bug
- Dominant language
- Python
- Stars
- 7.9k
- Forks
- 323
- PR merge metrics
- No merged PRs in 30d
Description
multiple bugs here
expected:
- show a warning, continue to process other subtitle files
- print filename of the problematic subtitle file
- in *.sub files, parse FPS from
{1}{1}25.0etc (not from first line)
$ ffs --version
ffsubsync 0.4.22
$ ffs --overwrite-input movie.mp4 -i *.srt *.sub
...
Traceback (most recent call last):
File "/lib/python3.10/site-packages/pysubs2/microdvd.py", line 38, in from_file
fps = float(text)
ValueError: could not convert string to float: 'Advertise your product or brand here|contact www.OpenSubtitles.org today\r'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
...
File "/lib/python3.10/site-packages/pysubs2/microdvd.py", line 42, in from_file
raise UnknownFPSError("Framerate was not specified and "
pysubs2.exceptions.UnknownFPSError: Framerate was not specified and cannot be read from the MicroDVD file.
problematic subtitle file
$ head -n3 "The.Unbearable.Lightness.Of.Being.1988.en.156226.sub"
{25}{175}Advertise your product or brand here|contact www.OpenSubtitles.org today
{496}{567}[Bell Tolling]
{568}{642}[Pigeons Cooing]
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ffs command path that processes multiple subtitle inputs and the pysubs2/microdvd.py traceback shown in the issue. Reproduce with the provided *.srt and *.sub command and the sample MicroDVD file. Done means an invalid subtitle produces a warning with its filename, other files continue processing, and FPS is read from a valid frame line such as {1}{1}25.0.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100