mirror of
https://github.com/ceratic/MediaCollectorLibary.git
synced 2026-05-13 23:56:46 +02:00
75 lines
2.5 KiB
PHP
75 lines
2.5 KiB
PHP
<?php
|
|
|
|
// Read and analyze the deovr.json structure
|
|
$jsonContent = file_get_contents('c:\Users\larsb\CascadeProjects\windsurf-project\deovr.json');
|
|
|
|
if ($jsonContent === false) {
|
|
die("Could not read deovr.json\n");
|
|
}
|
|
|
|
$data = json_decode($jsonContent, true);
|
|
|
|
if (json_last_error() !== JSON_ERROR_NONE) {
|
|
die("JSON decode error: " . json_last_error_msg() . "\n");
|
|
}
|
|
|
|
echo "=== XBVR DeoVR API Structure Analysis ===\n\n";
|
|
|
|
// Look for the Recent list
|
|
if (isset($data['Recent'])) {
|
|
echo "✓ Found 'Recent' list with " . count($data['Recent']) . " items\n";
|
|
echo "Structure of first Recent item:\n";
|
|
$firstItem = $data['Recent'][0];
|
|
echo json_encode($firstItem, JSON_PRETTY_PRINT) . "\n";
|
|
} else {
|
|
echo "✗ 'Recent' list not found. Available keys:\n";
|
|
echo implode(', ', array_keys($data)) . "\n";
|
|
}
|
|
|
|
// Check if there are other list structures
|
|
$possibleListKeys = ['scenes', 'content', 'videos', 'recent'];
|
|
foreach ($possibleListKeys as $key) {
|
|
if (isset($data[$key]) && is_array($data[$key])) {
|
|
echo "\n✓ Found '{$key}' list with " . count($data[$key]) . " items\n";
|
|
if (count($data[$key]) > 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";
|