docto41 commited on
Commit
91ff4d4
·
verified ·
1 Parent(s): 82ddecc

Add 2 files

Browse files
Files changed (2) hide show
  1. index.html +199 -22
  2. prompts.txt +2 -1
index.html CHANGED
@@ -139,6 +139,50 @@
139
  justify-content: space-between;
140
  align-items: center;
141
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  </style>
143
  </head>
144
  <body class="min-h-screen">
@@ -289,12 +333,32 @@
289
  </div>
290
  <p id="modal-overview" class="text-gray-300 mb-4"></p>
291
  <div id="modal-genres" class="flex flex-wrap gap-2 mb-4"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
292
  <div class="mt-4">
293
  <button type="button" onclick="closeModal()" class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-primary text-base font-medium text-white hover:bg-secondary focus:outline-none sm:ml-3 sm:w-auto sm:text-sm">
294
  Fermer
295
  </button>
296
  <button id="watch-now-btn" onclick="startStreaming()" class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-green-600 text-base font-medium text-white hover:bg-green-700 focus:outline-none sm:ml-3 sm:w-auto sm:text-sm">
297
- <i class="fas fa-play mr-2"></i> Regarder maintenant
298
  </button>
299
  </div>
300
  </div>
@@ -313,9 +377,11 @@
313
  </button>
314
  </div>
315
  <div class="streaming-content">
316
- <div class="w-full h-full" style="max-width: 1200px;">
317
- <div class="video-container">
318
- <iframe id="streaming-player" allowfullscreen></iframe>
 
 
319
  </div>
320
  </div>
321
  </div>
@@ -337,7 +403,32 @@
337
  // Configuration
338
  const API_KEY = 'c45a857c193f6302f2b5061c3b85e743'; // Clé API TMDB valide
339
  const BASE_URL = 'https://api.themoviedb.org/3';
340
- const STREAMING_PROVIDER = 'https://vidsrc.to/embed/movie/'; // Service de streaming tiers
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
341
  let currentPage = 1;
342
  let currentFilter = 'popular';
343
  let currentGenre = null;
@@ -345,6 +436,8 @@
345
  let totalPages = 1;
346
  let isLoading = false;
347
  let currentMovieId = null;
 
 
348
 
349
  // Fonction utilitaire pour faire les requêtes API
350
  async function fetchAPI(endpoint, params = {}) {
@@ -615,6 +708,15 @@
615
  const movie = await fetchAPI(`/movie/${movieId}`);
616
  currentMovieId = movieId;
617
 
 
 
 
 
 
 
 
 
 
618
  // Remplir la modal
619
  const modalPoster = document.querySelector('#modal-poster img');
620
  modalPoster.src = movie.poster_path
@@ -658,6 +760,22 @@
658
  document.getElementById('movie-modal').classList.add('hidden');
659
  }
660
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
661
  // Démarrer le streaming depuis la modal
662
  function startStreaming() {
663
  if (currentMovieId) {
@@ -668,37 +786,96 @@
668
  }
669
 
670
  // Démarrer le streaming automatique dans une nouvelle fenêtre
671
- function startAutoStreaming(movieId, movieTitle) {
672
  currentMovieId = movieId;
673
 
674
  // Afficher la fenêtre de streaming
675
  const streamingWindow = document.getElementById('streaming-window');
676
  document.getElementById('streaming-title').textContent = movieTitle;
677
 
678
- // Configurer le lecteur vidéo avec le service de streaming tiers
679
- const player = document.getElementById('streaming-player');
680
- player.src = `${STREAMING_PROVIDER}${movieId}`;
 
 
 
 
 
681
 
682
  // Afficher la fenêtre de streaming
683
  streamingWindow.classList.remove('hidden');
684
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
685
  // Mettre le focus sur la fenêtre de streaming
686
  streamingWindow.focus();
687
 
688
- // Lecture automatique (certains navigateurs bloquent cette fonctionnalité)
689
- player.onload = function() {
690
  try {
691
- player.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');
692
  } catch (e) {
693
  console.log("Auto-play blocked by browser");
694
  }
695
- };
696
  }
697
 
698
  // Fermer la fenêtre de streaming
699
  function closeStreamingWindow() {
700
- const player = document.getElementById('streaming-player');
701
- player.src = '';
702
  document.getElementById('streaming-window').classList.add('hidden');
703
  }
704
 
@@ -710,13 +887,13 @@
710
 
711
  // Basculer en plein écran
712
  function toggleFullscreen() {
713
- const player = document.getElementById('streaming-player');
714
- if (player.requestFullscreen) {
715
- player.requestFullscreen();
716
- } else if (player.webkitRequestFullscreen) {
717
- player.webkitRequestFullscreen();
718
- } else if (player.msRequestFullscreen) {
719
- player.msRequestFullscreen();
720
  }
721
  }
722
  </script>
 
139
  justify-content: space-between;
140
  align-items: center;
141
  }
142
+
143
+ /* Style pour la sélection de serveur */
144
+ .server-list {
145
+ display: flex;
146
+ gap: 10px;
147
+ flex-wrap: wrap;
148
+ margin-top: 10px;
149
+ }
150
+
151
+ .server-btn {
152
+ padding: 8px 12px;
153
+ border-radius: 20px;
154
+ font-size: 14px;
155
+ cursor: pointer;
156
+ transition: all 0.2s;
157
+ }
158
+
159
+ .server-btn.active {
160
+ background-color: #6d28d9;
161
+ color: white;
162
+ }
163
+
164
+ .server-btn.inactive {
165
+ background-color: #334155;
166
+ color: #94a3b8;
167
+ }
168
+
169
+ /* Animation de chargement du streaming */
170
+ .stream-loading {
171
+ display: flex;
172
+ flex-direction: column;
173
+ align-items: center;
174
+ justify-content: center;
175
+ gap: 20px;
176
+ }
177
+
178
+ .stream-loading-spinner {
179
+ width: 50px;
180
+ height: 50px;
181
+ border: 5px solid rgba(255, 255, 255, 0.1);
182
+ border-radius: 50%;
183
+ border-top-color: #6d28d9;
184
+ animation: spin 1s linear infinite;
185
+ }
186
  </style>
187
  </head>
188
  <body class="min-h-screen">
 
333
  </div>
334
  <p id="modal-overview" class="text-gray-300 mb-4"></p>
335
  <div id="modal-genres" class="flex flex-wrap gap-2 mb-4"></div>
336
+
337
+ <!-- Serveurs de streaming -->
338
+ <div class="mb-4">
339
+ <h4 class="text-sm font-semibold text-gray-400 mb-2">CHOISIR UN SERVEUR :</h4>
340
+ <div class="server-list">
341
+ <button onclick="selectServer('vidsrc')" class="server-btn active" data-server="vidsrc">
342
+ <i class="fas fa-server mr-1"></i> VidSrc
343
+ </button>
344
+ <button onclick="selectServer('superembed')" class="server-btn inactive" data-server="superembed">
345
+ <i class="fas fa-server mr-1"></i> SuperEmbed
346
+ </button>
347
+ <button onclick="selectServer('vidsrcpro')" class="server-btn inactive" data-server="vidsrcpro">
348
+ <i class="fas fa-bolt mr-1"></i> VidSrc Pro
349
+ </button>
350
+ <button onclick="selectServer('databasegdriveplayer')" class="server-btn inactive" data-server="databasegdriveplayer">
351
+ <i class="fas fa-database mr-1"></i> Database
352
+ </button>
353
+ </div>
354
+ </div>
355
+
356
  <div class="mt-4">
357
  <button type="button" onclick="closeModal()" class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-primary text-base font-medium text-white hover:bg-secondary focus:outline-none sm:ml-3 sm:w-auto sm:text-sm">
358
  Fermer
359
  </button>
360
  <button id="watch-now-btn" onclick="startStreaming()" class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-green-600 text-base font-medium text-white hover:bg-green-700 focus:outline-none sm:ml-3 sm:w-auto sm:text-sm">
361
+ <i class="fas fa-play mr-2"></i> Lecture auto
362
  </button>
363
  </div>
364
  </div>
 
377
  </button>
378
  </div>
379
  <div class="streaming-content">
380
+ <div id="streaming-player-container" class="w-full h-full" style="max-width: 1200px;">
381
+ <!-- Contenu du lecteur sera chargé ici -->
382
+ <div id="stream-loading" class="stream-loading w-full h-full">
383
+ <div class="stream-loading-spinner"></div>
384
+ <p class="text-gray-300">Chargement du flux vidéo...</p>
385
  </div>
386
  </div>
387
  </div>
 
403
  // Configuration
404
  const API_KEY = 'c45a857c193f6302f2b5061c3b85e743'; // Clé API TMDB valide
405
  const BASE_URL = 'https://api.themoviedb.org/3';
406
+
407
+ // Serveurs de streaming avec URLs de base
408
+ const STREAMING_SERVERS = {
409
+ vidsrc: {
410
+ name: 'VidSrc',
411
+ url: 'https://vidsrc.to/embed/movie/',
412
+ autoPlay: true
413
+ },
414
+ superembed: {
415
+ name: 'SuperEmbed',
416
+ url: 'https://multiembed.mov/?video_id=',
417
+ autoPlay: true
418
+ },
419
+ vidsrcpro: {
420
+ name: 'VidSrc Pro',
421
+ url: 'https://vidsrc.stream/movie/',
422
+ autoPlay: true
423
+ },
424
+ databasegdriveplayer: {
425
+ name: 'Database',
426
+ url: 'https://database.gdriveplayer.us/player.php?imdb=',
427
+ autoPlay: false,
428
+ requiresIMDB: true
429
+ }
430
+ };
431
+
432
  let currentPage = 1;
433
  let currentFilter = 'popular';
434
  let currentGenre = null;
 
436
  let totalPages = 1;
437
  let isLoading = false;
438
  let currentMovieId = null;
439
+ let currentIMDBId = null;
440
+ let selectedServer = 'vidsrc';
441
 
442
  // Fonction utilitaire pour faire les requêtes API
443
  async function fetchAPI(endpoint, params = {}) {
 
708
  const movie = await fetchAPI(`/movie/${movieId}`);
709
  currentMovieId = movieId;
710
 
711
+ // Récupérer l'ID IMDB si disponible
712
+ if (movie.imdb_id) {
713
+ currentIMDBId = movie.imdb_id;
714
+ } else {
715
+ // Si l'ID IMDB n'est pas disponible, essayer de le récupérer via l'API
716
+ const externalIds = await fetchAPI(`/movie/${movieId}/external_ids`);
717
+ currentIMDBId = externalIds.imdb_id || null;
718
+ }
719
+
720
  // Remplir la modal
721
  const modalPoster = document.querySelector('#modal-poster img');
722
  modalPoster.src = movie.poster_path
 
760
  document.getElementById('movie-modal').classList.add('hidden');
761
  }
762
 
763
+ // Sélectionner un serveur de streaming
764
+ function selectServer(serverId) {
765
+ selectedServer = serverId;
766
+
767
+ // Mettre à jour l'état des boutons
768
+ document.querySelectorAll('.server-btn').forEach(btn => {
769
+ if (btn.dataset.server === serverId) {
770
+ btn.classList.remove('inactive');
771
+ btn.classList.add('active');
772
+ } else {
773
+ btn.classList.remove('active');
774
+ btn.classList.add('inactive');
775
+ }
776
+ });
777
+ }
778
+
779
  // Démarrer le streaming depuis la modal
780
  function startStreaming() {
781
  if (currentMovieId) {
 
786
  }
787
 
788
  // Démarrer le streaming automatique dans une nouvelle fenêtre
789
+ async function startAutoStreaming(movieId, movieTitle) {
790
  currentMovieId = movieId;
791
 
792
  // Afficher la fenêtre de streaming
793
  const streamingWindow = document.getElementById('streaming-window');
794
  document.getElementById('streaming-title').textContent = movieTitle;
795
 
796
+ // Afficher l'état de chargement
797
+ const playerContainer = document.getElementById('streaming-player-container');
798
+ playerContainer.innerHTML = `
799
+ <div id="stream-loading" class="stream-loading w-full h-full">
800
+ <div class="stream-loading-spinner"></div>
801
+ <p class="text-gray-300">Chargement du flux vidéo...</p>
802
+ </div>
803
+ `;
804
 
805
  // Afficher la fenêtre de streaming
806
  streamingWindow.classList.remove('hidden');
807
 
808
+ // Récupérer les informations du film pour l'ID IMDB si nécessaire
809
+ let imdbId = currentIMDBId;
810
+ if (!imdbId && STREAMING_SERVERS[selectedServer].requiresIMDB) {
811
+ try {
812
+ const externalIds = await fetchAPI(`/movie/${movieId}/external_ids`);
813
+ imdbId = externalIds.imdb_id;
814
+ if (!imdbId) {
815
+ throw new Error("ID IMDB non disponible");
816
+ }
817
+ } catch (error) {
818
+ console.error("Erreur lors de la récupération de l'ID IMDB:", error);
819
+ playerContainer.innerHTML = `
820
+ <div class="flex flex-col items-center justify-center h-full text-red-400">
821
+ <i class="fas fa-exclamation-triangle text-4xl mb-4"></i>
822
+ <p class="text-lg">Impossible de trouver l'ID IMDB pour ce film</p>
823
+ <p class="text-sm text-gray-400 mt-2">Essayez avec un autre serveur</p>
824
+ </div>
825
+ `;
826
+ return;
827
+ }
828
+ }
829
+
830
+ // Construire l'URL de streaming en fonction du serveur sélectionné
831
+ let streamingUrl;
832
+ const serverConfig = STREAMING_SERVERS[selectedServer];
833
+
834
+ if (serverConfig.requiresIMDB && imdbId) {
835
+ streamingUrl = serverConfig.url + imdbId;
836
+ } else {
837
+ streamingUrl = serverConfig.url + movieId;
838
+ }
839
+
840
+ // Ajouter le paramètre de lecture automatique si pris en charge
841
+ if (serverConfig.autoPlay) {
842
+ streamingUrl += '/auto';
843
+ }
844
+
845
+ // Créer l'iframe pour le lecteur vidéo
846
+ const iframe = document.createElement('iframe');
847
+ iframe.id = 'streaming-player';
848
+ iframe.src = streamingUrl;
849
+ iframe.setAttribute('allowfullscreen', '');
850
+ iframe.setAttribute('scrolling', 'no');
851
+ iframe.setAttribute('frameborder', '0');
852
+ iframe.setAttribute('marginwidth', '0');
853
+ iframe.setAttribute('marginheight', '0');
854
+ iframe.style.width = '100%';
855
+ iframe.style.height = '100%';
856
+ iframe.style.border = 'none';
857
+
858
+ // Remplacer le chargement par le lecteur
859
+ playerContainer.innerHTML = '';
860
+ playerContainer.appendChild(iframe);
861
+
862
  // Mettre le focus sur la fenêtre de streaming
863
  streamingWindow.focus();
864
 
865
+ // Tentative de lecture automatique (peut être bloquée par le navigateur)
866
+ setTimeout(() => {
867
  try {
868
+ iframe.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');
869
  } catch (e) {
870
  console.log("Auto-play blocked by browser");
871
  }
872
+ }, 2000);
873
  }
874
 
875
  // Fermer la fenêtre de streaming
876
  function closeStreamingWindow() {
877
+ const playerContainer = document.getElementById('streaming-player-container');
878
+ playerContainer.innerHTML = '';
879
  document.getElementById('streaming-window').classList.add('hidden');
880
  }
881
 
 
887
 
888
  // Basculer en plein écran
889
  function toggleFullscreen() {
890
+ const playerContainer = document.getElementById('streaming-player-container');
891
+ if (playerContainer.requestFullscreen) {
892
+ playerContainer.requestFullscreen();
893
+ } else if (playerContainer.webkitRequestFullscreen) {
894
+ playerContainer.webkitRequestFullscreen();
895
+ } else if (playerContainer.msRequestFullscreen) {
896
+ playerContainer.msRequestFullscreen();
897
  }
898
  }
899
  </script>
prompts.txt CHANGED
@@ -5,4 +5,5 @@ CORRIGER ERREUR DE CHARGEMENT DES FILMS
5
  corriger l'erreur 401
6
  RECONFIGURE LE SITE AFIN DE CORRIGER LES ERREUR 401
7
  je veux regarder les film en automatique activer les boutons regarder en automatique
8
- activer les lecture des films dans une nouvel fenetre en mode lecture automatique
 
 
5
  corriger l'erreur 401
6
  RECONFIGURE LE SITE AFIN DE CORRIGER LES ERREUR 401
7
  je veux regarder les film en automatique activer les boutons regarder en automatique
8
+ activer les lecture des films dans une nouvel fenetre en mode lecture automatique
9
+ intégrer des serveur pour regarder en autoplay