Upload via Git Manager GUI - update-dreamtripspk.php

This commit is contained in:
2026-03-30 18:42:41 +00:00
parent 3563752968
commit 12d1da2818

View File

@@ -1,61 +1,61 @@
<?php <?php
/** /**
* Update DreamTripspk post with direct video URL * Update DreamTripspk post with direct video URL
*/ */
define('WP_USE_THEMES', false); define('WP_USE_THEMES', false);
require('../../../wp-load.php'); require('../../../wp-load.php');
$video_url = 'https://www.youtube.com/watch?v=kWRhLLbLFE0'; $video_url = 'https://www.youtube.com/watch?v=kWRhLLbLFE0';
$post_id = 17512; // DreamTripspk Post ID $post_id = 17512; // DreamTripspk Post ID
echo "=== Updating DreamTripspk Post ===\n\n"; echo "=== Updating DreamTripspk Post ===\n\n";
// Update the meta field // Update the meta field
$result = update_post_meta($post_id, '_mm_livestream_player_url', $video_url); $result = update_post_meta($post_id, '_mm_livestream_player_url', $video_url);
if ($result) { if ($result) {
echo "✓ Updated _mm_livestream_player_url to: $video_url\n"; echo "✓ Updated _mm_livestream_player_url to: $video_url\n";
} else { } else {
// Check if value already exists // Check if value already exists
$current = get_post_meta($post_id, '_mm_livestream_player_url', true); $current = get_post_meta($post_id, '_mm_livestream_player_url', true);
if ($current === $video_url) { if ($current === $video_url) {
echo "✓ Value already set to: $video_url\n"; echo "✓ Value already set to: $video_url\n";
} else { } else {
echo "✗ Update failed. Current value: $current\n"; echo "✗ Update failed. Current value: $current\n";
} }
} }
// Clear caches // Clear caches
$channel_id = get_post_meta($post_id, '_mm_livestream_youtube_channel_id', true); $channel_id = get_post_meta($post_id, '_mm_livestream_youtube_channel_id', true);
if ($channel_id) { if ($channel_id) {
$channel_url = 'https://www.youtube.com/channel/' . $channel_id . '/live'; $channel_url = 'https://www.youtube.com/channel/' . $channel_id . '/live';
$cache_key = 'mm_yt_live_v2_' . md5($channel_url); $cache_key = 'mm_yt_live_v2_' . md5($channel_url);
delete_transient($cache_key); delete_transient($cache_key);
echo "✓ Cleared cache for channel\n"; echo "✓ Cleared cache for channel\n";
} }
// Clear video status cache // Clear video status cache
delete_transient('mm_yt_status_kWRhLLbLFE0'); delete_transient('mm_yt_status_kWRhLLbLFE0');
echo "✓ Cleared video status cache\n"; echo "✓ Cleared video status cache\n";
// Test the livestream data // Test the livestream data
echo "\n=== Testing Livestream Item ===\n"; echo "\n=== Testing Livestream Item ===\n";
$item = mm_video_get_livestream_item($post_id); $item = mm_video_get_livestream_item($post_id);
if ($item) { if ($item) {
echo "Title: " . $item['title'] . "\n"; echo "Title: " . $item['title'] . "\n";
echo "Owner: " . $item['owner'] . "\n"; echo "Owner: " . $item['owner'] . "\n";
echo "Platform: " . $item['stream']['platform'] . "\n"; echo "Platform: " . $item['stream']['platform'] . "\n";
echo "Video ID: " . $item['stream']['video_id'] . "\n"; echo "Video ID: " . $item['stream']['video_id'] . "\n";
echo "Embed URL: " . ($item['stream']['embed_url'] ? 'SET' : 'EMPTY') . "\n"; echo "Embed URL: " . ($item['stream']['embed_url'] ? 'SET' : 'EMPTY') . "\n";
// Test live status // Test live status
if (!empty($item['stream']['video_id'])) { if (!empty($item['stream']['video_id'])) {
$is_live = mm_video_check_youtube_live_status($item['stream']['video_id']); $is_live = mm_video_check_youtube_live_status($item['stream']['video_id']);
echo "Live Status: " . ($is_live ? "LIVE" : "NOT LIVE") . "\n"; echo "Live Status: " . ($is_live ? "LIVE" : "NOT LIVE") . "\n";
} }
} else { } else {
echo "ERROR: Could not get livestream item data\n"; echo "ERROR: Could not get livestream item data\n";
} }
echo "\n✓ Update Complete! Reload the page.\n"; echo "\n✓ Update Complete! Reload the page.\n";