-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
42 lines (32 loc) · 733 Bytes
/
Copy pathmain.py
File metadata and controls
42 lines (32 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import pyautogui
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def hello_world():
return render_template('index.html')
@app.route('/pause')
def pause():
pyautogui.press('playpause')
return '200'
@app.route('/next')
def next_track():
pyautogui.press('nexttrack')
return '200'
@app.route('/prev')
def prev_track():
pyautogui.press('prevtrack')
return '200'
@app.route('/mute')
def volume_mute():
pyautogui.press('volumemute')
return '200'
@app.route('/vlmup')
def volume_up():
pyautogui.press('volumeup')
return '200'
@app.route('/vlmdown')
def volume_down():
pyautogui.press('volumedown')
return '200'
if __name__ == '__main__':
app.run(host='0.0.0.0', port=80, debug=True)