2020-09-30 22:03:29 +00:00
|
|
|
'''
|
|
|
|
This file is the WSGI entrypoint for remote / production use.
|
2021-01-29 00:46:54 +00:00
|
|
|
Note that YCDL currenty features no authentication, so using it remotely without
|
|
|
|
another kind of access control is probably a bad idea!
|
2020-09-30 22:03:29 +00:00
|
|
|
|
|
|
|
If you are using Gunicorn, for example:
|
|
|
|
gunicorn ycdl_flask_prod:site --bind "0.0.0.0:PORT" --access-logfile "-"
|
|
|
|
'''
|
|
|
|
import werkzeug.middleware.proxy_fix
|
|
|
|
|
|
|
|
import ycdl
|
2021-04-26 01:02:26 +00:00
|
|
|
import youtube_credentials
|
2020-09-30 22:03:29 +00:00
|
|
|
|
2021-09-09 02:33:05 +00:00
|
|
|
from ycdl_flask import backend
|
2020-09-30 22:03:29 +00:00
|
|
|
|
|
|
|
backend.site.wsgi_app = werkzeug.middleware.proxy_fix.ProxyFix(backend.site.wsgi_app)
|
|
|
|
|
|
|
|
site = backend.site
|
2021-01-29 00:46:54 +00:00
|
|
|
site.debug = False
|
2020-09-30 22:03:29 +00:00
|
|
|
|
|
|
|
# NOTE: Consider adding a local .json config file.
|
2021-04-26 01:02:26 +00:00
|
|
|
youtube_core = ycdl.ytapi.Youtube(youtube_credentials.get_youtube_key())
|
2020-09-30 22:03:29 +00:00
|
|
|
backend.common.init_ycdldb(youtube_core, create=False)
|
|
|
|
backend.common.start_refresher_thread(86400)
|