diff --git a/shared.php b/shared.php index 59fc471..ee87b4d 100644 --- a/shared.php +++ b/shared.php @@ -137,7 +137,11 @@ } else if (opted_in('y')) { echo ''; } else { - echo "
Embedded content has been disabled to protect your privacy.




or click here to allow them permanently,

" . "or click here to watch the video on YouTube:
" . $youtube['link'] . "



Please note that, by enabling this video, data is transferred
to YouTube LLC, and is subject to their privacy policy.
"; + $preview_file = YT_PREVIEW . $youtube['vid'] . ".jpg"; + if (!file_exists($_SERVER['DOCUMENT_ROOT'] . $preview_file)) { + file_put_contents($_SERVER['DOCUMENT_ROOT'] . $preview_file, file_get_contents("https://img.youtube.com/vi/" . $youtube['vid'] . "/maxresdefault.jpg")); + } + echo "
Embedded content has been disabled to protect your privacy.




or click here to allow them permanently,

" . "or click here to watch the video on YouTube:
" . $youtube['link'] . "



Please note that, by enabling this video, data is transferred
to YouTube LLC, and is subject to their privacy policy.
"; } } else { // TODO: HTML5 video