Facebook
From aaaaaaaaaaaaaa, 10 Months ago, written in Plain Text.
This paste is a reply to aaaaaaaa from aaaaaaaaa - view diff
Embed
  1. from flask import Flask
  2. import os
  3.  
  4. app = Flask(__name__)
  5.  
  6. @app.route('/<device>/<state>')
  7. def handler(device, state):
  8.     print(f"/{device}/{state}")
  9.     if device == "rgb":
  10.         if state == "on":
  11.             os.system&#40;"termux-infrared-transmit -f 37736 9063,4505,583,583,583,1696,583,583,583,583,583,583,583,583,583,583,583,583,583,1696,583,583,583,1696,583,1696,583,1696,583,1696,583,1696,583,1696,583,583,583,1696,583,583,583,583,583,583,583,583,583,583,583,583,583,1696,583,583,583,1696,583,1696,583,1696,583,1696,583,1696,583,1696,583,40174,9063,2252,583,96963"&#41;
  12.         elif state == "off":
  13.             os.system&#40;"termux-infrared-transmit -f 37736 9063,4505,583,583,583,1696,583,583,583,583,583,583,583,583,583,583,583,583,583,1696,583,583,583,1696,583,1696,583,1696,583,1696,583,1696,583,1696,583,1696,583,1696,583,583,583,583,583,583,583,583,583,583,583,583,583,583,583,583,583,1696,583,1696,583,1696,583,1696,583,1696,583,1696,583,40174,9063,2252,583,96937"&#41;
  14.     return 'Ok!', 200
  15.  
  16. @app.route('/')
  17. def index():
  18.     return "Hello, this is a web server!"
  19.  
  20. if __name__ == '__main__':
  21.     app.run(debug=True, host="0.0.0.0")
captcha