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

Reading the Metadata #3

Closed
Vyrill opened this issue Aug 4, 2017 · 6 comments
Closed

Reading the Metadata #3

Vyrill opened this issue Aug 4, 2017 · 6 comments

Comments

@Vyrill
Copy link

Vyrill commented Aug 4, 2017

Hi, I have a few WebVtt files which have metadata at the beginning which looks like this
WEBVTT Kind: captions Language: en Style: ::cue(c.colorCCCCCC) { color: rgb(204,204,204); } ::cue(c.colorE5E5E5) { color: rgb(229,229,229); } ##
caption.start throws an error : webvtt.exceptions.MalformedCaptionError: Caption missing timeframe in line 2.

I have too many files so cannot edit them manually to read the file. Can you please help ?

@glut23
Copy link
Owner

glut23 commented Aug 5, 2017

Hi @Vyrill, I will have a look at this, thank you for reporting it.

@glut23
Copy link
Owner

glut23 commented Aug 8, 2017

Hi @Vyrill I just released 0.3.1 that will allow you to parse caption files containing metadata headers. Please let me know if you have any further issues. Thanks.

@glut23 glut23 closed this as completed Aug 8, 2017
@Vyrill
Copy link
Author

Vyrill commented Aug 8, 2017

Hi ,
I upgraded to 0.3.1 , but I'm still getting the error , attached is the screen shot of the vtt file the error for the following script :

webvtt = WebVTT().read('filename.en.vtt') for caption in webvtt: if "word" in caption.text: print(caption.start)

Thanks !
vtt

traceback

@glut23
Copy link
Owner

glut23 commented Aug 9, 2017

Hi @Vyrill looking at the file you are trying to parse it looks like the issue is with the Style metadata header as it contains multiple lines (not allowed based on the specifications). I implemented this based on the following specs from 2015:
https://www.w3.org/TR/2015/WD-webvtt1-20151208/#webvtt-metadata-header

Metadata headers are not part of the latest specs for WebVTT format. Anyway I will make the changes to be able to read captions files with this kind of headers.

@glut23
Copy link
Owner

glut23 commented Aug 11, 2017

Hi @Vyrill I released 0.3.2 that will fix the issue with metadata headers in more than one line. Thanks.

@Vyrill
Copy link
Author

Vyrill commented Aug 14, 2017

Hi @glut23 , Thank you so much ! This now works just perfect !

@Vyrill Vyrill closed this as completed Aug 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant