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

페이지 정보

shadow2fox 454 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,539,573
레벨 142
경험치 3,034,326

Progress Bar 73%

- 가입일 : 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 241113 페이지
제목 글쓴이 날짜 조회 추천
이윰  댓글+2 PATH만 지원되는 filemtime을 curl 이용하여  URL을 지원하도록 확장하기 shadow2fox 2023.06.13 269 2
이윰  댓글+2 🚩 비메오 썸네일 추출 올바르게 적용하기 shadow2fox 2023.04.24 455 2
이윰  댓글+2 date 시간 형식으로 출력(~전) 올바르게 해결하기 shadow2fox 2023.03.10 428 2
이윰  댓글+5 유튜브 "이 동영상은 볼 수 없습니다" 해결하기 shadow2fox 2023.02.20 976 3
이윰  댓글+2 Prism.js 플러그인 사용 시 HTML 주석 처리가 삭제되는 문제 해결하기 shadow2fox 2022.04.24 532 2
이윰  댓글+7🏆 유튜브 플레이리스트(playlist) 썸네일 추출과 올바르게 적용하기 shadow2fox 2021.09.01 2,495 3
이윰  댓글+2🏆 이윰빌더 짧은주소를 그누보드 짧은주소로 교체하기 shadow2fox 2021.08.26 1,432 2
이윰  댓글+4🏆 📸 유튜브 썸네일 생성 개선하기 루루아빠 2021.06.24 3,457 3
이윰  댓글+2🏆 글, 댓글 작성시 불필요한 앞뒤 공백 제거해 DB에 저장하기 shadow2fox 2021.06.21 1,166 2
이윰  댓글+3🏆 첨부 이미지 alt 속성 값 게시글 제목으로 보여주기 shadow2fox 2021.06.11 1,148 2
이윰  댓글+3🏆 게시글 검색 단위에 맞는 메뉴 추가하기 shadow2fox 2021.05.18 1,660 2
이윰  댓글+2🏆 글 작성 시 alt 태그 게시글 제목으로 DB에 저장하기 shadow2fox 2021.05.05 1,439 2
이윰  댓글+4🏆 다중 태그 입력 올바르게 shadow2fox 2021.03.12 1,961 2
이윰  댓글+1🏆 PHP 8.x Fatal error : 중괄호 사용으로 인한 json.class.php 오류 shadow2fox 2021.02.17 1,831 1
이윰  댓글+3🏆 PHP 8.x 지원을 위한 암호화, 복호화 함수 shadow2fox 2021.02.16 2,570 3
이윰  댓글+2🏆 게시글 작성 중복 방지하기 shadow2fox 2021.02.03 1,675 2
이윰  댓글+2🏆 View 페이지에서 이전글, 다음글 버튼에 제목과 썸네일을 가져오기 shadow2fox 2021.01.10 1,540 2
이윰  댓글+5🏆 게시글 작성 시 외부 이미지를 저장하여 썸네일화하기 shadow2fox 2021.01.01 2,519 2
이윰  댓글+2🏆 EXIF 정보 이미지 넓이에 맞게 조정하기 shadow2fox 2020.11.21 1,806 2
이윰  댓글+2🏆 추천 베스트 최신글에서 블라인드 게시글은 제외하기 shadow2fox 2020.11.13 1,416 2