-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfix_images.js
More file actions
17 lines (13 loc) · 1.16 KB
/
Copy pathfix_images.js
File metadata and controls
17 lines (13 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const fs = require('fs');
const path = require('path');
const indexPath = path.join(__dirname, 'website', 'index.html');
let content = fs.readFileSync(indexPath, 'utf8');
// Fix old commit hash logo
content = content.replace(/https:\/\/raw\.githubusercontent\.com\/d0x-dev\/AirFlix\/[a-f0-9]+\/icon\.png/g, 'https://raw.githubusercontent.com/d0x-dev/AirFlix/refs/heads/main/uploads/nonbg.png');
// Replace local images and sc.png with the provided preview images
content = content.replace(/img\/smart_library\.jpeg/g, 'https://raw.githubusercontent.com/d0x-dev/AirFlix/refs/heads/main/uploads/preview1.png');
content = content.replace(/img\/advance_settings\.jpeg/g, 'https://raw.githubusercontent.com/d0x-dev/AirFlix/refs/heads/main/uploads/preview2.png');
content = content.replace(/img\/immersive_player\.jpeg/g, 'https://raw.githubusercontent.com/d0x-dev/AirFlix/refs/heads/main/uploads/preview1.png');
content = content.replace(/https:\/\/raw\.githubusercontent\.com\/d0x-dev\/AirFlix\/refs\/heads\/main\/sc\.png/g, 'https://raw.githubusercontent.com/d0x-dev/AirFlix/refs/heads/main/uploads/preview1.png');
fs.writeFileSync(indexPath, content, 'utf8');
console.log("Images fixed!");