dankmemer / imgen Goto Github PK
View Code? Open in Web Editor NEWAPI server for image manipulation, focused on Dank Memer (discord bot)
License: MIT License
API server for image manipulation, focused on Dank Memer (discord bot)
License: MIT License
The image commands feel slow and clunky sometimes, especially after running for a while. I also know they aren't all perfect as far as logic.
If you could clean up the server code and/or the code for commands to make it run better, it would be appreciated.
Hacktoberfest peeps welcome!
imgen doesnt create rethinkdb tables wich causes it to fail
Everything is very vague and I'm kind of confused on how the api keys are validated and invalidated. More documentation over how the system works would be appreciated.
I am getting the error:
Symbola' @ warning/annotate.c/RenderType/960.\nconvert: delegate library support not built-in 'Symbola' (Freetype) @ warning/annotate.c/RenderFreetype/1830.\nconvert: no images defined
PNG32:/tmp/tmp20j9s3h8.png' @ error/convert.c/ConvertImageCommand/3282.\n.\n\n.This error can be due to the fact that ImageMagick is not installed on your computer, or (for Windows users) that you didn't specify the path to the ImageMagick binary in file conf.py, or that the path you specified is incorrect","status":500}I installed it correctly. I am using Linux (Ubuntu 18.04)
Python 3.6.9 (default, Apr 18 2020, 01:56:04)
I downloaded this and installed all of the required pip packages. When I do ./start.sh, it says:
[2020-07-21 06:15:02 +0000] [29546] [INFO] Starting gunicorn 20.0.4
[2020-07-21 06:15:02 +0000] [29546] [INFO] Listening at: http://127.0.0.1:65535 (29546)
[2020-07-21 06:15:02 +0000] [29546] [INFO] Using worker: gevent
[2020-07-21 06:15:02 +0000] [29549] [INFO] Booting worker with pid: 29549
[2020-07-21 06:15:02 +0000] [29550] [INFO] Booting worker with pid: 29550
[2020-07-21 06:15:02 +0000] [29551] [INFO] Booting worker with pid: 29551
[2020-07-21 06:15:03 +0000] [29552] [INFO] Booting worker with pid: 29552
[2020-07-21 06:15:03 +0000] [29553] [INFO] Booting worker with pid: 29553
[2020-07-21 06:15:03 +0000] [29554] [INFO] Booting worker with pid: 29554
[2020-07-21 06:15:03 +0000] [29555] [INFO] Booting worker with pid: 29555
[2020-07-21 06:15:03 +0000] [29556] [INFO] Booting worker with pid: 29556
[2020-07-21 06:15:03 +0000] [29557] [INFO] Booting worker with pid: 29557
[2020-07-21 06:15:03 +0000] [29558] [INFO] Booting worker with pid: 29558
[2020-07-21 06:15:03 +0000] [29559] [INFO] Booting worker with pid: 29559
[2020-07-21 06:15:03 +0000] [29560] [INFO] Booting worker with pid: 29560
[2020-07-21 06:15:03 +0000] [29561] [INFO] Booting worker with pid: 29561
[2020-07-21 06:15:03 +0000] [29562] [INFO] Booting worker with pid: 29562
[2020-07-21 06:15:03 +0000] [29563] [INFO] Booting worker with pid: 29563
[2020-07-21 06:15:03 +0000] [29564] [INFO] Booting worker with pid: 29564
[2020-07-21 06:15:03 +0000] [29565] [INFO] Booting worker with pid: 29565
[2020-07-21 06:15:03 +0000] [29566] [INFO] Booting worker with pid: 29566
[2020-07-21 06:15:03 +0000] [29567] [INFO] Booting worker with pid: 29567
[2020-07-21 06:15:04 +0000] [29568] [INFO] Booting worker with pid: 29568
[2020-07-21 06:15:04 +0000] [29570] [INFO] Booting worker with pid: 29570
[2020-07-21 06:15:04 +0000] [29569] [INFO] Booting worker with pid: 29569
[2020-07-21 06:15:04 +0000] [29571] [INFO] Booting worker with pid: 29571
[2020-07-21 06:15:04 +0000] [29572] [INFO] Booting worker with pid: 29572
So, no errors. But, it just stays at that forever until I stop it. I'm not sure if it is supposed to say anything else, though.
The main issue is that the web page is not working. I just get a connection refused error. Any ideas as to why this is happening? And, if you know why and have a solution, please share it. Thanks!
It would greatly help the performance of the image commands if they were clustered. I'm not sure whether the cluster would be of server.js or the individual image commands as I don't have much experience with clustering.
For reference, there are usually 10k-20k image commands ran per day, so single thread is hurting.
I would like to make yall aware ahead of time...
I made a bot.. We had yalls bot in the server and i liked a command called Gay Rate or something of the sort so i coded it in node js... Just so yall knew... Like the bot a lot
I installed rethinkdb, cloned the repo and used pip install requirements.txt
, but when running start.sh, I get this error
Traceback (most recent call last): File "/usr/lib/python3/dist-packages/gunicorn/util.py", line 99, in load_class mod = importlib.import_module('.'.join(components)) File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_impo rt File "<frozen importlib._bootstrap>", line 991, in _find_and_ load File "<frozen importlib._bootstrap>", line 975, in _find_and_ load_unlocked File "<frozen importlib._bootstrap>", line 671, in _load_unlo cked File "<frozen importlib._bootstrap_external>", line 783, in e xec_module File "<frozen importlib._bootstrap>", line 219, in _call_with _frames_removed File "/usr/lib/python3/dist-packages/gunicorn/workers/ggevent .py", line 16, in <module> raise RuntimeError("gevent worker requires gevent 1.4 or hi gher") RuntimeError: gevent worker requires gevent 1.4 or higher ]
Could you help me please ?
I'm running Ubuntu 20.04, and python 3.8.2
hello, where is the imgen database?
Not sure if this is a issue with my setup or what but, I'm getting this error when starting with ./start.sh
[2020-05-25 14:41:02 +0000] [22576] [INFO] Worker exiting (pid: 22576)
[2020-05-25 14:41:02 +0000] [22575] [ERROR] Exception in worker process:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 515, in spawn_worker
worker.init_process()
File "/usr/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 201, in init_process
super(GeventWorker, self).init_process()
File "/usr/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 122, in init_process
self.load_wsgi()
File "/usr/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 130, in load_wsgi
self.wsgi = self.app.wsgi()
File "/usr/lib/python2.7/dist-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/usr/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load
return self.load_wsgiapp()
File "/usr/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
return util.import_app(self.app_uri)
File "/usr/lib/python2.7/dist-packages/gunicorn/util.py", line 366, in import_app
__import__(module)
File "/usr/local/lib/python2.7/dist-packages/gevent/builtins.py", line 96, in __import__
result = _import(*args, **kwargs)
File "/root/imgen/server.py", line 96
return jsonify({"endpoints": [{'name': x, 'parameters': y.params, 'ratelimit': f'{y.rate}/{y.per}s'} for x, y in endpoints.items()]})
Config seems about right.
Sorry but I am confused, I hosted this image gen, what now?
Do you have an ETA for when you will open the website back up for new applications? I really want to use this API for my project.
Thanks
I would like ratelimits per key some how. I plan on giving people keys to use the image server, and I would like a "very ratelimited" kind of key, and a "meh ratelimited" kind of key. Then also a master key with no ratelimits.
Hello, can you create an installation video or give more details about installation? I've installed all the requirements and after I use ./start.sh and accessing /api/crab (for example) it says rethinkdb has no attribute 'table' on line 63 file server.py. I'm using CentOS 6 and Python 3.6.
I saw another issue that had the same problem (#71) and they found that it was caused by an older version of Python (Not running Python 3.6 or newer), but I am running Python 3.6.9.
If you could help that would be great. Thanks!
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
worker.init_process()
File "/usr/local/lib/python3.6/site-packages/gunicorn/workers/ggevent.py", line 162, in init_process
super().init_process()
File "/usr/local/lib/python3.6/site-packages/gunicorn/workers/base.py", line 119, in init_process
self.load_wsgi()
File "/usr/local/lib/python3.6/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
self.wsgi = self.app.wsgi()
File "/usr/local/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/usr/local/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
return self.load_wsgiapp()
File "/usr/local/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
return util.import_app(self.app_uri)
File "/usr/local/lib/python3.6/site-packages/gunicorn/util.py", line 358, in import_app
mod = importlib.import_module(module)
File "/usr/lib64/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/root/imgen/server.py", line 15, in <module>
from dashboard import dash
File "/root/imgen/dashboard.py", line 9, in <module>
from utils.make_session import make_session
File "/root/imgen/utils/make_session.py", line 7, in <module>
from requests_oauthlib import OAuth2Session
File "/usr/local/lib/python3.6/site-packages/requests_oauthlib/__init__.py", line 3, in <module>
from .oauth1_auth import OAuth1
File "/usr/local/lib/python3.6/site-packages/requests_oauthlib/oauth1_auth.py", line 9, in <module>
from requests.compat import is_py3
File "/usr/lib/python3.6/site-packages/requests/__init__.py", line 43, in <module>
import urllib3
File "/usr/lib/python3.6/site-packages/urllib3/__init__.py", line 8, in <module>
from .connectionpool import (
File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 11, in <module>
from .exceptions import (
File "/usr/lib/python3.6/site-packages/urllib3/exceptions.py", line 2, in <module>
from .packages.six.moves.http_client import (
ModuleNotFoundError: No module named 'urllib3.packages.six'
So i'm wondering what method (for the response object) we would need to use after fetching an endpoint with node-fetch
? My friend and I were having troubles with it:
const abandon = await fetch('https://dankmemer.services/changemymind', {
body: JSON.stringify({ text: 'some text args' }),
method: 'POST',
headers: {
'Content-Type': 'application/json'
Authorization: 'absolutely valid meme token'
}
}).then(r => r.whatMethod());
Describe the bug
redis error but it says it only requires rethinkdb?
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Site load and work.
Screenshots
None.
Desktop (please complete the following information):
Additional context
redis.exceptions.ConnectionError: Error 111 connecting to localhost:6379. Connection refused.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.