Cleaned up more

This commit is contained in:
rmilooo 2025-01-01 22:27:37 +01:00
parent c7eb1f7c13
commit f0b20b74d0
5 changed files with 111 additions and 102 deletions

View file

@ -1,6 +1,7 @@
import os import os
import time
import subprocess import subprocess
import time
def get_folder_size(folder_path): def get_folder_size(folder_path):
total_size = 0 total_size = 0
@ -11,6 +12,7 @@ def get_folder_size(folder_path):
total_size += os.path.getsize(filepath) total_size += os.path.getsize(filepath)
return total_size return total_size
def delete_files(folder_path, extensions): def delete_files(folder_path, extensions):
os.system('sudo pkill -f revivetube.py') os.system('sudo pkill -f revivetube.py')
process = subprocess.Popen(['sudo', 'nohup', 'python3', 'revivetube.py']) process = subprocess.Popen(['sudo', 'nohup', 'python3', 'revivetube.py'])
@ -23,6 +25,7 @@ def delete_files(folder_path, extensions):
except: except:
print("ERROR") print("ERROR")
def monitor_folder(folder_path, size_limit_gb, check_interval): def monitor_folder(folder_path, size_limit_gb, check_interval):
size_limit_bytes = size_limit_gb * 1024 * 1024 * 1024 size_limit_bytes = size_limit_gb * 1024 * 1024 * 1024
while True: while True:
@ -31,6 +34,7 @@ def monitor_folder(folder_path, size_limit_gb, check_interval):
delete_files(folder_path, [".flv", ".mp4"]) delete_files(folder_path, [".flv", ".mp4"])
time.sleep(check_interval) time.sleep(check_interval)
if __name__ == "__main__": if __name__ == "__main__":
folder_to_monitor = "./sigma/videos/" folder_to_monitor = "./sigma/videos/"
size_limit = 7 size_limit = 7

View file

@ -32,6 +32,7 @@ def get_video_duration_from_file(video_path):
print(f"Can't fetch Video-Duration: {str(e)}") print(f"Can't fetch Video-Duration: {str(e)}")
return 0 return 0
def format_duration(seconds): def format_duration(seconds):
minutes = seconds // 60 minutes = seconds // 60
seconds = seconds % 60 seconds = seconds % 60

View file

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>ReviveTube by ReviveMii</title> <title>ReviveTube by ReviveMii</title>
<style> <style>
body { body {
@ -79,7 +79,7 @@
<h1>ReviveTube by ReviveMii</h1> <h1>ReviveTube by ReviveMii</h1>
<p>A YouTube App for the Wii</p> <p>A YouTube App for the Wii</p>
<form action="/" method="get"> <form action="/" method="get">
<input class="search-bar" type="text" name="query" placeholder="Search YouTube"> <input class="search-bar" name="query" placeholder="Search YouTube" type="text">
<button type="submit">Go</button> <button type="submit">Go</button>
</form> </form>
{% if results %} {% if results %}
@ -88,7 +88,7 @@
{% for video in results %} {% for video in results %}
<div class="video-item"> <div class="video-item">
<a href="/watch?video_id={{ video['id'] }}"> <a href="/watch?video_id={{ video['id'] }}">
<img src="{{ video['thumbnail'] }}" alt="{{ video['title'] }}"> <img alt="{{ video['title'] }}" src="{{ video['thumbnail'] }}">
<div class="video-item-title">{{ video['title'] }}</div> <div class="video-item-title">{{ video['title'] }}</div>
<div class="video-item-uploader">By: {{ video['uploader'] }}</div> <div class="video-item-uploader">By: {{ video['uploader'] }}</div>
<div class="video-item-duration">Duration: {{ video['duration'] }}</div> <div class="video-item-duration">Duration: {{ video['duration'] }}</div>
@ -99,9 +99,11 @@
{% endif %} {% endif %}
<p><a href="http://revivemii.errexe.xyz" target="_blank">Visit ReviveMii</a></p> <p><a href="http://revivemii.errexe.xyz" target="_blank">Visit ReviveMii</a></p>
<p style="color: red;">\/ Scroll down \/</p> <p style="color: red;">\/ Scroll down \/</p>
<p style="font-size: 12px;">We are NOT affiliated with Nintendo or YouTube. This app uses code from Wiinet.xyz. For more information, scroll down to Open Source Software.</p> <p style="font-size: 12px;">We are NOT affiliated with Nintendo or YouTube. This app uses code from Wiinet.xyz. For more
information, scroll down to Open Source Software.</p>
<p style="color: blue">It's recommended to bookmark this page. Some sites may take longer to load.</p> <p style="color: blue">It's recommended to bookmark this page. Some sites may take longer to load.</p>
<a href="http://revivetube.errexe.xyz/revivetube/t-and-p.html">Terms of Service and Privacy Policy (Last Updated: 7. Dec 2024 12:41 CET)</a><br><br> <a href="http://revivetube.errexe.xyz/revivetube/t-and-p.html">Terms of Service and Privacy Policy (Last Updated: 7. Dec
2024 12:41 CET)</a><br><br>
<a href="https://github.com/ReviveMii/revivetube/" target="_blank">Source Code</a><br><br> <a href="https://github.com/ReviveMii/revivetube/" target="_blank">Source Code</a><br><br>
<a href="http://revivetube.errexe.xyz/discord-redirect.html">Discord Server [Use a Compatible Device]</a> <a href="http://revivetube.errexe.xyz/discord-redirect.html">Discord Server [Use a Compatible Device]</a>
<p>Version: v2 Beta (Sometimes I forget to update the Version Number)</p> <p>Version: v2 Beta (Sometimes I forget to update the Version Number)</p>

View file

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>Loading...</title> <title>Loading...</title>
<style> <style>
body { body {
@ -32,11 +32,12 @@
</head> </head>
<body> <body>
<h1>Loading</h1> <h1>Loading</h1>
<img id="loadingGif" src="loading.gif" alt="Loading..." /> <img alt="Loading..." id="loadingGif" src="loading.gif"/>
<p id="progressText">Fetching Info...</p> <p id="progressText">Fetching Info...</p>
<button id="goButton" onclick="startVideo()">Go</button> <button id="goButton" onclick="startVideo()">Go</button>
<br> <br>
<small style="color: grey">Loading Screen will NOT work in Dolphin Emulator.<br><br>Long Video = Longer Download and Converting.<br><br>For videos longer than 7 minutes, there is a chance that they wont play.</small> <small style="color: grey">Loading Screen will NOT work in Dolphin Emulator.<br><br>Long Video = Longer Download and
Converting.<br><br>For videos longer than 7 minutes, there is a chance that they wont play.</small>
<script type="text/javascript"> <script type="text/javascript">
var goButton = document.getElementById('goButton'); var goButton = document.getElementById('goButton');
var loadingGif = document.getElementById('loadingGif'); var loadingGif = document.getElementById('loadingGif');

View file

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>{{ title }}</title> <title>{{ title }}</title>
<style> <style>
body { body {
@ -35,7 +35,7 @@
</head> </head>
<body class="dark-mode" id="page-body"> <body class="dark-mode" id="page-body">
<div style="width: 100%; background-color: #000; text-align: center;"> <div style="width: 100%; background-color: #000; text-align: center;">
<object type="application/x-shockwave-flash" data="/player.swf" width="384" height="256"> <object data="/player.swf" height="256" type="application/x-shockwave-flash" width="384">
<param name="wmode" value="transparent"> <param name="wmode" value="transparent">
<param name="allowFullScreen" value="false"> <param name="allowFullScreen" value="false">
<param name="flashvars" value="filename={{ video_flv }}"> <param name="flashvars" value="filename={{ video_flv }}">
@ -49,14 +49,15 @@
<a href="#comments">Skip Description</a> <a href="#comments">Skip Description</a>
<h3 style="color: red">Description:</h3> <h3 style="color: red">Description:</h3>
<p>{{ description | safe }}</p> <p>{{ description | safe }}</p>
<h3 id="comments" class="comments" style="color: red">Comments:</h3> <h3 class="comments" id="comments" style="color: red">Comments:</h3>
<div class="comments"> <div class="comments">
{% if comments %} {% if comments %}
{% for comment in comments %} {% for comment in comments %}
<div class="comment"> <div class="comment">
<p><strong>{{ comment.author }}</strong> posted:</p> <p><strong>{{ comment.author }}</strong> posted:</p>
<p>{{ comment.text|safe }}</p> <p>{{ comment.text|safe }}</p>
<p style="color: gray; font-size: 12px;">Likes: {{ comment.likeCount }} | Post date: {{ comment.publishedAt }}</p> <p style="color: gray; font-size: 12px;">Likes: {{ comment.likeCount }} | Post date: {{ comment.publishedAt
}}</p>
</div> </div>
{% endfor %} {% endfor %}
{% else %} {% else %}