# [メタ情報] # 識別子: 音楽音声専用のダウンロード禁止パッケージ作成_exe # 補足: # [/メタ情報] 要約: WordPressにおける音楽・動画コンテンツ再生システムを説明したテキストです。 主要構成は、フルページ用`mu1.php`と埋め込み用`mu1emd.php`の2テンプレート。 これらは`drid`に基づき外部JSONから情報取得し、動画/音声プレーヤーで再生します。 共通機能はコンテンツ保護(ダウンロード・右クリック禁止)、字幕(全画面時表示、リストからのシーク)、レスポンシブデザインです。 `mu1.php`は動的配信(`rd.php`)とGoogle翻訳にも対応。 埋め込みコードは`mu1emd.php`を呼び出し、CSS/JSで再生・保護機能を制御します。 mu1.php ``` $timeout, 'headers' => ['User-Agent' => 'mu1/1.0'], ]); if (is_wp_error($res)) return null; $code = (int) wp_remote_retrieve_response_code($res); if ($code < 200 || $code >= 300) return null; $body = wp_remote_retrieve_body($res); return ($body !== '') ? $body : null; } function mu1_fetch_videoct(): ?array { $json_url = 'https://XXXXXX.com/gd_proxy/?f=videoct.json'; $body = mu1_http_get($json_url, 12); if ($body === null) return null; $data = json_decode($body, true); return is_array($data) ? $data : null; } function mu1_find_video(array $rows, string $drid): ?array { foreach ($rows as $r) { if (isset($r['videoid']) && (string)$r['videoid'] === (string)$drid) return $r; } return null; } function mu1_extract_wpidex_from_url(?string $u): string { if (!$u) return ''; $p = parse_url($u); if (!empty($p['query'])) { parse_str($p['query'], $qs); if (!empty($qs['id'])) { $id = (string)$qs['id']; $id = preg_replace('/\.(mp4|m4v|mov|mp3|m4a|wav|jpg|jpeg|png|gif|webp|vtt|srt|txt)$/i', '', $id); return $id ?: ''; } } $path = $p['path'] ?? ''; if ($path === '') return ''; $base = basename($path); $id = preg_replace('/\.(mp4|m4v|mov|mp3|m4a|wav|jpg|jpeg|png|gif|webp|vtt|srt|txt|php)$/i', '', $base); return $id ?: ''; } function mu1_try_rd(string $id): int { if ($id === '') return -1; $rd_abs = rtrim(home_url('/rd.php'), '/'); $url = $rd_abs . '?id=' . rawurlencode($id) . '&mode=dynamic'; $head = wp_remote_head($url, ['timeout'=>8, 'headers'=>['Range'=>'bytes=0-1']]); if (is_wp_error($head)) return -1; return (int) wp_remote_retrieve_response_code($head); } function mu1_probe_id(array $candidates, array &$diag_log): ?array { $seen = []; foreach ($candidates as $cand) { $cand = trim((string)$cand); if ($cand === '') continue; $key = strtolower($cand); if (isset($seen[$key])) continue; $seen[$key] = true; $code = mu1_try_rd($cand); $diag_log[] = sprintf('probe id="%s" -> %d', $cand, $code); if ($code >= 200 && $code < 400) return ['id' => $cand, 'code' => $code]; } return null; } /* ========= 本体 ========= */ get_header(); ?>
Gemini Q&A
'; if ($original_drid === '') { echo '

drid が指定されていません。

'; get_footer(); return; } $rows = mu1_fetch_videoct(); if (!$rows) { echo '

JSONデータの取得に失敗しました。

'; get_footer(); return; } $v = mu1_find_video($rows, $current_drid); if (!$v && $current_drid !== $original_drid) { $v = mu1_find_video($rows, $original_drid); if ($v) $current_drid = $original_drid; } if (!$v) { echo '

該当IDが見つかりません:' . esc_html($original_drid) . '

'; get_footer(); return; } $drid = $current_drid; $image_url = (string)($v['image'] ?? ''); $video_url = (string)($v['video'] ?? ''); $subtitle_url = (string)($v['subtitle'] ?? ''); $subtitle_list_url = (string)($v['subtitle_list'] ?? ''); $explain_line_url = (string)($v['explain_line'] ?? ''); $rd_abs = rtrim(home_url('/rd.php'), '/'); $diag_log = []; if ($rid_override !== '') { $chosen_id = $rid_override; $chosen_code = mu1_try_rd($chosen_id); $diag_log[] = sprintf('override id="%s" code=%d', $chosen_id, $chosen_code); } else { $cands = []; $cands[] = mu1_extract_wpidex_from_url($video_url); $cands[] = mu1_extract_wpidex_from_url($subtitle_url); $cands[] = mu1_extract_wpidex_from_url($image_url); $cands[] = $drid; $more = []; foreach ($cands as $c) { if (!$c) continue; $more[] = strtolower($c); $more[] = strtoupper($c); } $cands = array_merge($cands, $more); $picked = mu1_probe_id($cands, $diag_log); if ($picked) { $chosen_id = $picked['id']; $chosen_code = $picked['code']; } else { $chosen_id = ''; $chosen_code = -1; } } $stream_src = ''; if ($force_direct && !empty($video_url)) { $stream_src = $video_url; } else { if ($chosen_id !== '') { $stream_src = $rd_abs . '?id=' . rawurlencode($chosen_id) . '&mode=dynamic'; } else { $stream_src = $video_url; } } $is_audio = preg_match('/\.(mp3|m4a|wav)(?:\?.*)?$/i', $video_url); ?> '; if (!empty($video_url)) { if ($is_audio) { echo '
'; if (!empty($image_url)) { echo '
'; echo 'Audio Cover'; } echo ''; echo '
'; echo ' 00:00'; echo ' '; echo ' 00:00'; echo '
'; echo ''; echo '
'; } else { echo '
'; echo ''; echo ''; echo '
'; } ?> '; echo ''; if (!empty($subtitle_list_url)) { echo '
'; $html = mu1_http_get($subtitle_list_url, 10); echo $html ? $html : '

字幕一覧の取得に失敗しました。

'; echo '
'; ?> '; if (strpos($txt, '<') !== false && strpos($txt, '>') !== false) { echo wp_kses_post($txt); } else { echo '

' . nl2br(esc_html($txt)) . '

'; } echo ''; } } echo ''; if (have_posts()) : while (have_posts()) : the_post(); echo '
'; the_content(); echo '
'; endwhile; endif; get_footer(); ?> ``` mu1emd.php ``` :root{ --mu1emd-max: 1920px; } #subtitleOverlay, #scSubtitleOverlay, .overlay-cue, .band { display: none !important; opacity: 0 !important; } .imk-line { display: inline-block; width: 100%; border-radius: 2px; transition: background-color 0.1s; } .mu1emd-sublist details > p{ height:200px; overflow:auto; background-color:#EDF7FF; padding:2px 6px; margin:0; box-shadow:3px 3px 4px black; position: relative; } .mu1emd-sublist details > summary{ padding:2px 6px; width:100%; background-color:#ddd; border:none; box-shadow:3px 3px 4px black; cursor:pointer; list-style:none; } '; if ($is_audio) { echo ' .audio-player-wrap { position: relative; width: 100%; max-width: min(var(--mu1emd-max, 1920px), 98vw); margin: 0 auto; background: #000; overflow: hidden; border-radius: 4px; } .audio-cover-image { width: 100%; height: auto; display: block; cursor: pointer; } .center-play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 80px; height: 80px; background: rgba(0, 0, 0, 0.6); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 40px; cursor: pointer; z-index: 10; padding-left: 6px; } .center-play-btn.is-playing { opacity: 0; pointer-events: none; } .custom-audio-bar { display: flex; align-items: center; justify-content: center; height: 27px; background: #111; color: #fff; padding: 0 15px; font-family: sans-serif; font-size: 14px; } .custom-audio-bar input[type="range"] { flex: 1; margin: 0 15px; cursor: pointer; height: 4px; } #myVideo { display: none !important; }'; } else { echo ' .video-wrap{position:relative;width:100%;margin:0 auto} #myVideo{width:100%;height:auto;min-height:200px;display:block;background:#000;}'; } echo ''; echo '
'; if ($is_audio) { echo '
'; if(!empty($image_url)) { echo '
'; echo ''; } echo ''; echo '
00:00 00:00
'; echo '
'; } else { echo '
'; echo ''; echo '
'; } if (!empty($subtitle_list_url)) { echo '
'.file_get_contents($subtitle_list_url).'
'; } echo '
'; ?> ``` musicの埋め込みコード ```
[dynamic_external_html url="https://XXXXXX.com/mu1emd/?drid=@@VIDEOID@@&frag=1"]
``` 対応条件 { "VIDEOID":"3" }