You've already forked amazing-ytdlp-archive
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
43e6c00787 |
@@ -210,8 +210,10 @@ def queue():
|
|||||||
flash(f'Queue has been emptied')
|
flash(f'Queue has been emptied')
|
||||||
|
|
||||||
elif task == 'queue-run-once':
|
elif task == 'queue-run-once':
|
||||||
task = video_queue.delay()
|
value = int(value) if value.isdigit() else 1
|
||||||
flash(f'Task has been started on the oldest queued item: {task.id}')
|
for x in range(value):
|
||||||
|
task = video_queue.delay()
|
||||||
|
flash(f'Task has been started on the oldest queued item: {task.id}')
|
||||||
|
|
||||||
return redirect(url_for('admin.queue'))
|
return redirect(url_for('admin.queue'))
|
||||||
|
|
||||||
@@ -249,7 +251,7 @@ def users():
|
|||||||
return render_template('admin/users.html', users=users)
|
return render_template('admin/users.html', users=users)
|
||||||
|
|
||||||
@bp.route('/workers', methods=['GET', 'POST'])
|
@bp.route('/workers', methods=['GET', 'POST'])
|
||||||
#@login_required
|
@login_required
|
||||||
def workers():
|
def workers():
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
task = request.form.get('task', None)
|
task = request.form.get('task', None)
|
||||||
@@ -259,4 +261,5 @@ def workers():
|
|||||||
celery = current_app.extensions.get('celery')
|
celery = current_app.extensions.get('celery')
|
||||||
|
|
||||||
tasks = celery.control.inspect().active()
|
tasks = celery.control.inspect().active()
|
||||||
return render_template('admin/workers.html', tasks=tasks)
|
reserved = celery.control.inspect().reserved()
|
||||||
|
return render_template('admin/workers.html', tasks=tasks, reserved=reserved)
|
@@ -4,6 +4,7 @@ class OIDC():
|
|||||||
Additionally this class provides the function to generate redirect url's and check bearer tokens on their validity as well as caching jwt signing keys.
|
Additionally this class provides the function to generate redirect url's and check bearer tokens on their validity as well as caching jwt signing keys.
|
||||||
Fairly barebones and should be 100% secure. (famous last words)
|
Fairly barebones and should be 100% secure. (famous last words)
|
||||||
This is made for form posted JWT's. While not the most secure it is the most easy way to implement. Moving on to a code based solution might be preferred in the future.
|
This is made for form posted JWT's. While not the most secure it is the most easy way to implement. Moving on to a code based solution might be preferred in the future.
|
||||||
|
The nonce and state store is in memory, so only one instance can be used at a time until central key caching is implemented.
|
||||||
"""
|
"""
|
||||||
def __init__(self, app=None):
|
def __init__(self, app=None):
|
||||||
self.states = {}
|
self.states = {}
|
||||||
@@ -151,7 +152,6 @@ class OIDC():
|
|||||||
|
|
||||||
# Any exception (invalid JWT, invalid formatting etc...) must return False
|
# Any exception (invalid JWT, invalid formatting etc...) must return False
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e, flush=True)
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Double check if given token is really requested by us by matching the nonce in the signed key
|
# Double check if given token is really requested by us by matching the nonce in the signed key
|
||||||
|
@@ -29,7 +29,8 @@
|
|||||||
<br>
|
<br>
|
||||||
<span class="supporting-text">Prunes all deactivated endpoints, but keeps last 3 days</span>
|
<span class="supporting-text">Prunes all deactivated endpoints, but keeps last 3 days</span>
|
||||||
</form>
|
</form>
|
||||||
<form class="mt-4" method="post" onsubmit="return confirm('Are you sure?');">
|
<form class="mt-4 input-field" method="post" onsubmit="return confirm('Are you sure?');">
|
||||||
|
<input type="number" style="width: 80px" value="1" name="value" min="1" max="99">
|
||||||
<button class="btn mb-2 green" type="submit" name="task" value="queue-run-once">Download oldest queued</button>
|
<button class="btn mb-2 green" type="submit" name="task" value="queue-run-once">Download oldest queued</button>
|
||||||
<br>
|
<br>
|
||||||
<span class="supporting-text">Will download the oldest queued video ID</span>
|
<span class="supporting-text">Will download the oldest queued video ID</span>
|
||||||
@@ -151,7 +152,7 @@
|
|||||||
<td>
|
<td>
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<input type="text" value="{{ id.get('id') }}" name="value" hidden>
|
<input type="text" value="{{ id.get('id') }}" name="value" hidden>
|
||||||
<button class="btn-small waves-effect waves-light" type="submit" name="task" value="delete-queue" title="Delete from queue" {% if id.get('status') != 'queued' %}disabled{% endif %}>🗑️</button>
|
<button class="btn-small waves-effect waves-light" type="submit" name="task" value="delete-queue" title="Delete from queue" {% if id.get('status') == 'working' %}disabled{% endif %}>🗑️</button>
|
||||||
</form>
|
</form>
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<input type="text" value="{{ id.get('id') }}" name="value" hidden>
|
<input type="text" value="{{ id.get('id') }}" name="value" hidden>
|
||||||
|
@@ -19,8 +19,33 @@
|
|||||||
</form>
|
</form>
|
||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col s12">
|
<div class="col s12 m-4">
|
||||||
<h6>Current workers</h6>
|
<h5>Reserved tasks per worker</h5>
|
||||||
|
<p>Usually 4 tasks per worker</p>
|
||||||
|
{% for worker in reserved %}
|
||||||
|
<span>{{ worker }}</span>
|
||||||
|
<table class="striped highlight responsive-table" style=" border: 1px solid black;">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>ID</th>
|
||||||
|
<th>Task</th>
|
||||||
|
<th>Arguments</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for task in reserved[worker] %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ task.get('id') }}</td>
|
||||||
|
<td>{{ task.get('name') }}</td>
|
||||||
|
<td>{{ task.get('args') }} {{ task.get('kwargs') }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
<div class="col s12 m-4">
|
||||||
|
<h5>Current workers and processing tasks</h5>
|
||||||
{% for worker in tasks %}
|
{% for worker in tasks %}
|
||||||
<span>{{ worker }}</span>
|
<span>{{ worker }}</span>
|
||||||
<table class="striped highlight responsive-table" style=" border: 1px solid black;">
|
<table class="striped highlight responsive-table" style=" border: 1px solid black;">
|
||||||
@@ -35,7 +60,7 @@
|
|||||||
{% for task in tasks[worker] %}
|
{% for task in tasks[worker] %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ task.get('id') }}</td>
|
<td>{{ task.get('id') }}</td>
|
||||||
<td>{{ task.get('type') }}</td>
|
<td>{{ task.get('name') }}</td>
|
||||||
<td>{{ task.get('time_start')|epoch_time }}</td>
|
<td>{{ task.get('time_start')|epoch_time }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
Reference in New Issue
Block a user