This repository was archived by the owner on Feb 26, 2018. It is now read-only.
File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ function Playlist(data)
99
99
// Generate the youtube playlist URI
100
100
self . generateYouTubeURI = function ( )
101
101
{
102
- var url = "http ://www.youtube.com/embed/" + self . tracks [ 0 ] . getYouTubeID ( ) + "?rel=0&showinfo=1&playlist=" ;
102
+ var url = "https ://www.youtube.com/embed/" + self . tracks [ 0 ] . getYouTubeID ( ) + "?rel=0&showinfo=1&playlist=" ;
103
103
var skip = true ;
104
104
for ( var i in self . tracks )
105
105
{
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ function Track(data)
82
82
// Make a best effort to get the YouTube ID.
83
83
self . lookupYouTubeIdentifier = function ( )
84
84
{
85
- var url = "https://gdata.youtube .com/feeds/api/videos?alt=json&max-results =1&q=" + self . getArtist ( ) + " " + self . getTitle ( ) ;
85
+ var url = "https://www.googleapis .com/youtube/v3/search?key=[YOUR_KEY_HERE]&part=snippet&type=video&maxResults =1&q=" + self . getArtist ( ) + " " + self . getTitle ( ) ;
86
86
console . log ( url ) ;
87
87
jQuery . ajax (
88
88
{
@@ -93,17 +93,17 @@ function Track(data)
93
93
success : function ( data , textStatus , jqxhr )
94
94
{
95
95
// Hack
96
- if ( typeof data . feed . entry == "undefined" )
96
+ if ( typeof data . items == "undefined" )
97
97
{
98
98
self . youtubeDone = true ;
99
99
return ;
100
100
}
101
101
102
102
// If we got some tracks back
103
- if ( data . feed . entry . length > 0 )
103
+ if ( data . items . length > 0 )
104
104
{
105
105
// Assume first track is best match.. for now.
106
- self . youtubeID = data . feed . entry [ 0 ] . id . $t . replace ( "http://gdata.youtube.com/feeds/api/videos/" , "" ) ;
106
+ self . youtubeID = data . items [ 0 ] . id . videoId ;
107
107
console . log ( "[track] youtube ID = " + self . youtubeID ) ;
108
108
}
109
109
You can’t perform that action at this time.
0 commit comments