aquelemiguel / parrot

🦜 A hassle-free, highly performant, self-hosted Discord music bot with YouTube and Spotify support. Powered by yt-dlp.
MIT License
136 stars 44 forks source link

System call to Python dependency #235

Open Educorreia932 opened 1 year ago

Educorreia932 commented 1 year ago

🧐 Rationale

Remove dependency on Python's yt-dlp.

📝 Description

Currently, yt-dlp package is being used to download YouTube videos, both requiring a Python dependency and a system call.

https://github.com/aquelemiguel/parrot/blob/437e8b284811de35284b2b1d906982a1802f97a4/src/sources/youtube.rs#L60

However, there is a crate for Rust that achieves the same purpose. It's still a work in progress, but might be a fitting replacement in the future.

joao-conde commented 1 year ago

Looks promising, we'll look into it. Thank you!

mustafasegf commented 1 year ago

This seems interesting. I want to check if rustube can replace yt-dlp. Can I try to implement it or are you in the middle of trying it?

joao-conde commented 1 year ago

@mustafasegf go ahead, give it a try and if it works tag us in a PR

mustafasegf commented 1 year ago

little but update on the issue. Rustube right now can't send stream data to stdout. The metadata it get also not complete yet. So i can't integrate rustube for now. I'm thinking to try add those feature to rustube first

afonsojramos commented 1 year ago

While we do not have a rust-native alternative: We don't really need Python. We can shift to using the binaries directly. Should be as easy as adding them to the PATH and we're good to go. I suppose that the Python install is easier for anyone to replicate, but we can just as easily create a curl command to fetch yt-dlp. This could also prevent issues like #242 by fixing to a specific version of the dependency, making upgrades a manual process.