Spaces:
Running
Running
Add 2 files
Browse files- index.html +152 -19
- prompts.txt +2 -1
index.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title>MegaFlix Turbo -
|
| 7 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
<!-- Plyr.js pour le lecteur vidéo -->
|
|
@@ -231,6 +231,33 @@
|
|
| 231 |
line-height: 1.6;
|
| 232 |
color: #ddd;
|
| 233 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 234 |
</style>
|
| 235 |
</head>
|
| 236 |
<body class="bg-gray-900 text-white">
|
|
@@ -309,6 +336,10 @@
|
|
| 309 |
<video id="player" playsinline controls></video>
|
| 310 |
</div>
|
| 311 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 312 |
<div class="player-controls">
|
| 313 |
<button class="player-btn" id="play-btn">
|
| 314 |
<i class="fas fa-play"></i> Lecture
|
|
@@ -345,10 +376,13 @@
|
|
| 345 |
<script>
|
| 346 |
// Configuration API TMDB
|
| 347 |
const API_KEY = 'fb437b10727a5a4eb8d9134e29c82ae0';
|
| 348 |
-
const ACCESS_TOKEN = 'eyJhbGciOiJIUzI1NiJ9.
|
| 349 |
const API_URL = 'https://api.themoviedb.org/3';
|
| 350 |
const IMAGE_URL = 'https://image.tmdb.org/t/p/w500';
|
| 351 |
|
|
|
|
|
|
|
|
|
|
| 352 |
// Configuration turbo
|
| 353 |
const LOAD_SPEED = 20; // films chargés par batch
|
| 354 |
const LOAD_INTERVAL = 500; // ms entre chaque batch
|
|
@@ -363,6 +397,8 @@
|
|
| 363 |
let currentPage = 1;
|
| 364 |
let player;
|
| 365 |
let currentFilm = null;
|
|
|
|
|
|
|
| 366 |
|
| 367 |
// Éléments du DOM
|
| 368 |
const filmsContainer = document.getElementById('films-container');
|
|
@@ -382,6 +418,7 @@
|
|
| 382 |
const filmRating = document.getElementById('film-rating');
|
| 383 |
const filmDuration = document.getElementById('film-duration');
|
| 384 |
const filmOverview = document.getElementById('film-overview');
|
|
|
|
| 385 |
|
| 386 |
// Initialisation
|
| 387 |
document.addEventListener('DOMContentLoaded', function() {
|
|
@@ -488,7 +525,7 @@
|
|
| 488 |
}
|
| 489 |
|
| 490 |
// Ouvrir le lecteur avec un film
|
| 491 |
-
function openPlayer(film) {
|
| 492 |
currentFilm = film;
|
| 493 |
|
| 494 |
// Mettre à jour les infos du film
|
|
@@ -502,26 +539,122 @@
|
|
| 502 |
playerOverlay.style.display = 'flex';
|
| 503 |
document.body.style.overflow = 'hidden';
|
| 504 |
|
| 505 |
-
// Charger
|
| 506 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 507 |
}
|
| 508 |
|
| 509 |
-
//
|
| 510 |
-
function
|
| 511 |
-
|
| 512 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 513 |
|
| 514 |
// Réinitialiser le lecteur
|
| 515 |
-
player
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
|
| 523 |
-
|
| 524 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 525 |
}
|
| 526 |
|
| 527 |
// Vérifier la connexion API
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>MegaFlix Turbo - Streaming Automatique</title>
|
| 7 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
<!-- Plyr.js pour le lecteur vidéo -->
|
|
|
|
| 231 |
line-height: 1.6;
|
| 232 |
color: #ddd;
|
| 233 |
}
|
| 234 |
+
|
| 235 |
+
.server-btn {
|
| 236 |
+
background: #333;
|
| 237 |
+
color: white;
|
| 238 |
+
border: none;
|
| 239 |
+
padding: 8px 15px;
|
| 240 |
+
border-radius: 5px;
|
| 241 |
+
cursor: pointer;
|
| 242 |
+
font-size: 14px;
|
| 243 |
+
transition: all 0.2s;
|
| 244 |
+
}
|
| 245 |
+
|
| 246 |
+
.server-btn:hover {
|
| 247 |
+
background: #444;
|
| 248 |
+
}
|
| 249 |
+
|
| 250 |
+
.server-btn.active {
|
| 251 |
+
background: #e50914;
|
| 252 |
+
font-weight: bold;
|
| 253 |
+
}
|
| 254 |
+
|
| 255 |
+
.server-container {
|
| 256 |
+
display: flex;
|
| 257 |
+
gap: 10px;
|
| 258 |
+
margin-bottom: 15px;
|
| 259 |
+
flex-wrap: wrap;
|
| 260 |
+
}
|
| 261 |
</style>
|
| 262 |
</head>
|
| 263 |
<body class="bg-gray-900 text-white">
|
|
|
|
| 336 |
<video id="player" playsinline controls></video>
|
| 337 |
</div>
|
| 338 |
|
| 339 |
+
<div class="server-container" id="server-container">
|
| 340 |
+
<!-- Les boutons de serveur seront ajoutés ici -->
|
| 341 |
+
</div>
|
| 342 |
+
|
| 343 |
<div class="player-controls">
|
| 344 |
<button class="player-btn" id="play-btn">
|
| 345 |
<i class="fas fa-play"></i> Lecture
|
|
|
|
| 376 |
<script>
|
| 377 |
// Configuration API TMDB
|
| 378 |
const API_KEY = 'fb437b10727a5a4eb8d9134e29c82ae0';
|
| 379 |
+
const ACCESS_TOKEN = 'eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJmYjQzN2IxMDcyN2E1YTRlYjhkOTEzNGUyOWM4MmFlMCIsInN1YiI6IjY0MmM3ZmQ2OGI5NTllMDBmNDRkNzNhMCIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.Nhl261Ha3z0Ujg5vM1PpFoZBiTGjlXQ1g9VFPh6dVvs';
|
| 380 |
const API_URL = 'https://api.themoviedb.org/3';
|
| 381 |
const IMAGE_URL = 'https://image.tmdb.org/t/p/w500';
|
| 382 |
|
| 383 |
+
// API pour les liens de streaming (simulée)
|
| 384 |
+
const STREAM_API_URL = 'https://api.streamapi.com/v1/movies';
|
| 385 |
+
|
| 386 |
// Configuration turbo
|
| 387 |
const LOAD_SPEED = 20; // films chargés par batch
|
| 388 |
const LOAD_INTERVAL = 500; // ms entre chaque batch
|
|
|
|
| 397 |
let currentPage = 1;
|
| 398 |
let player;
|
| 399 |
let currentFilm = null;
|
| 400 |
+
let currentStreamUrl = '';
|
| 401 |
+
let availableServers = [];
|
| 402 |
|
| 403 |
// Éléments du DOM
|
| 404 |
const filmsContainer = document.getElementById('films-container');
|
|
|
|
| 418 |
const filmRating = document.getElementById('film-rating');
|
| 419 |
const filmDuration = document.getElementById('film-duration');
|
| 420 |
const filmOverview = document.getElementById('film-overview');
|
| 421 |
+
const serverContainer = document.getElementById('server-container');
|
| 422 |
|
| 423 |
// Initialisation
|
| 424 |
document.addEventListener('DOMContentLoaded', function() {
|
|
|
|
| 525 |
}
|
| 526 |
|
| 527 |
// Ouvrir le lecteur avec un film
|
| 528 |
+
async function openPlayer(film) {
|
| 529 |
currentFilm = film;
|
| 530 |
|
| 531 |
// Mettre à jour les infos du film
|
|
|
|
| 539 |
playerOverlay.style.display = 'flex';
|
| 540 |
document.body.style.overflow = 'hidden';
|
| 541 |
|
| 542 |
+
// Charger les liens de streaming
|
| 543 |
+
await loadStreamingLinks(film);
|
| 544 |
+
}
|
| 545 |
+
|
| 546 |
+
// Charger les liens de streaming pour un film
|
| 547 |
+
async function loadStreamingLinks(film) {
|
| 548 |
+
// Simuler une requête API pour obtenir les liens de streaming
|
| 549 |
+
// En réalité, vous utiliseriez une vraie API comme Allocine, JustWatch, etc.
|
| 550 |
+
|
| 551 |
+
// Afficher un message de chargement
|
| 552 |
+
serverContainer.innerHTML = '<div class="text-gray-400">Chargement des serveurs...</div>';
|
| 553 |
+
|
| 554 |
+
try {
|
| 555 |
+
// Simuler un délai de chargement
|
| 556 |
+
await new Promise(resolve => setTimeout(resolve, 800));
|
| 557 |
+
|
| 558 |
+
// Générer des serveurs simulés avec des liens de streaming
|
| 559 |
+
availableServers = [
|
| 560 |
+
{ name: 'Serveur Turbo 1', url: generateStreamUrl(film.id, 1), type: 'hls' },
|
| 561 |
+
{ name: 'Serveur Turbo 2', url: generateStreamUrl(film.id, 2), type: 'mp4' },
|
| 562 |
+
{ name: 'Serveur Premium', url: generateStreamUrl(film.id, 3), type: 'hls' },
|
| 563 |
+
{ name: 'Serveur Rapide', url: generateStreamUrl(film.id, 4), type: 'mp4' }
|
| 564 |
+
];
|
| 565 |
+
|
| 566 |
+
// Afficher les boutons de serveur
|
| 567 |
+
updateServerButtons();
|
| 568 |
+
|
| 569 |
+
// Sélectionner le premier serveur par défaut
|
| 570 |
+
if (availableServers.length > 0) {
|
| 571 |
+
changeServer(availableServers[0]);
|
| 572 |
+
}
|
| 573 |
+
} catch (error) {
|
| 574 |
+
console.error('Erreur lors du chargement des liens:', error);
|
| 575 |
+
serverContainer.innerHTML = '<div class="text-red-500">Erreur de chargement des serveurs</div>';
|
| 576 |
+
}
|
| 577 |
+
}
|
| 578 |
+
|
| 579 |
+
// Générer une URL de streaming simulée
|
| 580 |
+
function generateStreamUrl(movieId, serverId) {
|
| 581 |
+
// En réalité, vous utiliseriez une vraie API pour obtenir ces URLs
|
| 582 |
+
const baseUrls = [
|
| 583 |
+
`https://vidsrc.to/embed/movie/${movieId}`,
|
| 584 |
+
`https://2embed.org/embed/${movieId}`,
|
| 585 |
+
`https://www.2embed.cc/embed/${movieId}`,
|
| 586 |
+
`https://multiembed.mov/?video_id=${movieId}&tmdb=1`
|
| 587 |
+
];
|
| 588 |
+
|
| 589 |
+
return baseUrls[serverId % baseUrls.length];
|
| 590 |
}
|
| 591 |
|
| 592 |
+
// Mettre à jour les boutons de serveur
|
| 593 |
+
function updateServerButtons() {
|
| 594 |
+
serverContainer.innerHTML = '';
|
| 595 |
+
|
| 596 |
+
availableServers.forEach((server, index) => {
|
| 597 |
+
const btn = document.createElement('button');
|
| 598 |
+
btn.className = 'server-btn';
|
| 599 |
+
btn.textContent = server.name;
|
| 600 |
+
btn.onclick = () => changeServer(server);
|
| 601 |
+
|
| 602 |
+
if (index === 0) {
|
| 603 |
+
btn.classList.add('active');
|
| 604 |
+
}
|
| 605 |
+
|
| 606 |
+
serverContainer.appendChild(btn);
|
| 607 |
+
});
|
| 608 |
+
}
|
| 609 |
+
|
| 610 |
+
// Changer de serveur
|
| 611 |
+
function changeServer(server) {
|
| 612 |
+
// Mettre à jour le bouton actif
|
| 613 |
+
document.querySelectorAll('.server-btn').forEach(btn => {
|
| 614 |
+
btn.classList.remove('active');
|
| 615 |
+
if (btn.textContent === server.name) {
|
| 616 |
+
btn.classList.add('active');
|
| 617 |
+
}
|
| 618 |
+
});
|
| 619 |
+
|
| 620 |
+
// Charger la vidéo depuis le nouveau serveur
|
| 621 |
+
loadVideoFromServer(server.url, server.type);
|
| 622 |
+
}
|
| 623 |
+
|
| 624 |
+
// Charger la vidéo depuis un serveur
|
| 625 |
+
function loadVideoFromServer(url, type) {
|
| 626 |
+
currentStreamUrl = url;
|
| 627 |
|
| 628 |
// Réinitialiser le lecteur
|
| 629 |
+
if (player) {
|
| 630 |
+
player.stop();
|
| 631 |
+
}
|
| 632 |
+
|
| 633 |
+
// Configurer la source vidéo en fonction du type
|
| 634 |
+
if (type === 'hls' && Hls.isSupported()) {
|
| 635 |
+
// Pour les streams HLS
|
| 636 |
+
if (window.hls) {
|
| 637 |
+
window.hls.destroy();
|
| 638 |
+
}
|
| 639 |
+
|
| 640 |
+
window.hls = new Hls();
|
| 641 |
+
window.hls.loadSource(url);
|
| 642 |
+
window.hls.attachMedia(document.getElementById('player'));
|
| 643 |
+
window.hls.on(Hls.Events.MANIFEST_PARSED, function() {
|
| 644 |
+
player.play();
|
| 645 |
+
});
|
| 646 |
+
} else {
|
| 647 |
+
// Pour les MP4 standard
|
| 648 |
+
player.source = {
|
| 649 |
+
type: 'video',
|
| 650 |
+
sources: [{
|
| 651 |
+
src: url,
|
| 652 |
+
type: type === 'hls' ? 'application/x-mpegURL' : 'video/mp4'
|
| 653 |
+
}]
|
| 654 |
+
};
|
| 655 |
+
|
| 656 |
+
player.play();
|
| 657 |
+
}
|
| 658 |
}
|
| 659 |
|
| 660 |
// Vérifier la connexion API
|
prompts.txt
CHANGED
|
@@ -8,4 +8,5 @@ rajouter un lecteur video puissant pour regarder les films
|
|
| 8 |
importer et charger en automatique 96325874 film automatiquement
|
| 9 |
JE VEUX CHARGER LES FILMS ET CHARGEMENT DE LA BIBLIOTEQURE TRES RAPIDEMENT EN MODE ROBOTISE EN AUTOMATIQUE
|
| 10 |
AJOUTER Jeton d'accès en lecture à l'API eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJmYjQzN2IxMDcyN2E1YTRlYjhkOTEzNGUyOWM4MmFlMCIsIm5iZiI6MTY4MDYzNzkxMC44NjUsInN1YiI6IjY0MmM3ZmQ2OGI5NTllMDBmNDRkNzNhMCIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.Nhl261Ha3z0Ujg5vM1PpFoZBiTGjlXQ1g9VFPh6dVvs Clé d'API fb437b10727a5a4eb8d9134e29c82ae0
|
| 11 |
-
AJOUTER LES BOUTON REGARGER ER ACTIVER TOUTES LES BOUTON EN AUTOMATIQUE POUR REGARDER LES FILMS QUAND ON CLIQUE SUR LE FILM
|
|
|
|
|
|
| 8 |
importer et charger en automatique 96325874 film automatiquement
|
| 9 |
JE VEUX CHARGER LES FILMS ET CHARGEMENT DE LA BIBLIOTEQURE TRES RAPIDEMENT EN MODE ROBOTISE EN AUTOMATIQUE
|
| 10 |
AJOUTER Jeton d'accès en lecture à l'API eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJmYjQzN2IxMDcyN2E1YTRlYjhkOTEzNGUyOWM4MmFlMCIsIm5iZiI6MTY4MDYzNzkxMC44NjUsInN1YiI6IjY0MmM3ZmQ2OGI5NTllMDBmNDRkNzNhMCIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.Nhl261Ha3z0Ujg5vM1PpFoZBiTGjlXQ1g9VFPh6dVvs Clé d'API fb437b10727a5a4eb8d9134e29c82ae0
|
| 11 |
+
AJOUTER LES BOUTON REGARGER ER ACTIVER TOUTES LES BOUTON EN AUTOMATIQUE POUR REGARDER LES FILMS QUAND ON CLIQUE SUR LE FILM
|
| 12 |
+
JE VEUX QUE TOUTES LES URL DES FILMS SONT INTEGRE AUTOMATIQUEMENT POUR POUVOIR REGARDER LES VRAIS FILMS ET NON LES EXEMPLES
|