File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
lib/quail/quail/common/services/media Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ class youtubeService extends mediaService
2828 /**
2929 * @var string The service point to request caption data from YouTube
3030 */
31- var $ search_url = 'https://www.googleapis.com/youtube/v3/videos?part=contentDetails&key=AIzaSyCwO6Tun63CCe-iLiQV0BrJdulvdpb2veQ& id= ' ;
31+ var $ search_url = 'https://www.googleapis.com/youtube/v3/videos?part=contentDetails&id= ' ;
3232
3333 /**
3434 * Checks to see if a video is missing caption information in YouTube
@@ -38,7 +38,7 @@ class youtubeService extends mediaService
3838 function captionsMissing ($ link_url )
3939 {
4040
41- $ url = 'https://www.googleapis.com/youtube/v3/videos?part=contentDetails&id= ' ;
41+ $ url = 'https://www.googleapis.com/youtube/v3/captions?part=id&videoId= ' ; //'https://www.googleapis.com/youtube/v3/ videos?part=contentDetails&id=';
4242 $ api_key = constant ( 'GOOGLE_API_KEY ' );
4343
4444 if ( $ youtube_id = $ this ->isYouTubeVideo ($ link_url ) ) {
@@ -51,11 +51,7 @@ function captionsMissing($link_url)
5151
5252 // If the video was pulled due to copyright violations, the items array will be empty.
5353 // TODO: Make this return a different error, warning the instructor that the video is no longer available
54- if ( empty ($ response ->body ->items ) ){
55- return true ;
56- }
57-
58- return ($ response ->body ->items [0 ]->contentDetails ->caption == 'true ' )? false : true ;
54+ return ( empty ($ response ->body ->items ) )? true : false ;
5955 }
6056
6157 return false ;
You can’t perform that action at this time.
0 commit comments