Hi @Kakulukian @mefengl @balmacefa, here is an initial draft at refactoring to modularize the fetchTranscript method, which allows users to override specific parts -- related to #34.
Using YTTranscript from node or from a server works fine, but in the Obsidian Plugin web-view context, we are getting CORS errors. These changes should allow me to do something like this:
So I can use the obsidian.request module to perform the fetch for the pageBody and for the transcriptBody and continue to use the rest of the functionality as defined.
Also took the opportunity to add a bunch of tests, as I didn't want to break anything (and to also get a better idea of how everything worked). I used the command npm run test to execute all the tests.
Hi @Kakulukian @mefengl @balmacefa, here is an initial draft at refactoring to modularize the
fetchTranscript
method, which allows users to override specific parts -- related to #34.Using YTTranscript from node or from a server works fine, but in the Obsidian Plugin web-view context, we are getting CORS errors. These changes should allow me to do something like this:
So I can use the
obsidian.request
module to perform the fetch for thepageBody
and for thetranscriptBody
and continue to use the rest of the functionality as defined.Also took the opportunity to add a bunch of tests, as I didn't want to break anything (and to also get a better idea of how everything worked). I used the command
npm run test
to execute all the tests.What do you all think?