mirror of
https://github.com/TheCaduceus/FileStreamBot.git
synced 2026-01-15 16:33:25 -03:00
Bump to v1.1
This commit is contained in:
@@ -5,7 +5,7 @@ from .config import Telegram, LOGGER_CONFIG_JSON
|
||||
|
||||
dictConfig(LOGGER_CONFIG_JSON)
|
||||
|
||||
version = 1.0
|
||||
version = 1.1
|
||||
logger = getLogger('bot')
|
||||
|
||||
TelegramBot = Client(
|
||||
@@ -16,4 +16,4 @@ TelegramBot = Client(
|
||||
plugins={"root": "bot/plugins"},
|
||||
workers = Telegram.BOT_WORKERS,
|
||||
max_concurrent_transmissions=1000
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from bot import TelegramBot, logger
|
||||
from bot.server import server
|
||||
from bot.server import run_server
|
||||
|
||||
if __name__ == '__main__':
|
||||
logger.info('Initializing...')
|
||||
TelegramBot.loop.create_task(server.serve())
|
||||
TelegramBot.run()
|
||||
TelegramBot.loop.create_task(run_server())
|
||||
TelegramBot.run()
|
||||
|
||||
@@ -37,11 +37,11 @@ LOGGER_CONFIG_JSON = {
|
||||
}
|
||||
},
|
||||
'loggers': {
|
||||
'uvicorn': {
|
||||
'hypercorn': {
|
||||
'level': 'INFO',
|
||||
'handlers': ['file_handler', 'stream_handler']
|
||||
},
|
||||
'uvicorn.error': {
|
||||
'hypercorn.error': {
|
||||
'level': 'WARNING',
|
||||
'handlers': ['file_handler', 'stream_handler']
|
||||
},
|
||||
@@ -50,4 +50,4 @@ LOGGER_CONFIG_JSON = {
|
||||
'handlers': ['file_handler', 'stream_handler']
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
from quart import Quart
|
||||
from uvicorn import Config, Server as UvicornServer
|
||||
from hypercorn import Config
|
||||
from hypercorn.asyncio import serve
|
||||
from logging import getLogger
|
||||
from bot.config import Server, LOGGER_CONFIG_JSON
|
||||
|
||||
from . import main, error
|
||||
|
||||
logger = getLogger('uvicorn')
|
||||
logger = getLogger('hypercorn')
|
||||
instance = Quart(__name__)
|
||||
|
||||
@instance.before_serving
|
||||
@@ -20,11 +21,9 @@ instance.register_error_handler(404, error.not_found)
|
||||
instance.register_error_handler(405, error.invalid_method)
|
||||
instance.register_error_handler(error.HTTPError, error.http_error)
|
||||
|
||||
server = UvicornServer(
|
||||
Config(
|
||||
app = instance,
|
||||
host = Server.BIND_ADDRESS,
|
||||
port = Server.PORT,
|
||||
log_config = LOGGER_CONFIG_JSON
|
||||
)
|
||||
)
|
||||
async def run_server():
|
||||
config = Config()
|
||||
config.bind = [f'{Server.BIND_ADDRESS}:{Server.PORT}']
|
||||
config.logconfig_dict = LOGGER_CONFIG_JSON
|
||||
|
||||
await serve(instance, config)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@@ -104,7 +103,7 @@
|
||||
|
||||
<script>
|
||||
var player = new Plyr('#stream-media', {
|
||||
controls:['play-large', 'rewind', 'play', 'fast-forward', 'progress', 'current-time', 'mute', 'settings', 'pip', 'fullscreen'],
|
||||
controls:['play-large', 'play', 'current-time', 'mute', 'settings', 'pip', 'fullscreen'],
|
||||
settings:['speed','loop'],
|
||||
speed:{selected:1,options:[0.25,0.5,0.75,1,1.25,1.5,1.75,2]},
|
||||
seek: 10,
|
||||
|
||||
Reference in New Issue
Block a user