From da9765c35286c57991a1be877fb006ae235793a0 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Fri, 20 Jun 2014 17:04:42 +0200 Subject: [PATCH] Fixed youtube thumbnails API v2 got deprecated in March and v3 requires signup. Hotlinking like a boss. --- public_html/media/js/post-upload.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/public_html/media/js/post-upload.js b/public_html/media/js/post-upload.js index 30a26f65..77d385f7 100644 --- a/public_html/media/js/post-upload.js +++ b/public_html/media/js/post-upload.js @@ -203,13 +203,8 @@ $(function() if (matches = url.match(/watch.*?=([a-zA-Z0-9_-]+)/)) { postDom.find('.file-name strong').text(url); - var url = 'http://gdata.youtube.com/feeds/api/videos/' + matches[1] + '?v=2&alt=jsonc'; - getJSON({ url: url }).success(function(data) - { - postDom.find('.file-name strong') - .text(data.data.title); - changeThumb(postDom.find('img'), data.data.thumbnail.hqDefault); - }); + var realUrl = 'http://img.youtube.com/vi/' + matches[1] + '/mqdefault.jpg'; + changeThumb(postDom.find('img'), realUrl); } else {