Closed tnorthcutt closed 6 years ago
Quick glance...it looks like https://github.com/WebDevStudios/Automatic-Featured-Images-from-Videos/blob/master/automatic-featured-images-from-videos.php#L192 Is only returning the first 8 characters...
I don't have time to test it this morning, but I think you could replace the conditional in wds_check_for_vimeo with:
if ( preg_match( '\/\/(.+\.)?(vimeo\.com)\/(\d*)', $content, $vimeo_matches ) ) {
return $vimeo_matches[3] );
}
Nice. Turns out it needs a delimiter; I added #
like so:
if ( preg_match( '#\/\/(.+\.)?(vimeo\.com)\/(\d*)#', $content, $vimeo_matches ) ) {
return $vimeo_matches[3];
}
Chances are the plugin was coded for a time when vimeo's id values were only 8 characters long, and they have since surpassed. Travis issued a PR with Gary's recommendation. Works for me :D
Edit: upon further testing, this is happening with all Vimeo videos for my use case, in my (admittedly limited) testing. Not sure why, but definitely not isolated to private videos.
It seems that in some cases, embedding a private video in a post results in a completely different video used to fetch a thumbnail. The only connection seems to be that the URL for the video used is the same as the private video URL, with the last character of the URL removed.
So on a post with
https://vimeo.com/235253177
(note the double7
at the end) in the content, the video fetched becomeshttps://vimeo.com/23525317
(note the single7
at the end).This of course produces extremely undesirable (though sometimes hilarious) results.
Any suggested strategies for mitigating this problem?