Initial Commit

This commit is contained in:
WeeXnes 2025-04-22 18:48:37 +02:00
commit cb607e62c3
6 changed files with 253 additions and 0 deletions

4
.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
/db/
/node_modules/
/.idea/
/package-lock.json

40
README.md Normal file
View file

@ -0,0 +1,40 @@
# 📬 Contact & Legal Info
This API is a **non-commercial hobby project** built out of passion for the PlayStation 2 era and to support archival efforts within the retro gaming community.
---
## ⚠️ Disclaimer
I do **not own or claim ownership** of any of the artwork provided by this service.
All assets are sourced from publicly accessible, community-driven resources:
- 🎨 [OPL Manager Artwork Database Backups](https://oplmanager.com/site/?backups)
- 🗂️ [xlenore/ps2-covers GitHub Repository](https://github.com/xlenore/ps2-covers)
This project is strictly for **preservation, research, and educational use**.
---
## 🚫 Legal Concerns?
If you're a copyright holder or have concerns about any specific artwork or its usage,
please understand this project is:
- 🧪 For hobbyist and non-commercial use
- 🙏 Not intended to infringe on any rights
- ✅ Willing to **immediately take down** content upon request
---
## 📮 How to Get in Touch
Please contact me first before taking any formal action.
Im happy to address any concerns respectfully.
- 🌐 Contact form: [weexnes.dev/contact](https://weexnes.dev/contact)
- 📧 Email: [contact@weexnes.dev](mailto:contact@weexnes.dev)
---
Thanks for understanding — and for supporting open preservation of gaming history. 🎮

49
api.js Normal file
View file

@ -0,0 +1,49 @@
const express = require('express');
const fs = require('fs');
const path = require('path');
const app = express();
const PORT = 3000;
const data = fs.readFileSync('db/PS2_LIST.txt', 'utf-8');
const gameMap = {};
data.split('\n').forEach(line => {
const match = line.match(/^(\S+)\s+(.*)$/);
if (match) {
const [_, id, title] = match;
gameMap[id] = title.trim();
}
});
function normalizeId(input) {
const cleaned = input.toUpperCase().replace(/[_\.]/g, ''); // remove _ and .
const match = cleaned.match(/^([A-Z]+)(\d+)$/);
if (!match) return input.toUpperCase(); // fallback
const [, prefix, digits] = match;
return `${prefix}-${digits}`;
}
app.get('/search/:id', (req, res) => {
const normalizedId = normalizeId(req.params.id);
const title = gameMap[normalizedId];
if (title) {
res.json({ id: normalizedId, title });
} else {
res.status(404).json({ error: 'Game ID not found' });
}
});
app.use('/art', express.static(path.join(__dirname, 'db/PS2')));
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'index.html'));
});
app.get('/contact', (req, res) => {
res.sendFile(path.join(__dirname, 'contact.html'));
});
app.listen(PORT, () => {
console.log(`Server running at http://localhost:${PORT}`);
});

60
contact.html Normal file
View file

@ -0,0 +1,60 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Contact PS2 Game Info & Art API</title>
<style>
body {
margin: 0;
padding: 2rem;
background-color: #121212;
color: #f0f0f0;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
text-align: center;
}
h1 {
font-size: 2.5rem;
margin-bottom: 1rem;
}
p {
font-size: 1.2rem;
margin: 0.5rem 0 1.5rem 0;
max-width: 700px;
margin-left: auto;
margin-right: auto;
}
a {
text-decoration: none;
color: #a0e0a0;
}
code {
background: #1e1e1e;
padding: 0.2em 0.4em;
border-radius: 5px;
color: #a0e0a0;
font-size: 0.95rem;
}
</style>
</head>
<body>
<h1>📬 Contact & Legal Info</h1>
<p>
This API is a non-commercial hobby project built out of passion for the PlayStation 2 era and to support archival efforts within the retro gaming community.
</p>
<p>
I do not own or claim ownership of any of the artwork provided by this service. All assets are sourced from publicly accessible community-driven resources such as the
<a href="https://oplmanager.com/site/?backups" target="_blank">OPL Manager Artwork Database Backups</a> and the
<a href="https://github.com/xlenore/ps2-covers" target="_blank">xlenore/ps2-covers GitHub repository</a>.
</p>
<p>
If you are a copyright holder and have concerns about any specific image or usage, please know this project is strictly non-commercial and intended for preservation and research purposes.
Im happy to remove any content upon request — no questions asked.
</p>
<p>
Please reach out first via the contact form at <a href="https://weexnes.dev/contact" target="_blank">weexnes.dev/contact</a> or email me directly at <a href="mailto:contact@weexnes.dev">contact@weexnes.dev</a>.
</p>
<p>
Thank you for understanding, and for supporting open preservation of gaming history.
</p>
</body>
</html>

85
index.html Normal file
View file

@ -0,0 +1,85 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>PS2 Game Info & Art API</title>
<style>
body {
margin: 0;
padding: 2rem;
background-color: #121212;
color: #f0f0f0;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
text-align: center;
}
h1 {
font-size: 2.5rem;
margin-bottom: 1rem;
}
p {
font-size: 1.2rem;
margin: 0.5rem 0 2rem 0;
}
a {
text-decoration: none;
color: inherit;
}
code {
background: #1e1e1e;
padding: 0.2em 0.4em;
border-radius: 5px;
color: #a0e0a0;
font-size: 0.95rem;
}
table {
margin: 0 auto;
border-collapse: collapse;
margin-top: 1.5rem;
}
th, td {
border: 1px solid #2a2a2a;
padding: 0.6rem 1rem;
}
th {
background-color: #1e1e1e;
}
td {
background-color: #181818;
}
</style>
</head>
<body>
<h1>🕹️ PS2 Game Info & Art API</h1>
<p>Usage:</p>
<p>
<a href="/search/SLUS_203.12"><code>/search/SLUS_203.12</code></a> Get game info by ID
</p>
<h2>🎨 Artwork Endpoints</h2>
<table>
<thead>
<tr>
<th>Description</th>
<th>Path</th>
</tr>
</thead>
<tbody>
<tr>
<td>Front Cover</td>
<td><a href="/art/SLUS_203.12/SLUS_203.12_COV.png"><code>/art/SLUS_203.12/SLUS_203.12_COV.png</code></a></td>
</tr>
<tr>
<td>Back Cover</td>
<td><a href="/art/SLUS_203.12/SLUS_203.12_COV2.png"><code>/art/SLUS_203.12/SLUS_203.12_COV2.png</code></a></td>
</tr>
<tr>
<td>DVD Icon</td>
<td><a href="/art/SLUS_203.12/SLUS_203.12_ICO.png"><code>/art/SLUS_203.12/SLUS_203.12_ICO.png</code></a></td>
</tr>
</tbody>
</table>
<p>
💬 Have questions, concerns or legal requests? <a href="/contact"><code>/contact</code></a>
</p>
</body>
</html>

15
package.json Normal file
View file

@ -0,0 +1,15 @@
{
"name": "ps2_artwork_api",
"version": "1.0.0",
"main": "api.js",
"scripts": {
"start": "node api.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"dependencies": {
"express": "^5.1.0"
}
}