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 time
import subprocess
import time
def get_folder_size(folder_path):
total_size = 0
@ -11,6 +12,7 @@ def get_folder_size(folder_path):
total_size += os.path.getsize(filepath)
return total_size
def delete_files(folder_path, extensions):
os.system('sudo pkill -f revivetube.py')
process = subprocess.Popen(['sudo', 'nohup', 'python3', 'revivetube.py'])
@ -23,6 +25,7 @@ def delete_files(folder_path, extensions):
except:
print("ERROR")
def monitor_folder(folder_path, size_limit_gb, check_interval):
size_limit_bytes = size_limit_gb * 1024 * 1024 * 1024
while True:
@ -31,6 +34,7 @@ def monitor_folder(folder_path, size_limit_gb, check_interval):
delete_files(folder_path, [".flv", ".mp4"])
time.sleep(check_interval)
if __name__ == "__main__":
folder_to_monitor = "./sigma/videos/"
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)}")
return 0
def format_duration(seconds):
minutes = seconds // 60
seconds = seconds % 60
@ -53,4 +54,4 @@ def get_api_key():
with open("token.txt", "r") as f:
return f.read().strip()
except FileNotFoundError:
raise FileNotFoundError("Missing token.txt. Please go to README.md")
raise FileNotFoundError("Missing token.txt. Please go to README.md")

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<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>
<style>
body {
@ -76,39 +76,41 @@
</style>
</head>
<body class="dark-mode" id="page-body">
<h1>ReviveTube by ReviveMii</h1>
<p>A YouTube App for the Wii</p>
<form action="/" method="get">
<input class="search-bar" type="text" name="query" placeholder="Search YouTube">
<button type="submit">Go</button>
</form>
{% if results %}
<h2>Search Results</h2>
<div>
{% for video in results %}
<div class="video-item">
<a href="/watch?video_id={{ video['id'] }}">
<img src="{{ video['thumbnail'] }}" alt="{{ video['title'] }}">
<div class="video-item-title">{{ video['title'] }}</div>
<div class="video-item-uploader">By: {{ video['uploader'] }}</div>
<div class="video-item-duration">Duration: {{ video['duration'] }}</div>
</a>
</div>
{% endfor %}
</div>
{% endif %}
<p><a href="http://revivemii.errexe.xyz" target="_blank">Visit ReviveMii</a></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="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="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>
<p>Version: v2 Beta (Sometimes I forget to update the Version Number)</p>
<a href="/licenses.html">Open Source Software Used in This App</a>
<br>
<a href="mailto:theerrorexe@gmail.com">Contact</a>
<br>
<a href="https://revivemii.errexe.xyz/feedback.html">Report Bugs & Feedback</a>
<h1>ReviveTube by ReviveMii</h1>
<p>A YouTube App for the Wii</p>
<form action="/" method="get">
<input class="search-bar" name="query" placeholder="Search YouTube" type="text">
<button type="submit">Go</button>
</form>
{% if results %}
<h2>Search Results</h2>
<div>
{% for video in results %}
<div class="video-item">
<a href="/watch?video_id={{ video['id'] }}">
<img alt="{{ video['title'] }}" src="{{ video['thumbnail'] }}">
<div class="video-item-title">{{ video['title'] }}</div>
<div class="video-item-uploader">By: {{ video['uploader'] }}</div>
<div class="video-item-duration">Duration: {{ video['duration'] }}</div>
</a>
</div>
{% endfor %}
</div>
{% endif %}
<p><a href="http://revivemii.errexe.xyz" target="_blank">Visit ReviveMii</a></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="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="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>
<p>Version: v2 Beta (Sometimes I forget to update the Version Number)</p>
<a href="/licenses.html">Open Source Software Used in This App</a>
<br>
<a href="mailto:theerrorexe@gmail.com">Contact</a>
<br>
<a href="https://revivemii.errexe.xyz/feedback.html">Report Bugs & Feedback</a>
</body>
</html>

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<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>
<style>
body {
@ -31,13 +31,14 @@
</style>
</head>
<body>
<h1>Loading</h1>
<img id="loadingGif" src="loading.gif" alt="Loading..." />
<p id="progressText">Fetching Info...</p>
<button id="goButton" onclick="startVideo()">Go</button>
<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>
<script type="text/javascript">
<h1>Loading</h1>
<img alt="Loading..." id="loadingGif" src="loading.gif"/>
<p id="progressText">Fetching Info...</p>
<button id="goButton" onclick="startVideo()">Go</button>
<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>
<script type="text/javascript">
var goButton = document.getElementById('goButton');
var loadingGif = document.getElementById('loadingGif');
var progressText = document.getElementById('progressText');

View file

@ -2,66 +2,67 @@
<html lang="en">
<head>
<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>
<style>
body {
font-family: 'Arial', sans-serif;
text-align: center; /* Zentriert den Text */
color: #fff;
background-color: #181818;
}
.dark-mode {
background-color: #181818;
color: #fff;
}
.dark-mode a {
color: #1e90ff;
}
.comments {
margin: 0 auto;
width: 80%;
}
h1 {
color: red;
text-align: center;
}
h3 {
color: white;
text-align: center;
}
</style>
<script src="https://unpkg.com/@ruffle-rs/ruffle"></script>
<style>
body {
font-family: 'Arial', sans-serif;
text-align: center; /* Zentriert den Text */
color: #fff;
background-color: #181818;
}
.dark-mode {
background-color: #181818;
color: #fff;
}
.dark-mode a {
color: #1e90ff;
}
.comments {
margin: 0 auto;
width: 80%;
}
h1 {
color: red;
text-align: center;
}
h3 {
color: white;
text-align: center;
}
</style>
<script src="https://unpkg.com/@ruffle-rs/ruffle"></script>
</head>
<body class="dark-mode" id="page-body">
<div style="width: 100%; background-color: #000; text-align: center;">
<object type="application/x-shockwave-flash" data="/player.swf" width="384" height="256">
<param name="wmode" value="transparent">
<param name="allowFullScreen" value="false">
<param name="flashvars" value="filename={{ video_flv }}">
</object>
</div>
<h1 style="color: red">{{ title }}</h1>
<h3>Uploaded by: <a href="/channel?channel_id={{ channelId }}">{{ uploader }}</a></h3>
<p><strong>Views:</strong> {{ viewCount }}</p>
<p><strong>Likes:</strong> {{ likeCount }}</p>
<p><strong>Upload Date:</strong> {{ publishedAt }}</p>
<a href="#comments">Skip Description</a>
<h3 style="color: red">Description:</h3>
<p>{{ description | safe }}</p>
<h3 id="comments" class="comments" style="color: red">Comments:</h3>
<div class="comments">
{% if comments %}
{% for comment in comments %}
<div class="comment">
<p><strong>{{ comment.author }}</strong> posted:</p>
<p>{{ comment.text|safe }}</p>
<p style="color: gray; font-size: 12px;">Likes: {{ comment.likeCount }} | Post date: {{ comment.publishedAt }}</p>
</div>
{% endfor %}
{% else %}
<p>No Comments.</p>
{% endif %}
<div style="width: 100%; background-color: #000; text-align: center;">
<object data="/player.swf" height="256" type="application/x-shockwave-flash" width="384">
<param name="wmode" value="transparent">
<param name="allowFullScreen" value="false">
<param name="flashvars" value="filename={{ video_flv }}">
</object>
</div>
<h1 style="color: red">{{ title }}</h1>
<h3>Uploaded by: <a href="/channel?channel_id={{ channelId }}">{{ uploader }}</a></h3>
<p><strong>Views:</strong> {{ viewCount }}</p>
<p><strong>Likes:</strong> {{ likeCount }}</p>
<p><strong>Upload Date:</strong> {{ publishedAt }}</p>
<a href="#comments">Skip Description</a>
<h3 style="color: red">Description:</h3>
<p>{{ description | safe }}</p>
<h3 class="comments" id="comments" style="color: red">Comments:</h3>
<div class="comments">
{% if comments %}
{% for comment in comments %}
<div class="comment">
<p><strong>{{ comment.author }}</strong> posted:</p>
<p>{{ comment.text|safe }}</p>
<p style="color: gray; font-size: 12px;">Likes: {{ comment.likeCount }} | Post date: {{ comment.publishedAt
}}</p>
</div>
{% endfor %}
{% else %}
<p>No Comments.</p>
{% endif %}
</div>
</body>
</html>