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

페이지 정보

shadow2fox 496 2 2 2023.04.24 10:45

평점

  • 평점 : 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
  • 내사랑
  • 하늘구장
10
shadow2fox - 회원등급 : 자연/Level 142 - 포인트 : 2,544,780
레벨 142
경험치 3,043,851

Progress Bar 96%

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

댓글2

내사랑님의 댓글

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

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

하늘구장님의 댓글

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

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

Total 747138 페이지
제목 글쓴이 날짜 조회 추천
이윰  댓글+5🏆 출석부 랭킹 중복 방지하기 shadow2fox 2019.12.16 2,972 4
이윰  댓글+5🏆 유튜브 "이 동영상은 볼 수 없습니다" 해결하기 shadow2fox 2023.02.20 1,060 3
그누•영카트  댓글+2 그누보드(영카트) 5.5.8.3.2 shadow2fox 2023.07.18 428 3
이윰  댓글+4🏆 📸 유튜브 썸네일 생성 개선하기 루루아빠 2021.06.24 3,497 3
에디터  댓글+2 CKEditor 4.x 버전 체크로 인한 콘솔 에러 해결하기 shadow2fox 2023.12.24 634 3
이윰  댓글+3🏆 PHP 8.x 지원을 위한 암호화, 복호화 함수 shadow2fox 2021.02.16 2,616 3
이윰  댓글+7🏆 유튜브 플레이리스트(playlist) 썸네일 추출과 올바르게 적용하기 shadow2fox 2021.09.01 2,535 3
그누•영카트  댓글+2 그누보드(영카트) 5.5.6 이니시스 통합인증(간편인증) 사용시 필수 패치 shadow2fox 2022.04.20 847 3
그누•영카트  댓글+2 그누보드(영카트) 5.5.7.1 (★ 5.5.7 버전 사용자님들께서는 필독해 주세요) shadow2fox 2022.04.30 781 3
그누•영카트  댓글+3 다음 카카오 서비스 먹통 사태로 인한 그누•영카트 postcode.v2.js 리소스 로딩 에러 shadow2fox 2022.10.16 643 3
이윰  댓글+2🏆 추천 베스트 최신글에서 블라인드 게시글은 제외하기 shadow2fox 2020.11.13 1,449 2
그누•영카트  댓글+2 그누보드(영카트) 5.5.8.2.6 shadow2fox 2023.01.14 395 2
이윰  댓글+2🏆 EXIF 정보 이미지 넓이에 맞게 조정하기 shadow2fox 2020.11.21 1,852 2
그누•영카트  댓글+2🏆 그누보드 5.4.3.1 shadow2fox 2020.11.24 1,968 2
이윰  댓글+5🏆 게시글 작성 시 외부 이미지를 저장하여 썸네일화하기 shadow2fox 2021.01.01 2,556 2
이윰  댓글+2 date 시간 형식으로 출력(~전) 올바르게 해결하기 shadow2fox 2023.03.10 468 2
그누•영카트  댓글+2 그누보드(영카트) 5.5.8.2.8 shadow2fox 2023.03.24 442 2
그누•영카트  댓글+1 그누보드(영카트) 5.5.8.3 shadow2fox 2023.04.20 408 2
이윰  댓글+2 🚩 비메오 썸네일 추출 올바르게 적용하기 shadow2fox 2023.04.24 497 2
그누•영카트  댓글+2🏆 그누보드 5.4.4.1 shadow2fox 2021.01.05 1,933 2