가온 위키:기능 구현 불가-누가 해결책을 알려주세요!/영상 가져오기

이 문서는

외부 영상 공유 사이트에서 퍼가기 기능을 통해 가온 위키에 표시 할 수 있는데, 일부 서비스에서 영상을 가져오지 못하는 문제가 있다.

그래서 이 문서에서는 해결방안에 대해 안내한다.

니코동 영상 가져오기

어디서는[1] SSL을 적용해도 잘만 가져오는데, 여기는 못 가져오네...
EmbedVideo 확장 기능을 수정해 보았지만 어렵네... 그래도 수정을 완료했다!(스스로 토닥이는 관리자. 잘했어. 하얗게 불태웠어.)


+ 최신버전에서는 이 문제가 해결되어있다. 수정하기 귀찮다면, 최신버전으로 업그레이드를 하자.

수정 전

  • ./extensions/EmbedVideo/classes/VideoService.php 파일이다.
'nico' => [
			'embed'			=> '<iframe srcdoc="&lt;script type=&quot;text/javascript&quot; src=&quot;http://ext.nicovideo.jp/thumb_watch/%1$s?w=%2$d&amp;h=%3$d&quot;&gt;&lt;/script&gt;" width="%2$d" height="%3$d" frameborder="0" allowFullScreen="true"></iframe>',
			'default_width'	=> 640,
			'default_ratio'	=> 1.59609120521173, // (490 / 307)
			'https_enabled'	=> false,
			'url_regex'		=> [
				'#nicovideo\.jp/watch/((?:[a-zA-Z]{2})?[\d]+)#is'
			],
			'id_regex'		=> [
				'#^((?:[a-zA-Z]{2})?[\d]+)$#is'
			]
		],


수정 후

'nico' => [
			'embed'			=> '<iframe src="https://embed.nicovideo.jp/watch/%1s/" width="%2$d" height="%3$d" frameborder="0" allowFullScreen="true"></iframe>',
			'default_width'	=> 640,
			'default_ratio'	=> 1.59609120521173, // (490 / 307)
			'https_enabled'	=> true,
			'url_regex'		=> [
				'#nicovideo\.jp/watch/((?:[a-zA-Z]{2})?[\d]+)#is'
			],
			'id_regex'		=> [
				'#^((?:[a-zA-Z]{2})?[\d]+)$#is'
			]
		],


  • 'embed'=> '<iframe srcdoc="<script type="text/javascript" src="http://ext.nicovideo.jp/thumb_watch/%1$s?w=%2$d&h=%3$d"></script>"'embed'=> '<iframe src="https://embed.nicovideo.jp/watch/%1s/"로 변경한다.


카카오TV

기존 tvpot으로 사용이 가능했지만, 어느 순간부터는 이용이 불가능하다. 따라서 카카오tv용으로 마이그레이션을 해야한다. (2020년 05월 13일 기준 최신버전 작동 안함) 니코동과 마찬가지로 VIdeoService.php를 수정해야 한다.

수정 전

'tvpot' => [
			'embed'			=> '<iframe title="%4$s" src="//videofarm.daum.net/controller/video/viewer/Video.html?vid=%1$s&play_loc=undefined&alert=true" width="%2$d" height="%3$d" frameborder="0" allowfullscreen="true"></iframe>',
			'default_width'	=> 640,
			'default_ratio'	=> 1.77777777777778, // (16 / 9)
			'https_enabled'	=> true,
			'url_regex'		=> [
				'#tvpot\.daum\.net/v/([\d\w-%]+)?#is'
			],
			'id_regex'		=> [
				'#^([\d\w-%]+)$#is'
			]
		],

수정 후

'kakaotv' => [
			'embed'			=> '<iframe title="%4$s" src="//play-tv.kakao.com/embed/player/cliplink/%1$s?service=kakao_tv" width="%2$d" height="%3$d" allowfullscreen frameborder="0" scrolling="no" allow="autoplay""></iframe>',
			'default_width'	=> 640,
			'default_ratio'	=> 1.77777777777778, // (16 / 9)
			'https_enabled'	=> true,
			'url_regex'		=> [
				'#tv\.kakao\.com/channel/[\d\w-]+/cliplink/([\d]+)#is'
			],
			'id_regex'		=> [
				'#^([\d]+)$#is'
			]
		],


각주

  1. 크흠... 트리위키라 하면 알겠지...?
• 현재 페이지 URL 줄이기