0) { echo "Sample item structure:\n"; echo json_encode(array_slice($data[$key][0], 0, 5), JSON_PRETTY_PRINT) . "\n"; } } } // Check if the structure contains video URLs for detail fetching if (isset($data['Recent']) && count($data['Recent']) > 0) { echo "\n=== Looking for detail URLs in Recent items ===\n"; $firstItem = $data['Recent'][0]; $possibleUrlFields = ['url', 'detail_url', 'video_url', 'scene_url', 'link']; $foundUrls = []; foreach ($possibleUrlFields as $field) { if (isset($firstItem[$field])) { $foundUrls[] = "{$field}: {$firstItem[$field]}"; } } if (!empty($foundUrls)) { echo "Found potential detail URLs:\n"; foreach ($foundUrls as $urlInfo) { echo " - {$urlInfo}\n"; } } else { echo "No obvious detail URL fields found in Recent items.\n"; echo "Available fields in first Recent item:\n"; foreach (array_keys($firstItem) as $field) { echo " - {$field}\n"; } } } echo "\n=== Summary ===\n"; echo "To properly implement XBVR sync, I need to:\n"; echo "1. Fetch the main DeoVR API response\n"; echo "2. Extract video list from: " . (isset($data['Recent']) ? 'Recent' : 'unknown') . " array\n"; echo "3. For each video, fetch detail URL to get complete information\n"; echo "4. Map the detailed fields to our database structure\n";