[이윰] 비메오 썸네일 추출 올바르게 적용하기

페이지 정보

shadow2fox shadow2fox 977 2 2 2023.04.24 10:45:53

평점

  • 평점 : 5점 (2명 참여)

본문

📝 비메오 썸네일 추출 올바르게 적용하기
이윰빌더 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
  • 012i1052u
    내사랑
  • skyfield4u
    하늘구장
shadow2fox
10
shadow2fox - 회원등급 : 자연/Level 147 - 포인트 : 2,613,666
레벨 147
경험치 3,240,414

Progress Bar 47.88%

- 가입일 : 2015-03-10 12:21:44
- 서명 : 인간에게 가장 큰 선물은 자기 자신에게 기회를 주는 것이다. - 크리스 가드너, Chris Gardner -
- 자기소개 : There's never a shortcut to happiness.

댓글2

내사랑님의 댓글

012i1052u
내사랑 2023.04.27 00:15
한 번 테스트 해 보았는데 기존 소스에선 썸네일 생성을 하지 못했고 소스 수정 후 썸네일이 생성되는 걸 확인 완료했어요

축하합니다. 지뢰폭탄 제거로 26경험치를 획득하였습니다.

하늘구장님의 댓글

skyfield4u
하늘구장 2023.04.25 15:58
비메오 사용자 층이 많지 않아서 썸네일 생성 오류가 있는 지조차 몰랐네요 일과 시간 후에 잘 적용토록 할게요 고맙습니다

축하합니다. 첫 댓글로 14경험치를 획득하였습니다.

Total 762226 페이지

제목 글쓴이 날짜 조회 추천
그누•영카트  댓글+2 그누보드(영카트) 5.5.8.3.2 shadow2fox 2023.07.18 821 3
그누•영카트  댓글+2 그누보드(영카트) 5.5.8.3.1 shadow2fox 2023.06.19 891 2
이윰  댓글+2 PATH만 지원되는 filemtime을 curl 이용하여  URL을 지원하도록 확장하기 shadow2fox 2023.06.13 706 2
이윰  댓글+2 🚩 비메오 썸네일 추출 올바르게 적용하기 shadow2fox 2023.04.24 978 2
그누•영카트  댓글+1 그누보드(영카트) 5.5.8.3 shadow2fox 2023.04.20 697 2
그누•영카트  [KG이니시스 결제 사용자 필독] 그누보드(영카트) 5.5.8.2.9 shadow2fox 2023.04.14 821 0
그누•영카트  댓글+2 그누보드(영카트) 5.5.8.2.8 shadow2fox 2023.03.24 692 2
이윰  댓글+2 date 시간 형식으로 출력(~전) 올바르게 해결하기 shadow2fox 2023.03.10 878 2
이윰  댓글+5🏆 유튜브 "이 동영상은 볼 수 없습니다" 해결하기 shadow2fox 2023.02.20 2,298 3
그누•영카트  그누보드(영카트) 5.5.8.2.7 shadow2fox 2023.01.27 713 0
그누•영카트  댓글+2 그누보드(영카트) 5.5.8.2.6 shadow2fox 2023.01.14 726 2
그누•영카트  댓글+2 그누보드(영카트) 5.5.8.2.5 shadow2fox 2022.12.08 879 1
그누•영카트  댓글+1 그누보드(영카트) 5.5.8.2.4 shadow2fox 2022.11.22 741 1
그누•영카트  댓글+2 그누보드(영카트) 5.5.8.2.3 shadow2fox 2022.10.19 732 2
그누•영카트  댓글+3🏆 다음 카카오 서비스 먹통 사태로 인한 그누•영카트 postcode.v2.js 리소스 로딩 에러 shadow2fox 2022.10.16 1,074 3
그누•영카트  그누보드(영카트) 5.5.8.2.2 shadow2fox 2022.10.05 726 0
그누•영카트  그누보드(영카트) 5.5.8.2.1 shadow2fox 2022.09.25 777 1
그누•영카트  댓글+2🏆 그누보드(영카트) 5.5.8.2 shadow2fox 2022.07.27 1,115 2
그누•영카트  댓글+2 그누보드(영카트) 5.5.8.1.2 shadow2fox 2022.07.01 802 2
그누•영카트  댓글+1 그누보드(영카트) 5.5.8.1.1 shadow2fox 2022.06.24 734 1
그누•영카트  댓글+2 그누보드(영카트) 5.5.8.1 shadow2fox 2022.06.21 795 2
그누•영카트  댓글+2 그누보드(영카트) 5.5.8 shadow2fox 2022.06.14 684 2
그누•영카트  댓글+1 그누보드(영카트) 5.5.7.5 shadow2fox 2022.05.27 784 1
그누•영카트  댓글+2🏆 그누보드(영카트) 5.5.7.4 shadow2fox 2022.05.25 1,073 2
그누•영카트  댓글+2 그누보드(영카트) 5.5.7.3 shadow2fox 2022.05.24 746 2
그누•영카트  댓글+1 그누보드(영카트) 5.5.7.2 (★ 5.5.7.1 버전 사용자님은 필독해 주세요) shadow2fox 2022.05.04 757 2
그누•영카트  댓글+2🏆 그누보드(영카트) 5.5.7.1 (★ 5.5.7 버전 사용자님들께서는 필독해 주세요) shadow2fox 2022.04.30 1,202 3
그누•영카트  댓글+1 그누보드(영카트) 5.5.7 shadow2fox 2022.04.26 859 1
이윰  댓글+2 Prism.js 플러그인 사용 시 HTML 주석 처리가 삭제되는 문제 해결하기 shadow2fox 2022.04.24 894 2
그누•영카트  댓글+2🏆 그누보드(영카트) 5.5.6 이니시스 통합인증(간편인증) 사용시 필수 패치 shadow2fox 2022.04.20 1,161 3