[이윰] 비메오 썸네일 추출 올바르게 적용하기
페이지 정보
shadow2fox
1,256 2 2
2023.04.24 10:45:53
짧은주소
-
https://yadolee.com/tip/1046 주소복사
본문
📝 비메오 썸네일 추출 올바르게 적용하기
이윰빌더 3,x, 4.x 이용 중 비메오 썸네일 추출이 올바르게 적용되지 않는다면 아래와 같은 소스 수정을 해 보도록 하자.
이윰빌더 3.x : 그누보드5/eyoom/classes/eyoom.class.php,
이윰빌더 4.x : 그누보드5/eyoom/classes/bbs.class.php
를 열어 $output = $this->curl_web_scripping($url);를 검색하고 수정한다.
수정 전
case 'vimeo.com':
preg_match('/\<meta property=\"og:url\"\scontent=\"(?P<vid>[a-zA-Z0-9:\/\._]+)\"/i', $output, $scrapping);
$out['vid'] = $this->get_video_key($this->eyoom_host($scrapping['vid']));
preg_match('/\<meta property=\"og:image\"([^\<\>])*\>/i', $output, $scrapping);
$temp1 = explode('=', htmlspecialchars($scrapping[0]));
$temp2 = explode('/', urldecode($temp1[3]));
$temp3 = explode('_', urldecode($temp2[4]));
$out['imgkey'] = $temp3[0];
return $out;
break;
수정 후
case 'vimeo.com':
preg_match('/\<meta property=\"og:url\"\scontent=\"(?P<vid>[a-zA-Z0-9:\/\._]+)\"/i', $output, $scrapping);
if(array_key_exists("vid", $scrapping)) $out['vid'] = $this->get_video_key($this->eyoom_host($scrapping['vid']));
//preg_match('/\<meta property=\"og:image\"([^\<\>])*\>/i', $output, $scrapping);
//if(isset($scrapping[0])) $temp1 = explode('=', htmlspecialchars($scrapping[0]));
//if(isset($temp1[3])) $temp2 = explode('/', urldecode($temp1[3]));
//if(isset($temp2[4])) $temp3 = explode('_', urldecode($temp2[4]));
//if(isset($temp3[0])) $out['imgkey'] = $temp3[0];
preg_match('/\<meta property=\"og:image\"\scontent=\"(?P<imgsrc>[a-zA-Z0-9:\/\._-]+)\"/i', $output, $scrapping);
if(array_key_exists("imgsrc", $scrapping)) $out['imgkey'] = $scrapping['imgsrc'];
return $out;
break;
$video['img_url'] = "https://i.vimeocdn.com/video/{$video['key2']}.jpg" 검색하고 수정한다.
수정 전
case 'vimeo.com':
$video['img_url'] = "https://i.vimeocdn.com/video/{$video['key2']}.jpg";
break;
수정 후
case 'vimeo.com':
//$video['img_url'] = "https://i.vimeocdn.com/video/{$video['key2']}.jpg";
$video['img_url'] = $video['key2'];
break;
추천인 2
레벨 149
경험치 3,344,951
Progress Bar 83.12%
- 가입일 : 2015-03-10 12:21:44
- 서명 : 인간에게 가장 큰 선물은
자기 자신에게 기회를 주는 것이다.
- 크리스 가드너, Chris Gardner -
- 자기소개 : There's never a shortcut to happiness.


댓글2
내사랑님의 댓글
축하합니다. 지뢰폭탄 제거로 26경험치를 획득하였습니다.
하늘구장님의 댓글
축하합니다. 첫 댓글로 14경험치를 획득하였습니다.