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

페이지 정보

shadow2fox shadow2fox 976 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.17 shadow2fox 2024.06.09 574 2
그누•영카트  댓글+1 그누보드(영카트) 5.5.8.3.4 (★ 5.5.8.3.3 버전 사용자님은 필독해 주세요) shadow2fox 2023.08.20 639 1
그누•영카트  댓글+2 그누보드(영카트) 5.5.12 shadow2fox 2024.01.26 640 2
그누•영카트  그누보드(영카트) 5.5.3.1 (아이핀 사용시 오류 수정) shadow2fox 2022.03.08 666 0
그누•영카트  댓글+3 그누보드(영카트) 5.5.14 shadow2fox 2024.04.04 667 2
그누•영카트  댓글+2 그누보드(영카트) 5.5.8 shadow2fox 2022.06.14 684 2
그누•영카트  댓글+2 그누보드(영카트) 5.5.10 shadow2fox 2023.11.10 690 2
그누•영카트  댓글+2 그누보드(영카트) 5.5.8.2.8 shadow2fox 2023.03.24 692 2
그누•영카트  댓글+2 그누보드(영카트) 5.5.9 shadow2fox 2023.10.19 695 2
그누•영카트  댓글+1 그누보드(영카트) 5.5.8.3 shadow2fox 2023.04.20 697 2
이윰  댓글+2 PATH만 지원되는 filemtime을 curl 이용하여  URL을 지원하도록 확장하기 shadow2fox 2023.06.13 706 2
그누•영카트  그누보드(영카트) 5.5.8.2.7 shadow2fox 2023.01.27 711 0
그누•영카트  그누보드(영카트) 5.5.8.2.2 shadow2fox 2022.10.05 726 0
그누•영카트  댓글+2 그누보드(영카트) 5.5.8.2.6 shadow2fox 2023.01.14 726 2
그누•영카트  댓글+1 그누보드(영카트) 5.5.5 shadow2fox 2022.04.08 730 2
그누•영카트  댓글+2 그누보드(영카트) 5.5.8.2.3 shadow2fox 2022.10.19 732 2
그누•영카트  댓글+1 그누보드(영카트) 5.5.8.1.1 shadow2fox 2022.06.24 734 1
그누•영카트  댓글+1 그누보드(영카트) 5.5.8.2.4 shadow2fox 2022.11.22 741 1
그누•영카트  댓글+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
그누•영카트  댓글+1 그누보드(영카트) 5.5.4 shadow2fox 2022.03.22 764 1
그누•영카트  그누보드(영카트) 5.5.8.2.1 shadow2fox 2022.09.25 777 1
그누•영카트  댓글+2 그누보드(영카트) 5.5.13 shadow2fox 2024.02.20 781 2
그누•영카트  댓글+1 그누보드(영카트) 5.5.7.5 shadow2fox 2022.05.27 784 1
그누•영카트  댓글+2 그누보드(영카트) 5.5.8.1 shadow2fox 2022.06.21 795 2
그누•영카트  댓글+2 그누보드(영카트) 5.5.8.1.2 shadow2fox 2022.07.01 802 2
그누•영카트  [KG이니시스 결제 사용자 필독] 그누보드(영카트) 5.5.8.2.9 shadow2fox 2023.04.14 821 0
그누•영카트  댓글+2 그누보드(영카트) 5.5.8.3.2 shadow2fox 2023.07.18 821 3
그누•영카트  댓글+2 그누보드(영카트) 5.5.11 shadow2fox 2024.01.03 846 2
그누•영카트  댓글+1 그누보드(영카트) 5.5.7 shadow2fox 2022.04.26 859 1