[이윰] 네이버TV 올바르게 적용하기
페이지 정보
shadow2fox
2,892 5 2
2019.10.12 20:13:11
짧은주소
-
https://yadolee.com/tip/684 주소복사
본문
네이버TV 올바르게 적용하기
네이버 TV가 변경되어 현재 이윰빌더 4.x에서도 올바르게 보여지지 않는다.
그누보드5/eyoom/classes/eyoom.class.php를 열어 동영상 key 추출하기를 검색하여 아래와 같이 수정한다.
수정 전{code:php}
case 'tvcast.naver.com':
case 'tv.naver.com':
if ($src[1] && $src[2] && $src[3]) {
$video['key1'] = $src[1];
$video['key2'] = $src[2];
$video['key3'] = $src[3];
} else {
$data = $this->get_video_use_curl($video_url, $host);
$video['key1'] = $data['vid'];
$video['key2'] = $data['outKey'];
$video['key3'] = $data['imgsrc'];
}
break;
{/code}수정 후{code:php}
case 'tvcast.naver.com':
case 'tv.naver.com':
if ($src[1] && $src[2]) {
$video['key1'] = $src[1];
$video['key2'] = $src[2];
} else {
$data = $this->get_video_use_curl($video_url, $host);
$video['key1'] = $data['vid'];
$video['key2'] = $data['imgsrc'];
}
break;
{/code}
// CURL를 활용한 동영상페이지 웹스크랩핑를 검색하여 아래와 같이 수정한다.
수정 전{code:php}
case 'tvcast.naver.com':
case 'tv.naver.com':
preg_match('/&outKey=(?P<outKey>[a-zA-Z0-9]+)&/i', $output, $scrapping);
$out['outKey']= $scrapping['outKey'];
preg_match('/\?vid=(?P<vid>[a-zA-Z0-9]+)&/i', $output, $scrapping);
$out['vid']= $scrapping['vid'];
preg_match('/\<meta property=\"og:image\"\scontent='(?P<imgsrc>[a-zA-Z0-9:\/\._]+)/i', $output, $scrapping);
$out['imgsrc'] = $scrapping['imgsrc'];
return $out;
break;
{/code}수정 후{code:php}
case 'tvcast.naver.com':
case 'tv.naver.com':
preg_match('/\<meta property=\"og:video: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\"\scontent='(?P<imgsrc>[a-zA-Z0-9:\/\._-]+)/i', $output, $scrapping);
$out['imgsrc'] = $scrapping['imgsrc'];
return $out;
break;
{/code}
// 수집된 동영상 정보를 iframe source로 구현을 검색하여 아래와 같이 수정한다.
수정 전{code:php}
case 'tvcast.naver.com':
case 'tv.naver.com':
$source = '<iframe width="'.$video['width'].'" height="'.$video['height'].'" src="http://serviceapi.rmcnmv.naver.com/flash/outKeyPlayer.nhn?vid='.$video['key1'].'&outKey='.$video['key2'].'&controlBarMovable=true&jsCallable=true&skinName=tvcast_black" frameborder="no" scrolling="no" marginwidth="0" marginheight="0"></iframe>';
break;
{/code}수정 후{code:php}
case 'tvcast.naver.com':
case 'tv.naver.com':
if ($video['key1'] != null) {
$source = '<iframe width="'.$video['width'].'" height="'.$video['height'].'" src="https://tv.naver.com/embed/'.$video['key1'].'?autoPlay=true" frameborder="no" scrolling="no" marginwidth="0" marginheight="0" allowfullscreen></iframe>';
} else {
$source ='<p style="display:table;margin:30px auto 0;text-align:center;padding:5px;border-top:1px dotted #eee;border-bottom:1px dotted #eee;line-height:1.6;font-size:14px;color:rgb(180, 180, 180);max-width:100%;background-color:transparent;">⏳ 삭제되었거나 네이버 제공이 중지된 동영상입니다.</p>';
}
break;
{/code}?autoPlay=true옵션은 자동 재생과 연관된 옵션이기에 입맛에 맞게 넣거나 뺀다.
$source = "<div class='responsive-video'>".$source."</div>";를 검색하여 아래와 같이 수정한다.
수정 전{code:php}
$source = "<div class='responsive-video'>".$source."</div>";
{/code}수정 후{code:php}
if ($video['key1'] != null) $source = "<div class='responsive-video'>".$source."</div>";
{/code}
그누보드5/eyoom/classes/eyoom.class.php를 열어 동영상 key 추출하기를 검색하여 아래와 같이 수정한다.
수정 전{code:php}
case 'tvcast.naver.com':
case 'tv.naver.com':
if ($src[1] && $src[2] && $src[3]) {
$video['key1'] = $src[1];
$video['key2'] = $src[2];
$video['key3'] = $src[3];
} else {
$data = $this->get_video_use_curl($video_url, $host);
$video['key1'] = $data['vid'];
$video['key2'] = $data['outKey'];
$video['key3'] = $data['imgsrc'];
}
break;
{/code}수정 후{code:php}
case 'tvcast.naver.com':
case 'tv.naver.com':
if ($src[1] && $src[2]) {
$video['key1'] = $src[1];
$video['key2'] = $src[2];
} else {
$data = $this->get_video_use_curl($video_url, $host);
$video['key1'] = $data['vid'];
$video['key2'] = $data['imgsrc'];
}
break;
{/code}
// CURL를 활용한 동영상페이지 웹스크랩핑를 검색하여 아래와 같이 수정한다.
수정 전{code:php}
case 'tvcast.naver.com':
case 'tv.naver.com':
preg_match('/&outKey=(?P<outKey>[a-zA-Z0-9]+)&/i', $output, $scrapping);
$out['outKey']= $scrapping['outKey'];
preg_match('/\?vid=(?P<vid>[a-zA-Z0-9]+)&/i', $output, $scrapping);
$out['vid']= $scrapping['vid'];
preg_match('/\<meta property=\"og:image\"\scontent='(?P<imgsrc>[a-zA-Z0-9:\/\._]+)/i', $output, $scrapping);
$out['imgsrc'] = $scrapping['imgsrc'];
return $out;
break;
{/code}수정 후{code:php}
case 'tvcast.naver.com':
case 'tv.naver.com':
preg_match('/\<meta property=\"og:video: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\"\scontent='(?P<imgsrc>[a-zA-Z0-9:\/\._-]+)/i', $output, $scrapping);
$out['imgsrc'] = $scrapping['imgsrc'];
return $out;
break;
{/code}
// 수집된 동영상 정보를 iframe source로 구현을 검색하여 아래와 같이 수정한다.
수정 전{code:php}
case 'tvcast.naver.com':
case 'tv.naver.com':
$source = '<iframe width="'.$video['width'].'" height="'.$video['height'].'" src="http://serviceapi.rmcnmv.naver.com/flash/outKeyPlayer.nhn?vid='.$video['key1'].'&outKey='.$video['key2'].'&controlBarMovable=true&jsCallable=true&skinName=tvcast_black" frameborder="no" scrolling="no" marginwidth="0" marginheight="0"></iframe>';
break;
{/code}수정 후{code:php}
case 'tvcast.naver.com':
case 'tv.naver.com':
if ($video['key1'] != null) {
$source = '<iframe width="'.$video['width'].'" height="'.$video['height'].'" src="https://tv.naver.com/embed/'.$video['key1'].'?autoPlay=true" frameborder="no" scrolling="no" marginwidth="0" marginheight="0" allowfullscreen></iframe>';
} else {
$source ='<p style="display:table;margin:30px auto 0;text-align:center;padding:5px;border-top:1px dotted #eee;border-bottom:1px dotted #eee;line-height:1.6;font-size:14px;color:rgb(180, 180, 180);max-width:100%;background-color:transparent;">⏳ 삭제되었거나 네이버 제공이 중지된 동영상입니다.</p>';
}
break;
{/code}?autoPlay=true옵션은 자동 재생과 연관된 옵션이기에 입맛에 맞게 넣거나 뺀다.
$source = "<div class='responsive-video'>".$source."</div>";를 검색하여 아래와 같이 수정한다.
수정 전{code:php}
$source = "<div class='responsive-video'>".$source."</div>";
{/code}수정 후{code:php}
if ($video['key1'] != null) $source = "<div class='responsive-video'>".$source."</div>";
{/code}
추천인 2
레벨 155
경험치 3,583,437
Progress Bar 6.32%
- 가입일 : 2015-03-10 12:21:44
- 서명 : 인간에게 가장 큰 선물은
자기 자신에게 기회를 주는 것이다.
- 크리스 가드너, Chris Gardner -
- 자기소개 : There's never a shortcut to happiness.
-
[생활 정보] [판매중] 햇반 윤기가득쌀밥 210g 24입 (1박스) (19,900원 / 무료)2026-02-12
-
[생활 정보] [판매중] 하늘보리/옥수수수염차/카무트현미차/결명자차 외 7종 500ml 20+20 골라담기 (20,520원 / 무료)2026-02-12
-
[생활 정보] [판매중] 크리넥스 3겹 데코앤소프트 화이트 25MX30롤+30롤 (25,950원 / 무료)2026-02-12
-
[생활 정보]
[종료] 삼다수 그린 (무라벨) 2L 24개입 (라벨랜덤) (17,180원 / 무료)2026-02-10 -
[생활 정보] [판매중] 맛밤 60g x20개 (29,200원 / 무료)2026-02-10
-
[골라먹는 요리] 김치참치순두부찌개2026-02-08
-
[좋은 생각] 승리하면 조금 배울 수 있고 패배하면 모든 것을 배울 수 있다2026-02-08
-
[좋은 생각] 신중하고 열정적인 시민들로 이뤄진 작은 모임이 세상을 바꿀 수 있다2026-02-08
-
[생활 정보] 15원 추가 적립이 있네요 https://campaign2.naver.com/npay/v2/click-point/?eventId=cr_2026012802_2602_01772026-02-10
-
[생활 정보] 15원 줍줍 아직 수확 전이시면 체크해 보세요 https://campaign2.naver.com/npay/v2/click-point/?eventId=cr_2026012802_2602_01272026-02-07
-
[생활 정보] 가격이 착하다 싶더니 할인이 사라지고 일반가 30,900원으로 판매하네요2026-01-28
-
[일일 메모장] 안타까운 소식입니다. 민주 진영의 거목이였던 이해찬 전 대표님 정말 고생 많으셨습니다. 이제 편히 쉬십시오.2026-01-25
-
[자유 게시판] 올 한 해도 잘 부탁드립니다. 새해 복 많이 받으세요.2026-01-06
-
[일일 메모장] 무슨 말이 필요할까요 삼가 조의를 표하며 고인의 명복을 빕니다 영면하세요2026-01-05
-
[생활 정보] 이번 년도도 잘 정리해 주셨네요 감사드립니다2026-01-01
-
[자유 게시판] 새해 맞기 전 마지막 날을 좀 더 멋지게 보내고 싶은데 늘 마음 뿐이네요 활기차고 신난 새해로 시작되시길 빌어요 올 한 해도 화이팅입니다2026-01-01



댓글5
랩퍼투혼님의 댓글
하늘구장님의 댓글
shadow2fox님의 댓글
하늘구장님의 댓글
내사랑님의 댓글
축하합니다. 첫 댓글로 10경험치를 획득하였습니다.