You may have noticed thumbnail sharing videos to social media via the PlayTube script sometimes shares the first Up Next video thumbnail. This is due to the image being too small for Facebook OG data. The reason is, that the script fetches maxresdefault.jpg, which sometimes Youtube does not provide and instead leaves a generic small invalid thumbnail. There’s a simple fix to get it working though.
Find in index.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
if ($pt->page == 'watch') { $og_meta = PT_LoadPage('watch/og-meta', array( 'TITLE' => $pt->title, 'DESC' => mb_substr($pt->description, 0, 400, "UTF-8"), 'THUMB' => str_replace('mqdefault', 'maxresdefault', $get_video->thumbnail), 'URL' => PT_Link('watch/' . PT_Slug($get_video->title, $get_video->video_id)) )); } |
Replace
1 |
'THUMB' => str_replace('mqdefault', 'maxresdefault', $get_video->thumbnail), |
With
1 |
'THUMB' => str_replace('mqdefault', '0', $get_video->thumbnail), |