Skip to content

Commit

Permalink
Update MBVL.py
Browse files Browse the repository at this point in the history
  • Loading branch information
CrystalVortex authored May 22, 2024
1 parent 83aa50d commit 879743b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions MBVL.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import requests

import os

import webbrowser

file = open("generated_versions.html",mode="w")
Expand Down Expand Up @@ -43,7 +41,7 @@
""")


print("Loading...")
print("Loading, this may take up to 5+ minutes.")

url = "https://raw.githubusercontent.com/CrystalVortex/Minecraft-Bedrock-Version-Manager/main/versions.txt"
response = requests.get(url, headers={'Cache-Control': 'no-cache'})
Expand All @@ -53,15 +51,15 @@
# Split the HTML content by lines and iterate over them
lines = html_content.split('\n')
for i, line in enumerate(lines, start=1):
line = line.strip() # Remove leading and trailing whitespace
line = line.strip()
if line: # Check if the line is not empty after stripping
version = Versions.get_by_version(line)
print(line+" <- Searching")
print("Version: "+line+" <- Found Link")
file.write(f"""
<a href={version.uri} target="_blank">
<button>{line}</button>
</a>
""")
file.write("</body>\n</html>")
file.write("\n<button href='minecraft://'>Launch Minecraft</button>\n</body>\n</html>")

webbrowser.open("generated_versions.html")

0 comments on commit 879743b

Please sign in to comment.