fix(sync): 403 InnerTube + WL manquant via fallbacks

- InnerTube 403: la YOUTUBE_API_KEY restreinte par referrer etait
  rejetee sans Referer envoye; ajout headers navigateur + repli cle
  publique du client web (probe live: 401 propre = transport OK)
- Watch Later: repli lecture via InnerTube (browseId WL, sans ID) quand
  l'API Data ne renvoie pas d'ID; repli push via editPlaylist; note
  'via' affichee dans l'UI; debug cles relatedPlaylists conserve
This commit is contained in:
2026-09-26 22:50:53 -04:00
parent 050cea3a92
commit 5a19f8f11f
5 changed files with 132 additions and 25 deletions
@@ -144,6 +144,7 @@
</button>
</div>
<div *ngIf="wlError()" class="mt-2 rounded-lg border border-red-700 bg-red-900/30 p-2 text-xs text-red-200">{{ wlError() }}</div>
<div *ngIf="wlNote()" class="mt-2 rounded-lg border border-blue-700 bg-blue-900/20 p-2 text-xs text-blue-200">{{ wlNote() }}</div>
<div *ngIf="wlItems().length" class="mt-2 text-sm text-slate-300">
{{ wlItems().length }} vidéo(s) dans « Regarder plus tard » YouTube.
<span *ngIf="!wlWriteGranted()" class="text-amber-200">Écriture non autorisée : déconnectez puis reconnectez Google pour l’activer.</span>
@@ -226,6 +226,7 @@ export class ImportComponent implements OnInit {
// -------------------- Watch Later YouTube --------------------
wlItems = signal<Array<{ videoId: string; title: string; thumbnail?: string }>>([]);
wlNote = signal<string | null>(null);
wlLoading = signal(false);
wlWriteGranted = signal(false);
wlError = signal<string | null>(null);
@@ -243,6 +244,7 @@ export class ImportComponent implements OnInit {
next: (res) => {
this.wlItems.set(res?.items || []);
this.wlWriteGranted.set(!!res?.writeGranted);
this.wlNote.set(res?.note || (res?.via === 'innertube' ? 'Liste lue via InnerTube.' : null));
this.wlLoading.set(false);
},
error: (e) => {