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

CLI support for websites #28

Open
nichwall opened this issue Jun 12, 2020 · 6 comments
Open

CLI support for websites #28

nichwall opened this issue Jun 12, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@nichwall
Copy link

Attempting to download a show from animefreak using the CLI causes errors, but seems to work with the GUI. This appears to be because Anime_Downloader.py only imports scrapers.nineanime and does not check which scaper to use for different links inside of the main function.

@Oshan96 Oshan96 added the invalid This doesn't seem right label Jul 9, 2020
@Oshan96
Copy link
Owner

Oshan96 commented Jul 9, 2020

First of all, sorry for the very late reply.
And yes, CLI only supports 9anime download. The thing is though it is quite easy for me to add support for all the websites through CLI as well, almost everyone using monkey-dl uses the GUI. So I didn't want to maintain another CLI version for all the websites. However, I have kept the ability to use it or 9anime for the users who were using it.

If somehow it is required by more people, I will add functionality for CLI as well.

@Oshan96 Oshan96 closed this as completed Jul 9, 2020
@nichwall
Copy link
Author

nichwall commented Jul 9, 2020

Ah, no worries. I did end up using the GUI, so it worked out. If that's the case, it would be handy if the documentation mentioned that the CLI only supports 9anime, and to use the GUI for other sites. The README makes it sound like you can use either for any of the supported sites.

Is there a reason you didn't write it as a CLI and then the GUI just being a wrapper? I'd be interested in helping with that, but depends on how much would need to be rewritten.

@Oshan96
Copy link
Owner

Oshan96 commented Jul 9, 2020

Yes, I have edited the readme already in the dev branch just not in the current master :D

This is originally a CLI and yes, it has then GUI been wrapped around it. However as I added more website support (after GUI) I quite didn't add the same website support for CLI. However, if it's needed to add all the website supported using CLI, it will be easy (you just have to add another parameter to the CLI commands list to input the website (and other new functionalities added)). Almost same as GUI work since I have used the same format for both.

Have a look at it! :D Another dev will really help in maintaining this since I have been busy. Also, you don't have to actually rewrite many things, just add some more parameters and call the relevant scraper as for that :D

@Oshan96 Oshan96 changed the title CLI only works with 9anime CLI support for websites Jul 9, 2020
@Oshan96 Oshan96 added enhancement New feature or request and removed invalid This doesn't seem right labels Jul 9, 2020
@Oshan96 Oshan96 reopened this Jul 9, 2020
@nichwall
Copy link
Author

nichwall commented Jul 9, 2020

Cool, sounds like fun.

Is the dev branch in a state where I can make a branch from there and then make a PR, or do you have local changes that have not been pushed?

@Oshan96
Copy link
Owner

Oshan96 commented Jul 10, 2020

Nope, you can use the dev branch to start working on it. I will only be working on the update files and scrapers :D

Edit: If you're to implement any new features, open an issue first so we can keep track of them :)

@nichwall
Copy link
Author

The entire CLI functionality was removed in 4ee3c33. It also looks like you're putting everything into one file (gui/GUI.py), which will lead to a lot of code duplication to include the CLI.

To clean up the code a bit, I think it would be worth it to move the download function found in gui/GUI.py to the Downloader class. You could then pass the entire values dictionary to the Downloader class to simplify parsing and make it easy to keep the CLI and GUI with the same functionality, because you could just pass the same flags with CLI as the value fields in the GUI.

I am attempting this change and will let you know how it works out.

@nichwall nichwall mentioned this issue Jul 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants