Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webvtt errors #150

Open
gumaerc opened this issue Jul 14, 2021 · 0 comments
Open

webvtt errors #150

gumaerc opened this issue Jul 14, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@gumaerc
Copy link
Contributor

gumaerc commented Jul 14, 2021

This may be an issue with the source data, but in recent full conversion runs of all courses I have seen a number of SRT -> VTT conversion errors like this:

webvtt.errors.MalformedFileError: The file does not have a valid format.
This file is malformed and cannot be converted to vtt 7.012-2004-L09.srt. The file does not have a valid format.
Traceback (most recent call last):
  File "/home/gumaerc/Code/ocw-data-parser/ocw_data_parser/utils.py", line 317, in convert_to_vtt
    webvtt.from_srt(Path(temp_dir) / "data").save()
  File "/home/gumaerc/.cache/pypoetry/virtualenvs/ocw-data-parser-0hl9ca1d-py3.9/lib/python3.9/site-packages/webvtt/webvtt.py", line 48, in from_srt
    parser = SRTParser().read(file)
  File "/home/gumaerc/.cache/pypoetry/virtualenvs/ocw-data-parser-0hl9ca1d-py3.9/lib/python3.9/site-packages/webvtt/parsers.py", line 25, in read
    self._validate(content)
  File "/home/gumaerc/.cache/pypoetry/virtualenvs/ocw-data-parser-0hl9ca1d-py3.9/lib/python3.9/site-packages/webvtt/parsers.py", line 144, in _validate
    raise MalformedFileError('The file does not have a valid format.')

We should do a cursory investigation of some of the files throwing these errors and see if the issue is actually malformed SRT files or if there is something else causing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant