lay295 / TwitchDownloader

Twitch VOD/Clip Downloader - Chat Download/Render/Replay
MIT License
2.52k stars 259 forks source link

Using TwitchDownloaderCore from another application #1044

Open suzuki3jp opened 2 months ago

suzuki3jp commented 2 months ago

Checklist

Write stuff here

I am considering creating an application that integrates various features such as downloading VODs, downloading chats, and more. This application will be built with Electron + React.

I wanted to use various features of TwitchDownloader from this application, so I decided to download TwitchDownloaderCLI and execute its exe file from a Node.js process. Most of the features are available in TwitchDownloaderCLI, but some functionalities (such as GetGqlVideos) are not documented in TwitchDownloaderCLI. However, I want to use features like GetGqlVideos that are included in TwitchDownloaderCore.

To use the functionalities included in TwitchDownloaderCore from another language application, do I have to create my own C# CLI application containing TwitchDownloaderCore and build it into an exe file? I am not very familiar with C# as I usually develop in JavaScript and TypeScript, so creating a CLI project on my own is quite challenging for me.

Please let me know if there is something I missed in the documentation or if there is another way to use TwitchDownloaderCore. I'm sorry if the text was unclear due to the translation.

ScrubN commented 1 month ago

Sorry for the late response.

Many of the TwitchDownloaderCLI wrappers opt to reimplement the informational requests from TwitchDownloaderCore in their app's language. You technically can interop with TDCore from JS if it is compiled via web assembly, but performance would likely suffer. Another option is exporting certain TDCore functions with the DLLExport package in your own fork.

I do want to expose functions such as GetGqlVideos to the user for an all-in-one CLI experience, however I am unsure about exposing the raw responses for scripts as well. Perhaps it is something worth looking into.

suzuki3jp commented 1 month ago

It seems quite difficult, but I will look into using DLLExport. If you decide to expose TwitchDownloaderCore like TwitchDownloaderCLI, please let me know.

I am a video editor, and this application has helped me a lot. Thank you.