Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

Use Plugin without Anki? #62

Closed
NWuensche opened this issue Jan 3, 2018 · 10 comments
Closed

Use Plugin without Anki? #62

NWuensche opened this issue Jan 3, 2018 · 10 comments

Comments

@NWuensche
Copy link

Hi,

so I'd like to write a CLI-Tool for Anki. However, I can't use the Anki-GUI program itself, because I can't interact with it on the command line. Is there a way that I can still use this plugin, because I really like that you can do curl stuff with it.

Thanks,
Niklas

@FooSoft
Copy link
Owner

FooSoft commented Jan 3, 2018

As long as you can launch the Anki graphical application (e.g. your system is capable of displaying a GUI), you should be able to use the plugin without any problems. Although Anki has to be running in the background, no user interaction is required once the application is launched (the API also includes a way to gracefully exit out).

@NWuensche
Copy link
Author

Thanks for the answer!

But that's the problem for me. I want to run it on my server, where I just have the terminal and nothing more.

@FooSoft
Copy link
Owner

FooSoft commented Jan 3, 2018

That would be a problem -- you can't really run the plugin if you can't run the host application. Admittedly it would not be the fanciest solution, you should be able to run barebones X11 even on a server. It should still be pretty light (don't need a desktop environment or anything), and Anki would still run.

@NWuensche
Copy link
Author

Unfortunately, this doesn't work. I don't have sudo on the server, so I can't install much. And X11 doesn't really work without sudo

@FooSoft
Copy link
Owner

FooSoft commented Jan 3, 2018

Yup, if you don't have sudo you may be out of luck. Another option would be to try to hack the Anki code to make it run without a GUI. This is probably going to be unpleasant, but SO has a thread that implies that you can at least create a QApplication without a GUI: https://stackoverflow.com/questions/13215120/how-do-i-make-python-qt-and-webkit-work-on-a-headless-server

@NWuensche
Copy link
Author

Just fixed my problem by using the web interface directly. If you like, you can find it here: https://github.com/NWuensche/ankicli . Thanks for the help nevertheless.

@FooSoft
Copy link
Owner

FooSoft commented Jan 3, 2018

I would advise against this approach as it can lead to account ban (temporary or otherwise). I've experienced this firsthand working on my extension which did something similar. The author of Anki is actively trying to catch people who are using the web interface through automated means.

@tomasgodoi
Copy link
Contributor

tomasgodoi commented Jan 12, 2018

@NWuensche You can use my Anki docker image at https://hub.docker.com/r/txgio/anki/ to run it without user interface.

@FooSoft FooSoft mentioned this issue Jul 7, 2018
@lamyergeier
Copy link

The author of Anki is actively trying to catch people who are using the web interface through automated means.

@FooSoft Could you please tell what is the reasoning behind that this might bother the author of anki? If its not a security issue, the author should not impose such restriction.

@hbnordin2
Copy link

@anishmittal2020

Anki's free-tier is pretty generous. The author is probably paying for the servers and network traffic to run it. I think they might be trying to avoid having to either scale up or risk being browned out because of bots :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants