// ==UserScript== // @name DOUBAN Movie info for RARBG // @namespace http://rarbg.to/ // @version 0.2 // @description Adds douban movie info to RARBG.to // @author tofuliang // @match https://rarbg.to/* // @match http://rarbg.to/* // @grant GM_xmlhttpRequest // @grant GM_getValue // @grant GM_setValue // @connect api.douban.com // @downloadURL none // ==/UserScript== function isEmpty(s) { return !s || s === 'N/A'; } $('body').on('mouseenter', 'a[href^="/torrents.php?imdb="]', function() { var imdbId = $(this).attr('href').split("=").pop(); function showDouBanInfo(data){ var html =''; html +='
'+data.title+' '+data.alt_title+' ('+data.attrs.year.join(' / ')+')
'; html +=''+data.rating.average+' / '+data.rating.numRaters+'
'; html +='上映时间: '+data.attrs.pubdate.join(' / ')+'
';} if(!isEmpty(data.attrs.movie_duration)){ html +='片长: '+data.attrs.movie_duration.join(' / ')+'
';} if(!isEmpty(data.attrs.title)){ html +='别名: '+data.attrs.title.join(' / ')+'
';} if(!isEmpty(data.attrs.director)){ html +='导演: '+data.attrs.director.join(' / ')+'
';} if(!isEmpty(data.attrs.writer)){ html +='编剧: '+data.attrs.writer.join(' / ')+'
';} if(!isEmpty(data.attrs.cast)){ html +='主演: '+data.attrs.cast.join(' / ')+'
';} if(!isEmpty(data.attrs.movie_type)){ html +='类型: '+data.attrs.movie_type.join(' / ')+'
';} if(!isEmpty(data.attrs.country)){ html +='制片国家/地区: '+data.attrs.country.join(' / ')+'
';} if(!isEmpty(data.attrs.language)){ html +='语言: '+data.attrs.language.join(' / ')+'
';} if(!isEmpty(data.summary)){ html +='简介: '+data.summary+'
';} html +='