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

Missing Downloader implementations #1159

Open
aratare-jp opened this issue Mar 9, 2024 · 2 comments
Open

Missing Downloader implementations #1159

aratare-jp opened this issue Mar 9, 2024 · 2 comments
Labels
question Not really an issue, but more of a question about how something works

Comments

@aratare-jp
Copy link

Hello there.

First of all, thanks a lot for this tool. I've been looking into using this for some of my personal projects and it has proven to be really great, despite the lack of tutorials/docs which makes things harder to understand for new people like me.

Anyway, onward to the actual question: I notice that, by default, there is no implementation class for Downloader, and it threw me off quite a bit when I wanted to parse a Youtube video URL with a YoutubeStreamExtractor.

I managed to find this in NewPipe and had to C&P it over and remove all of the Android-related code. So all is well now, but is there a reason for this?

@AudricV
Copy link
Member

AudricV commented Mar 9, 2024

I've been looking into using this for some of my personal projects and it has proven to be really great, despite the lack of tutorials/docs which makes things harder to understand for new people like me.

If you have some ideas or suggestions, or even if you want to contribute on that, free feel to open issues :)

is there a reason for this?

Yes, the goal of the Downloader interface is to not depend on a specific network stack.

I managed to find this in NewPipe and had to C&P it over and remove all of the Android-related code.

You could have looked at the extractor test implementation instead (note that the 429 HTTP response code handling is a very bad way to handle captcha responses at the moment, in the app and in the extractor).

Anyway, is the documentation of the Downloader class not enough to let you easily create an implementation?

@AudricV AudricV added the question Not really an issue, but more of a question about how something works label Mar 9, 2024
@aratare-jp
Copy link
Author

aratare-jp commented Mar 10, 2024

If you have some ideas or suggestions, or even if you want to contribute on that, free feel to open issues :)

Yes I'm thinking about adding a new How-to section into the doc. This can be dedicated for different how-tos like fetching channels, video stream URLs, etc. Do let me know if you think this is helpful or not.

Yes, the goal of the Downloader interface is to not depend on a specific network stack.

I understand that. My question was more about why there wasn't any "default" implementation of this so that people can use it out of the box. It actually took me a while to know that there wasn't one provided.

is the documentation of the Downloader class not enough to let you easily create an implementation?

Create an implementation: yes. Create an implementation that works properly: not so easily.
For example, from the DownloaderImpl class within NewPipe, the execute function needs to set specific headers, handle ReCaptcha, set cookies, etc. in order to, my guess is, fetch stuff properly from Youtube. These little things are hard to know when one's required to create an implementation from scratch when they just want to make use of the library to fetch a streamable URL, for example. At least for me, it was not easily enough that I ended up choosing to C&P the class from NewPipe over, rather than creating one from scratch.

I think just a standard YouTubeDownloader or something would be something very beneficial to have in the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Not really an issue, but more of a question about how something works
Projects
None yet
Development

No branches or pull requests

2 participants