Compare commits

..

16 Commits
2.3 ... main

14 changed files with 261 additions and 78 deletions

View File

@ -30,5 +30,5 @@
- Extract CDRM-Project 2.0 git contents into the newly created `CDRM-Project` folder - Extract CDRM-Project 2.0 git contents into the newly created `CDRM-Project` folder
- Install python dependencies `pip install -r requirements.txt` - Install python dependencies `pip install -r requirements.txt`
- (Optional) Create the folder structure `/configs/CDMs/WV` and place your .WVD file into `/configs/CDMs/WV` - (Optional) Create the folder structure `/configs/CDMs/WV` and place your .WVD file into `/configs/CDMs/WV`
- (Optional) Create the folder structur `/config/CDMs/PR` and place your .PRD file into `/configs/CDMs/PR` - (Optional) Create the folder structure `/config/CDMs/PR` and place your .PRD file into `/configs/CDMs/PR`
- Run the application with `python main.py` - Run the application with `python main.py`

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

BIN
cdrm-frontend/dist/favico.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 862 B

21
cdrm-frontend/dist/index.html vendored Normal file
View File

@ -0,0 +1,21 @@
<!doctype html>
<html lang="en" class="w-full h-full">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favico.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="{{ data.description }}"/>
<meta name="keywords" content="{{ data.keywords }}"/>
<meta property='og:title' content="{{ data.opengraph_title }}" />
<meta property='og:description' content="{{ data.opengraph_description }}" />
<meta property='og:image' content="{{ data.opengraph_image }}" />
<meta property='og:url' content="{{ data.opengraph_url }}" />
<meta property='og:locale' content='en_US' />
<title>{{ data.tab_title }}</title>
<script type="module" crossorigin src="/assets/index-DN7XJ__W.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-COb8XlA9.css">
</head>
<body class="w-full h-full">
<div id="root" class="w-full h-full"></div>
</body>
</html>

BIN
cdrm-frontend/dist/og-api.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

BIN
cdrm-frontend/dist/og-cache.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

BIN
cdrm-frontend/dist/og-home.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 KiB

BIN
cdrm-frontend/dist/og-testplayer.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

View File

@ -16,7 +16,7 @@ function App() {
{/* The SideMenu should be visible when isMenuOpen is true */} {/* The SideMenu should be visible when isMenuOpen is true */}
<SideMenu isMenuOpen={isMenuOpen} setIsMenuOpen={setIsMenuOpen} /> <SideMenu isMenuOpen={isMenuOpen} setIsMenuOpen={setIsMenuOpen} />
<div id="navbarcontainer" className="hidden lg:flex lg:w-2xs bg-gray-950/55 border-r border-white/5 0"> <div id="navbarcontainer" className="hidden lg:flex lg:w-2xs bg-gray-950/55 border-r border-white/5 shrink-0">
<NavBar /> <NavBar />
</div> </div>

View File

@ -1,3 +1,4 @@
import { useEffect, useState } from 'react';
import { NavLink } from 'react-router-dom'; import { NavLink } from 'react-router-dom';
import homeIcon from '../assets/icons/home.svg'; import homeIcon from '../assets/icons/home.svg';
import cacheIcon from '../assets/icons/cache.svg'; import cacheIcon from '../assets/icons/cache.svg';
@ -8,105 +9,96 @@ import telegramIcon from '../assets/icons/telegram.svg';
import giteaIcon from '../assets/icons/gitea.svg'; import giteaIcon from '../assets/icons/gitea.svg';
function NavBar() { function NavBar() {
const [externalLinks, setExternalLinks] = useState({
discord: '#',
telegram: '#',
gitea: '#',
});
useEffect(() => {
fetch('/api/links')
.then(response => response.json())
.then(data => setExternalLinks(data))
.catch(error => console.error('Error fetching links:', error));
}, []);
return ( return (
<div className="flex flex-col w-full h-full bg-white/1"> <div className="flex flex-col w-full h-full bg-white/1">
<div> <div>
<p className='text-white text-2xl font-bold p-3 text-center mb-5'> <p className='text-white text-2xl font-bold p-3 text-center mb-5'>
<a href='/'> <a href='/'>CDRM-Project</a>
CDRM-Project
</a>
</p> </p>
</div> </div>
<div className='overflow-y-auto grow'> <div className='overflow-y-auto grow'>
<NavLink {/* Static routes */}
to='/' {[{
className={({ isActive }) => to: '/',
`flex flex-row p-3 border-l-3 ${isActive ? 'border-l-sky-500/50 bg-black/50' : 'hover:border-l-sky-500/50 hover:bg-white/5'}` label: 'Home',
} icon: homeIcon,
> color: 'sky'
<button className='w-1/3 p-3 flex flex-col items-center justify-center cursor-pointer'> }, {
<img src={homeIcon} alt="Home" className='w-1/2 cursor-pointer' /> to: '/cache',
</button> label: 'Cache',
<p className='grow text-white md:text-2xl font-bold flex items-center justify-start'> icon: cacheIcon,
Home color: 'emerald'
</p> }, {
</NavLink> to: '/api',
<NavLink label: 'API',
to='/cache' icon: apiIcon,
className={({ isActive }) => color: 'indigo'
`flex flex-row p-3 border-l-3 ${isActive ? 'border-l-emerald-500/50 bg-black/50' : 'hover:border-l-emerald-500/50 hover:bg-white/5'}` }, {
} to: '/testplayer',
> label: 'Test Player',
<button className='w-1/3 p-3 flex flex-col items-center justify-center cursor-pointer'> icon: testPlayerIcon,
<img src={cacheIcon} alt="Cache" className='w-1/2 cursor-pointer' /> color: 'rose-700'
</button> }].map(({ to, label, icon, color }) => (
<p className='grow text-white md:text-2xl font-bold flex items-center justify-start'> <NavLink
Cache key={label}
</p> to={to}
</NavLink> className={({ isActive }) =>
<NavLink `flex flex-row p-3 border-l-3 ${
to='/api' isActive
className={({ isActive }) => ? `border-l-${color}-500/50 bg-black/50`
`flex flex-row p-3 border-l-3 ${isActive ? 'border-l-indigo-500/50 bg-black/50' : 'hover:border-l-indigo-500/50 hover:bg-white/5'}` : `hover:border-l-${color}-500/50 hover:bg-white/5`
} }`
> }
<button className='w-1/3 p-3 flex flex-col items-center justify-center cursor-pointer'> >
<img src={apiIcon} alt="API" className='w-1/2 cursor-pointer' /> <button className='w-1/3 p-3 flex flex-col items-center justify-center cursor-pointer'>
</button> <img src={icon} alt={label} className='w-1/2 cursor-pointer' />
<p className='grow text-white md:text-2xl font-bold flex items-center justify-start'> </button>
API <p className='grow text-white md:text-2xl font-bold flex items-center justify-start'>
</p> {label}
</NavLink> </p>
<NavLink </NavLink>
to='/testplayer' ))}
className={({ isActive }) =>
`flex flex-row p-3 border-l-3 ${isActive ? 'border-l-rose-700/50 bg-black/50' : 'hover:border-l-rose-700/50 hover:bg-white/5'}`
}
>
<button className='w-1/3 p-3 flex flex-col items-center justify-center cursor-pointer'>
<img src={testPlayerIcon} alt="Test Player" className='w-1/2 cursor-pointer' />
</button>
<p className='grow text-white md:text-2xl font-bold flex items-center justify-start'>
Test Player
</p>
</NavLink>
</div> </div>
{/* External links */}
<div className='flex flex-row w-full h-16 self-end bg-black/25'> <div className='flex flex-row w-full h-16 self-end bg-black/25'>
<a <a
href='https://discord.cdrm-project.com' href={externalLinks.discord}
target='_blank' target='_blank'
rel='noopener noreferrer' rel='noopener noreferrer'
className='w-1/3 p-3 flex flex-col items-center justify-center cursor-pointer hover:bg-blue-950 group' className='w-1/3 p-3 flex flex-col items-center justify-center cursor-pointer hover:bg-blue-950 group'
> >
<img <img src={discordIcon} alt="Discord" className='w-1/2 group-hover:animate-bounce' />
src={discordIcon}
alt="Discord"
className='w-1/2 cursor-pointer group-hover:animate-bounce'
/>
</a> </a>
<a <a
href='https://telegram.cdrm-project.com' href={externalLinks.telegram}
target='_blank' target='_blank'
rel='noopener noreferrer' rel='noopener noreferrer'
className='w-1/3 p-3 flex flex-col items-center justify-center cursor-pointer hover:bg-blue-400 group' className='w-1/3 p-3 flex flex-col items-center justify-center cursor-pointer hover:bg-blue-400 group'
> >
<img <img src={telegramIcon} alt="Telegram" className='w-1/2 group-hover:animate-bounce' />
src={telegramIcon}
alt="Telegram"
className='w-1/2 cursor-pointer group-hover:animate-bounce'
/>
</a> </a>
<a <a
href='https://cdm-project.com/tpd94/cdrm-project' href={externalLinks.gitea}
target='_blank' target='_blank'
rel='noopener noreferrer' rel='noopener noreferrer'
className='w-1/3 p-3 flex flex-col items-center justify-center cursor-pointer hover:bg-green-700 group' className='w-1/3 p-3 flex flex-col items-center justify-center cursor-pointer hover:bg-green-700 group'
> >
<img <img src={giteaIcon} alt="Gitea" className='w-1/2 group-hover:animate-bounce' />
src={giteaIcon}
alt="Gitea"
className='w-1/2 cursor-pointer group-hover:animate-bounce'
/>
</a> </a>
</div> </div>
</div> </div>

View File

@ -104,7 +104,7 @@ print(requests.post(
</details> </details>
<details open className='w-full list-none mt-5'> <details open className='w-full list-none mt-5'>
<summary className='text-2xl'>PyWidevine RemoteCDM info</summary> <summary className='text-2xl'>PyWidevine RemoteCDM info</summary>
<div className='mt-5 border-2 border-indigo-500 p-5 rounded-lg overflow-x-auto'> <div className='mt-5 border-2 border-indigo-500/50 p-5 rounded-lg overflow-x-auto'>
<p> <p>
<strong>Device Type:</strong> '{deviceInfo.device_type}'<br /> <strong>Device Type:</strong> '{deviceInfo.device_type}'<br />
<strong>System ID:</strong> {deviceInfo.system_id}<br /> <strong>System ID:</strong> {deviceInfo.system_id}<br />
@ -117,7 +117,7 @@ print(requests.post(
</details> </details>
<details open className='w-full list-none mt-5'> <details open className='w-full list-none mt-5'>
<summary className='text-2xl'>PyPlayready RemoteCDM info</summary> <summary className='text-2xl'>PyPlayready RemoteCDM info</summary>
<div className='mt-5 border-2 border-indigo-500 p-5 rounded-lg overflow-x-auto'> <div className='mt-5 border-2 border-indigo-500/50 p-5 rounded-lg overflow-x-auto'>
<p> <p>
<strong>Security Level:</strong> {prDeviceInfo.security_level}<br /> <strong>Security Level:</strong> {prDeviceInfo.security_level}<br />
<strong>Host:</strong> {fullHost}/remotecdm/playready<br /> <strong>Host:</strong> {fullHost}/remotecdm/playready<br />

5
configs/icon_links.py Normal file
View File

@ -0,0 +1,5 @@
data = {
'discord': 'https://discord.cdrm-project.com/',
'telegram': 'https://telegram.cdrm-project.com/',
'gitea': 'https://cdm-project.com/tpd94/cdm-project'
}

View File

@ -10,6 +10,7 @@ import mysql.connector
from io import StringIO from io import StringIO
import tempfile import tempfile
import time import time
from configs.icon_links import data as icon_data
api_bp = Blueprint('api', __name__) api_bp = Blueprint('api', __name__)
with open(f'{os.getcwd()}/configs/config.yaml', 'r') as file: with open(f'{os.getcwd()}/configs/config.yaml', 'r') as file:
@ -233,4 +234,12 @@ def decrypt_data():
return jsonify({ return jsonify({
'status': 'fail', 'status': 'fail',
'message': result['message'] 'message': result['message']
}) })
@api_bp.route('/api/links', methods=['GET'])
def get_links():
return jsonify({
'discord': icon_data['discord'],
'telegram': icon_data['telegram'],
'gitea': icon_data['gitea'],
})