From 8625bad96cb14e46af6d39054fa90db0e50a322f Mon Sep 17 00:00:00 2001 From: DiMartinoXBMC Date: Sat, 28 Feb 2015 17:35:50 +0300 Subject: [PATCH] BTDigg --- addon.xml | 2 +- changelog.txt | 5 +- resources/searchers/BTDigg.py | 69 +++++++++++++++++++++++++++ resources/searchers/icons/BTDigg.png | Bin 0 -> 8420 bytes 4 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 resources/searchers/BTDigg.py create mode 100644 resources/searchers/icons/BTDigg.png diff --git a/addon.xml b/addon.xml index 9e807f6..a3928c8 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@  - + diff --git a/changelog.txt b/changelog.txt index 3d91fa4..e6913c9 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,7 @@ -[B]Version 2.1.9[/B] +[B]Version 2.2.0[/B] +[+] Поиск: Добавлен BTDigg (magnet) + +[B]Version 2.1.9[/B] [+] Списки Медиа: Баг-фикс TMDB SSL, нижний переход на следующую страницу [+] Списки Медиа: Расширенная информация KickAssSo, EZTV [+] Списки Медиа: Добавлен ThePirateBay diff --git a/resources/searchers/BTDigg.py b/resources/searchers/BTDigg.py new file mode 100644 index 0000000..0219764 --- /dev/null +++ b/resources/searchers/BTDigg.py @@ -0,0 +1,69 @@ +# -*- coding: utf-8 -*- + +import urllib +import json +import sys + +import SearcherABC + + +class BTDigg(SearcherABC.SearcherABC): + ''' + Weight of source with this searcher provided. + Will be multiplied on default weight. + Default weight is seeds number + ''' + sourceWeight = 1 + + ''' + Relative (from root directory of plugin) path to image + will shown as source image at result listing + ''' + searchIcon = '/resources/searchers/icons/BTDigg.png' + + ''' + Flag indicates is this source - magnet links source or not. + Used for filtration of sources in case of old library (setting selected). + Old libraries won't to convert magnet as torrent file to the storage + ''' + + @property + def isMagnetLinkSource(self): + return True + + ''' + Main method should be implemented for search process. + Receives keyword and have to return dictionary of proper tuples: + filesList.append(( + int(weight),# Calculated global weight of sources + int(seeds),# Seeds count + str(title),# Title will be shown + str(link),# Link to the torrent/magnet + str(image),# Path/URL to image shown at the list + )) + ''' + + def search(self, keyword): + filesList = [] + url="http://api.btdigg.org/api/private-c47ba652ee73735a/s02?q=%s" % (urllib.quote_plus(keyword)) + headers = [('User-Agent', + 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 YaBrowser/14.10.2062.12061 Safari/537.36'), + ('Referer', 'https://eztv.it/'), ('Accept-encoding', 'gzip'), ] + response = self.makeRequest(url, headers=headers) + + if None != response and 0 < len(response): + #print response + dat = json.loads(response) + print str(dat) + for item in dat: + size = self.sizeConvert(item['size']) + seeds,leechers=0,0 + image = sys.modules["__main__"].__root__ + self.searchIcon + filesList.append(( + int(int(self.sourceWeight) * int(seeds)), + int(seeds), int(leechers), size, + self.unescape(self.stripHtml(item['name'])), + self.__class__.__name__ + '::' + item['magnet'], + image, + )) + return filesList \ No newline at end of file diff --git a/resources/searchers/icons/BTDigg.png b/resources/searchers/icons/BTDigg.png new file mode 100644 index 0000000000000000000000000000000000000000..3ebe4e3b9783b3cc5e10a4a57af255fa8d32c546 GIT binary patch literal 8420 zcmX9^byQSe7X=()hMXaX9$@J16qo@eMOr{W5RmR}7>1H?=oB4E>5!BhIz%vNfuS2z zQba#~>$_{+d)9k*pMBT)=dH8%eTn*d8Wf~Vqyz*66k3|G1U2Dv0i*5tJ z7pY|oyd7ac`-IzPke8;pF98AY>c2?{3t_gteaYx|-^|a*^SNK3t&amiU|^t#vxlp% zovoLHh^LQZ!I2WvEr{kn5W?Tj$;vN%rL}8OwiUYCaCO|1rUgo!uP>WMSI29{#pI!7vFiG1=h?Og8}m`$sKxgmKWq zp;c(%Llfp@NjpnNsoG8Ybj4VBda?+$4}VGK3sJvPPU9CN!dV{O#)h<|Rfbs3QbYca zx^MZgkFEL%Tj%yLLSmOFh*?A;*8L*(2s$KSGw?@FaU^G=n!}fq+?wm=RM#k^swn%hG~iq zp8wQpdOn=y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