From cb607e62c30813d32b423adf52036ea199fe624e Mon Sep 17 00:00:00 2001 From: WeeXnes Date: Tue, 22 Apr 2025 18:48:37 +0200 Subject: [PATCH] Initial Commit --- .gitignore | 4 +++ README.md | 40 +++++++++++++++++++++++++ api.js | 49 ++++++++++++++++++++++++++++++ contact.html | 60 +++++++++++++++++++++++++++++++++++++ index.html | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 15 ++++++++++ 6 files changed, 253 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 api.js create mode 100644 contact.html create mode 100644 index.html create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c7f7cb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/db/ +/node_modules/ +/.idea/ +/package-lock.json diff --git a/README.md b/README.md new file mode 100644 index 0000000..8709915 --- /dev/null +++ b/README.md @@ -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. +Iโ€™m 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. ๐ŸŽฎ diff --git a/api.js b/api.js new file mode 100644 index 0000000..ff14ec0 --- /dev/null +++ b/api.js @@ -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}`); +}); diff --git a/contact.html b/contact.html new file mode 100644 index 0000000..6d22a0d --- /dev/null +++ b/contact.html @@ -0,0 +1,60 @@ + + + + + Contact โ€“ PS2 Game Info & Art API + + + +

๐Ÿ“ฌ 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. +

+

+ 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 + OPL Manager Artwork Database Backups and the + xlenore/ps2-covers GitHub repository. +

+

+ 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. + Iโ€™m happy to remove any content upon request โ€” no questions asked. +

+

+ Please reach out first via the contact form at weexnes.dev/contact or email me directly at contact@weexnes.dev. +

+

+ Thank you for understanding, and for supporting open preservation of gaming history. +

+ + diff --git a/index.html b/index.html new file mode 100644 index 0000000..ed59ffd --- /dev/null +++ b/index.html @@ -0,0 +1,85 @@ + + + + + PS2 Game Info & Art API + + + +

๐Ÿ•น๏ธ PS2 Game Info & Art API

+

Usage:

+

+ /search/SLUS_203.12 โ€“ Get game info by ID +

+ +

๐ŸŽจ Artwork Endpoints

+ + + + + + + + + + + + + + + + + + + + + +
DescriptionPath
Front Cover/art/SLUS_203.12/SLUS_203.12_COV.png
Back Cover/art/SLUS_203.12/SLUS_203.12_COV2.png
DVD Icon/art/SLUS_203.12/SLUS_203.12_ICO.png
+

+ ๐Ÿ’ฌ Have questions, concerns or legal requests? /contact +

+ + diff --git a/package.json b/package.json new file mode 100644 index 0000000..ccab35d --- /dev/null +++ b/package.json @@ -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" + } +}