diff --git a/.gitignore b/.gitignore index edb9d07..4908179 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ token.txt .venv .idea -__pycache__ \ No newline at end of file +__pycache__ +sigma +nohup.out \ No newline at end of file diff --git a/README.md b/README.md index 42b81be..d4cabc3 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,26 @@ # ReviveTube - -# WARNING: before starting the server, remove the -proxy command in revivetube.py - Watch YouTube on your Wii! -ReviveTube by ReviveMii +ReviveTube: http://yt.old.errexe.xyz/ ReviveMii Homepage: https://revivemii.errexe.xyz -Use it without self hosting: http://yt.old.errexe.xyz/ +# Self Hosting -Open Source Software used: http://yt.old.errexe.xyz/licenses.html +WARNING: before starting the server, remove the --proxy command in revivetube.py -# Use it yourself -Go to console.cloud.google.com and create a new application with the youtube data v3 api. paste the api key in token.txt. Install the Requirements in the beginning of revivetube.py. Start revivetube.py \ No newline at end of file +Go to https://console.cloud.google.com/ and create a new application with the YouTube Data v3 API. + +Click on Credentials and click on new, and create a new API Key. Paste the API Key in token.txt + +Install the Requirements: +```bash +pip install -r requirements.txt +``` +Search for "--proxy" in revivetube.py and remove the command + +Start the Server: +```bash +python3 revivetube.py +``` \ No newline at end of file diff --git a/favicon.ico b/favicon.ico index f5f1ce6..3a5a929 100644 Binary files a/favicon.ico and b/favicon.ico differ diff --git a/loading.gif b/loading.gif new file mode 100644 index 0000000..d2a3023 Binary files /dev/null and b/loading.gif differ diff --git a/requirements.txt b/requirements.txt index 76a77cb..518cbd5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -Flask==3.1.0 -Requests==2.32.3 -yt_dlp==2024.12.23 +Flask +Requests +yt_dlp \ No newline at end of file diff --git a/revivetube.py b/revivetube.py index 9ae76c3..2323ac4 100644 --- a/revivetube.py +++ b/revivetube.py @@ -144,59 +144,13 @@ def get_video_comments(video_id, max_results=20): return comments except requests.exceptions.RequestException as e: - print(f"Fehler beim Abrufen der Kommentare: {str(e)}") + print(f"Can't fetch Comments: {str(e)}") return [] -@app.route("/switch_wii", methods=["GET"]) -def switch_wii(): - video_id = request.args.get("video_id") - if not video_id: - return "Missing Video-ID.", 400 - - headers = { - "User-Agent": "Mozilla/5.0 (Nintendo Wii; U; ; en) Opera/9.30 (Nintendo Wii)" - } - - response = requests.get(f"http://localhost:5000/watch?video_id={video_id}", headers=headers, timeout=2) - - if response.status_code == 200: - return response.text - else: - return "Can't start DEBUG Mode.", 500 - - -@app.route('/test.swf') -def download_file(): - return send_file( - './test.swf', - mimetype='application/x-shockwave-flash', - as_attachment=True, - download_name='test.swf' - ) - - -@app.route("/switch_n", methods=["GET"]) -def switch_n(): - video_id = request.args.get("video_id") - if not video_id: - return "Missing Video-ID.", 400 - - headers = { - "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36" - } - - response = requests.get(f"http://localhost:5000/watch?video_id={video_id}", headers=headers, timeout=2) - - if response.status_code == 200: - return response.text - else: - return "Can't start DEBUG Mode.", 500 - - @app.route("/", methods=["GET"]) -def index_wiitv(): +def index(): query = request.args.get("query") results = None @@ -307,14 +261,17 @@ def process_video(video_id): video_status[video_id] = {"status": "downloading"} + + + with tempfile.TemporaryDirectory() as temp_dir: temp_video_path = os.path.join(temp_dir, f"{video_id}.%(ext)s") command = [ "yt-dlp", - "-f", "worstvideo+worstaudio", - "--proxy", "http://localhost:4000", "-o", temp_video_path, - f"https://m.youtube.com/watch?v={video_id}" + "--proxy", "http://localhost:4000", + "-f", "worstvideo+worstaudio", + f"https://youtube.com/watch?v={video_id}" ] subprocess.run(command, check=True) diff --git a/site_storage/index_template.html b/site_storage/index_template.html index 4b1bddd..b7fbb9a 100644 --- a/site_storage/index_template.html +++ b/site_storage/index_template.html @@ -1,116 +1,109 @@ - - + ReviveTube by ReviveMii - -

ReviveTube by ReviveMii

-

A YouTube App for the Wii

-
- - -
-{% if results %} -

Search Results

-
- {% for video in results %} -
- - {{ video['title'] }} -
{{ video['title'] }}
-
By: {{ video['uploader'] }}
-
Duration: {{ video['duration'] }}
-
+ +
+ +
+
+ + +
+
- {% endfor %} -
-{% endif %} -

Visit ReviveMii

-

\/ Scroll down \/

-

We are NOT affiliated with Nintendo or YouTube. This app uses code from Wiinet.xyz. For more - information, scroll down to Open Source Software.

-

It's recommended to bookmark this page. Some sites may take longer to load.

-Terms of Service and Privacy Policy (Last Updated: 7. Dec - 2024 12:41 CET)

-Source Code

-Discord Server [Use a Compatible Device] -

Version: v2 Beta (Sometimes I forget to update the Version Number)

-Open Source Software Used in This App -
-Contact -
-Report Bugs & Feedback +
+ {% if results %} +

Search Results

+
+ {% for video in results %} +
+ + {{ video['title'] }} + +
{{ video['title'] }}
+
By: {{ video['uploader'] }}
+
Duration: {{ video['duration'] }}
+
+ {% endfor %} +
+ {% endif %} +
+

\/ Scroll down \/

+

Visit the ReviveMii Project

+

We are NOT affiliated with Nintendo or YouTube.

+

+ Source Code | + Discord Server | + Contact +

- \ No newline at end of file + diff --git a/site_storage/loading_template.html b/site_storage/loading_template.html index 72e941d..0d1998e 100644 --- a/site_storage/loading_template.html +++ b/site_storage/loading_template.html @@ -6,8 +6,46 @@ Loading... -

Loading

-Loading... -

Fetching Info...

- -
-Loading Screen will NOT work in Dolphin Emulator.

Long Video = Longer Download and - Converting.

For videos longer than 7 minutes, there is a chance that they won’t play.
- + function updateProgress(status) { + if (status.status === 'complete') { + loadingGif.style.display = 'none'; + progressText.innerHTML = 'Done!'; + goButton.style.display = 'inline'; + } else if (status.status === 'downloading') { + progressText.innerHTML = 'The Server is Downloading...'; + } else if (status.status === 'converting') { + progressText.innerHTML = 'The Server is Converting video...'; + } else if (status.status === 'converting for Wii') { + progressText.innerHTML = 'The Server is Converting for Wii...'; + } else { + progressText.innerHTML = 'The Server was unable to process the video! Report the Bug in the Discord Server.
Error Details: Error on Video with ID: {{ video_id }}
Discord Server on ReviveMii Homepage Footer'; + } + } + + function startVideo() { + window.location.href = '/watch?video_id=' + videoId; + } + + window.onload = function () { + simulateLoading(); + }; + - \ No newline at end of file + diff --git a/site_storage/watch_standard_template.html b/site_storage/watch_standard_template.html deleted file mode 100644 index abc970a..0000000 --- a/site_storage/watch_standard_template.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - {{ title }} - - - -Please access this Site on a Wii - - \ No newline at end of file diff --git a/site_storage/watch_wii_template.html b/site_storage/watch_wii_template.html index f65194a..a1514e0 100644 --- a/site_storage/watch_wii_template.html +++ b/site_storage/watch_wii_template.html @@ -1,68 +1,127 @@ - - + {{ title }} - -
- - - - - -
-

{{ title }}

-

Uploaded by: {{ uploader }}

-

Views: {{ viewCount }}

-

Likes: {{ likeCount }}

-

Upload Date: {{ publishedAt }}

-Skip Description -

Description:

-

{{ description | safe }}

-

Comments:

-
- {% if comments %} - {% for comment in comments %} -
-

{{ comment.author }} posted:

-

{{ comment.text|safe }}

-

Likes: {{ comment.likeCount }} | Post date: {{ comment.publishedAt - }}

+ +
+ +
+
+ + +
+
+
+
+
+ + + + + +
+

{{ title }}

+

Uploaded by: {{ uploader }}

+

Views: {{ viewCount }}

+

Likes: {{ likeCount }}

+

Upload Date: {{ publishedAt }}

+ Skip Description +

Description:

+

{{ description | safe }}

+

Comments:

+
+ {% if comments %} + {% for comment in comments %} +
+

{{ comment.author }} posted:

+

{{ comment.text|safe }}

+

Likes: {{ comment.likeCount }} | Post date: {{ comment.publishedAt }}

+
+ {% endfor %} + {% else %} +

No Comments.

+ {% endif %} +
- {% endfor %} - {% else %} -

No Comments.

- {% endif %} -
- \ No newline at end of file +