Fixed youtube thumbnails
API v2 got deprecated in March and v3 requires signup. Hotlinking like a boss.
This commit is contained in:
parent
d45da1e0ae
commit
da9765c352
1 changed files with 2 additions and 7 deletions
|
@ -203,13 +203,8 @@ $(function()
|
||||||
if (matches = url.match(/watch.*?=([a-zA-Z0-9_-]+)/))
|
if (matches = url.match(/watch.*?=([a-zA-Z0-9_-]+)/))
|
||||||
{
|
{
|
||||||
postDom.find('.file-name strong').text(url);
|
postDom.find('.file-name strong').text(url);
|
||||||
var url = 'http://gdata.youtube.com/feeds/api/videos/' + matches[1] + '?v=2&alt=jsonc';
|
var realUrl = 'http://img.youtube.com/vi/' + matches[1] + '/mqdefault.jpg';
|
||||||
getJSON({ url: url }).success(function(data)
|
changeThumb(postDom.find('img'), realUrl);
|
||||||
{
|
|
||||||
postDom.find('.file-name strong')
|
|
||||||
.text(data.data.title);
|
|
||||||
changeThumb(postDom.find('img'), data.data.thumbnail.hqDefault);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue