-
Notifications
You must be signed in to change notification settings - Fork 73
Add alternative captions retrieval method #8
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
base: master
Are you sure you want to change the base?
Conversation
Also used an xml parser lib instead of scraping xml by hand, pls check it out. I'm not sure about |
|
||
// * ensure we have access to captions data | ||
if (!decodedData.includes('captionTracks')) | ||
throw new Error(`Could not find captions for video: ${videoID}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this error need to continue existing if there's nothing alternative found?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I check and throw from this alternative method, but it might be a good thing to check here as well to reduce coupling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bel0v how to avoid throwing error at all?
Are you interested in maintaining this library? We are not currently using it in production, so it is easy to lose track of if it's working correctly |
@Haroenv do you mind if i refactor the whole thing if I do? :) |
That's fine, knowing that I'm not too sure i'll find time to properly review this |
Hi! thanks for the lib.
captionTracks
method doesn't work for some videos, tho.After some investigation I found there is an alternative solution. So I added code to fallback to that.
Tested on this video:
https://www.youtube.com/watch?v=62xdACKITrE
It seems that it has to do with modern html5 captions, or sth like that. Cheers!