Changeset fef781e in Klonkt for src/services


Ignore:
Timestamp:
06/20/2026 04:46:35 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
0d7acdf
Parents:
8ab20b6
Message:

revert: remove YouTube audio functionality (doesn't work)

YouTube blocks audio-only/hidden embed playback with a "Sign in to confirm
you're not a bot" gate → not reliably usable. All YT-audio reverted:

  • embed-player.js + embed.css → state before the feature (audio-only card, YT-album, buildYtAlbum, prewarm, mode-routing removed). Video embeds + the YT/SC volume button remain.
  • audio-player.js → YT backend (ytMode/ensureYT/playYouTube/playYouTubeList/…) removed; only the blob-<audio> player + existing features.
  • AudioEmbedService.js → audio:/video: mode parsing + data-embed-mode removed.
  • audio.js → /yt-title oEmbed proxy removed.
  • post-edit.ejs → audio/video choice on the embed button removed ([[embed:url]]

normal).

busters audio-player.js?v=28, embed-player.js?v=16, embed.css?v=8.

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/services/AudioEmbedService.js

    r8ab20b6 rfef781e  
    6767      case 'youtube':
    6868        return this.embedPlaceholder('youtube', config.id, 'video',
    69           config.url || `https://youtu.be/${config.id}`, config.mode);
     69          config.url || `https://youtu.be/${config.id}`);
    7070      case 'soundcloud':
    7171        return this.embedPlaceholder('soundcloud', config.url, 'track', config.url);
     
    9191   * ALLE waarden via escape() — post.content_html wordt ongeescaped uitgevoerd.
    9292   */
    93   static embedPlaceholder(provider, ref, type, url, mode) {
     93  static embedPlaceholder(provider, ref, type, url) {
    9494    const attrs = [
    9595      `data-embed-provider="${this.escape(provider)}"`,
    9696      `data-embed-ref="${this.escape(ref)}"`,
    9797      type ? `data-embed-type="${this.escape(type)}"` : '',
    98       mode ? `data-embed-mode="${this.escape(mode)}"` : '',
    9998      `data-embed-url="${this.escape(url)}"`,
    10099    ].filter(Boolean).join(' ');
     
    228227  static embedMediaShortcodes(html) {
    229228    if (!html) return html;
    230     return html.replace(/\[\[embed:([^\]]+)\]\]/gi, (match, rawSpec) => {
    231       // Optionele modus-prefix: [[embed:audio:URL]] = alleen-audio speler,
    232       // [[embed:video:URL]] / [[embed:URL]] = normaal (video waar van toepassing).
    233       let spec = rawSpec.trim();
    234       let mode = null;
    235       const mm = spec.match(/^(audio|video):(.+)$/i);
    236       if (mm) { mode = mm[1].toLowerCase(); spec = mm[2].trim(); }
    237       const url = spec.replace(/&amp;/g, '&');
     229    return html.replace(/\[\[embed:([^\]]+)\]\]/gi, (match, rawUrl) => {
     230      const url = rawUrl.trim().replace(/&amp;/g, '&');
    238231      const detected = this.detectProvider(url);
    239232      if (!detected) {
    240233        return `<div class="post-embed-missing"><em>Embed: niet-ondersteunde of ongeldige URL.</em></div>`;
    241234      }
    242       return this.generateIframe(detected.provider, { ...detected, mode }) || match;
     235      return this.generateIframe(detected.provider, detected) || match;
    243236    });
    244237  }
Note: See TracChangeset for help on using the changeset viewer.