mirror of
https://github.com/damp11113/PyserSSH.git
synced 2025-04-27 22:48:11 +00:00
New main features - ServerManager - RemoDesk protocol support - New client system - Supported auth with none, password and public key - Support remote monitor for mobaxterm user (beta) - SFTP can set specific folder for user - Support exec_request New function - Send_karaoke_effect - ShowCursor - SendBell - NewSend for advance sending like print() - Flag_TH for about - wait_inputmouse for mouse input Fixing - (only python) fixing can't print color without damp11113 library or print color library only in windows on python console - Fixing sometime can't connect SFTP and more
29 lines
851 B
Python
29 lines
851 B
Python
import os
|
|
import time
|
|
from damp11113 import SRTParser
|
|
|
|
from PyserSSH import Server, Send, AccountManager
|
|
from PyserSSH.extensions.XHandler import XHandler
|
|
from PyserSSH.extensions.moredisplay import Send_karaoke_effect, ShowCursor
|
|
|
|
accountmanager = AccountManager()
|
|
accountmanager.add_account("admin", "")
|
|
|
|
XH = XHandler()
|
|
server = Server(accountmanager, XHandler=XH)
|
|
|
|
@XH.command()
|
|
def karaoke(client):
|
|
ShowCursor(client, False)
|
|
subtitle = SRTParser("Save Your Tears lyrics.srt", removeln=True)
|
|
|
|
for sub in subtitle:
|
|
delay = sub["duration"] / len(sub["text"])
|
|
Send_karaoke_effect(client, sub["text"], delay)
|
|
|
|
if sub["next_text_duration"] is not None:
|
|
time.sleep(sub["next_text_duration"])
|
|
|
|
ShowCursor(client)
|
|
|
|
server.run(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'private_key.pem')) |