- Fixed the Imgur embed path.

Imgur now uses a local wrapper page, 
[provider_embed.php](/Users/tyemeclifford/Documents/GH/mediaplayer/provider_embed.php), 
that renders Imgur’s official blockquote + 
https://s.imgur.com/min/embed.js snippet instead of trying to iframe 
Imgur directly. That should avoid the “refuses to connect” issue for 
albums, galleries, images, GIFs, GIFV, and videos.
Also updated:
[includes/db.php](/Users/tyemeclifford/Documents/GH/mediaplayer/includes/db.php): 
Imgur embed URLs now point to the wrapper, and Imgur view-count scraping 
has dedicated fallback patterns.
[admin/index.php](/Users/tyemeclifford/Documents/GH/mediaplayer/admin/index.php): 
Upkeeping → Correct Views now explicitly counts Imgur-backed items in 
the candidate summary.
[README.md](/Users/tyemeclifford/Documents/GH/mediaplayer/README.md): 
documented the Imgur wrapper behavior.
This commit is contained in:
Ty Clifford
2026-06-25 08:36:40 -04:00
parent 173fe3917e
commit 4425716d6f
4 changed files with 116 additions and 3 deletions
+3 -1
View File
@@ -95,6 +95,7 @@ $list_stmt->execute();
$videos = $list_stmt->fetchAll();
$youtube_timestamp_candidates = media_youtube_timestamp_candidate_count();
$external_view_candidates = media_external_view_count_candidate_count();
$imgur_view_candidates = media_imgur_view_count_candidate_count();
$admin_total_views = total_video_views(false);
$qs = fn($p) => '?' . http_build_query(array_filter(['q' => $search, 'page' => $p]));
@@ -241,7 +242,8 @@ render_head('Admin — TyClifford.com', '
<h2 class="card-title">Correct external view counts</h2>
<p class="hint">
Scrapes readable counts from supported providers and adds them to the media-site totals alongside local plays.
<?= $external_view_candidates ?> external video<?= $external_view_candidates === 1 ? '' : 's' ?> can be checked.
<?= $external_view_candidates ?> external video<?= $external_view_candidates === 1 ? '' : 's' ?> can be checked,
including <?= $imgur_view_candidates ?> Imgur-backed item<?= $imgur_view_candidates === 1 ? '' : 's' ?>.
Current database total: <?= h(view_count_label((int)$admin_total_views)) ?>.
</p>
</div>