-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be9ff29
commit 97f26ec
Showing
2 changed files
with
10 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#!/usr/bin/env python3 | ||
from base64 import b64encode as b64 | ||
import requests | ||
import sys | ||
|
||
title = 'Coco Battle Royale II' | ||
|
@@ -11,9 +12,16 @@ | |
input = './bin/kokobatoru.nes' | ||
output = './html/jap.html' | ||
|
||
if '--download' in sys.argv: | ||
for file_name in ['nes.min.js']: | ||
cdn = 'https://cdn.jsdelivr.net/gh/takahirox/[email protected]/build' | ||
with requests.get(f'{cdn}/{file_name}', stream=True) as download: | ||
file_name = file_name.replace(r'.min.js', '.js') | ||
open(f'./html/{file_name}', "w").write(download.text) | ||
|
||
rom = b64(open(input, "rb").read()).decode() | ||
html = open("./res/index.html", "r").read() | ||
html = html.replace(r'{{game}}', title).replace(r'{{rom}}', rom) | ||
|
||
open(output, "w").write(html) | ||
|
||
print(title) |