delete searchers, icon optimization
|
@ -29,7 +29,6 @@ import os
|
|||
from StringIO import StringIO
|
||||
import gzip
|
||||
import socket
|
||||
import xml.etree.ElementTree as ET
|
||||
import sys
|
||||
|
||||
import xbmcgui
|
||||
|
@ -180,25 +179,6 @@ class SearcherABC:
|
|||
os.mkdir(dirname)
|
||||
return dirname
|
||||
|
||||
def getByLabel(self, label):
|
||||
clean_label = self.clean(label)
|
||||
url = 'http://ruhunt.org/feed?q=%s' % urllib.quote_plus(clean_label)
|
||||
|
||||
response = self.makeRequest(url)
|
||||
if None != response and 0 < len(response):
|
||||
#print response
|
||||
try:
|
||||
dat = ET.fromstring(response)
|
||||
url = dat.findall('channel')[0].findall('item')[0].find('link').text
|
||||
#print str(url)
|
||||
response = self.makeRequest(url)
|
||||
if None != response and 0 < len(response):
|
||||
#print response
|
||||
magnet = re.compile('<a href="(magnet.+?)">', re.DOTALL | re.MULTILINE).findall(response)[0]
|
||||
return magnet
|
||||
except:
|
||||
return
|
||||
|
||||
def timeout(self, add_seconds=0):
|
||||
seconds=10+(10*int(self.timeout_multi))+int(add_seconds)
|
||||
socket.setdefaulttimeout(int(seconds))
|
||||
|
@ -224,4 +204,7 @@ class SearcherABC:
|
|||
localFile.write(content)
|
||||
localFile.close()
|
||||
|
||||
return localFileName
|
||||
return localFileName
|
||||
|
||||
def logout(self):
|
||||
pass
|
12
functions.py
|
@ -1774,11 +1774,19 @@ def first_run_230(delete_russian):
|
|||
Localization.localize('Would you like to install %s from "MyShows.me Kodi Repo" in Programs section?') % 'RuTrackerOrg',
|
||||
Localization.localize('Open installation window?'))
|
||||
if yes:
|
||||
xbmc.executebuiltin('Dialog.Close(all,true)')
|
||||
xbmc.executebuiltin('XBMC.ActivateWindow(Addonbrowser,addons://search/%s)' % ('Torrenter Searcher'))
|
||||
|
||||
def first_run_231():
|
||||
if not __settings__.getSetting('first_run_231')=='True':
|
||||
__settings__.setSetting('first_run_231','True')
|
||||
ok = xbmcgui.Dialog().ok('< %s >' % Localization.localize('Torrenter Update 2.3.1'),
|
||||
Localization.localize('I added custom searchers to Torrenter v2!'),
|
||||
Localization.localize('Now you can use your login on trackers or write and install your own searcher!'))
|
||||
Localization.localize('We added Android ARM full support to Torrenter v2!'),
|
||||
Localization.localize('With external searcher support I deleted pre-installed ones!'))
|
||||
|
||||
yes=xbmcgui.Dialog().yesno('< %s >' % Localization.localize('Torrenter Update 2.3.1'),
|
||||
Localization.localize('You have no installed searchers!'),
|
||||
Localization.localize('Would you like to install searcher from "MyShows.me Kodi Repo" in Programs section?'),)
|
||||
if yes:
|
||||
xbmc.executebuiltin('Dialog.Close(all,true)')
|
||||
xbmc.executebuiltin('XBMC.ActivateWindow(Addonbrowser,addons://search/%s)' % ('Torrenter Searcher'))
|
||||
|
|
BIN
icons/clear.png
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 4.2 KiB |
BIN
icons/deluge.png
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 6.8 KiB |
BIN
icons/fav.png
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 18 KiB |
BIN
icons/list.png
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 21 KiB |
BIN
icons/magnet.png
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 8.0 KiB |
BIN
icons/media.png
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 16 KiB |
BIN
icons/search.png
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 22 KiB |
BIN
icons/unfav.png
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 18 KiB |
BIN
icons/video.png
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 22 KiB |
BIN
icons/vuze.png
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 2.9 KiB |
|
@ -1,69 +0,0 @@
|
|||
# -*- 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
|
|
@ -1,91 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
Torrenter plugin for XBMC
|
||||
Copyright (C) 2012 Vadim Skorba
|
||||
vadim.skorba@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
'''
|
||||
|
||||
import urllib
|
||||
import re
|
||||
import sys
|
||||
|
||||
import SearcherABC
|
||||
|
||||
|
||||
class EZTV(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/EZTV.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="https://eztv.ch/search/"
|
||||
data = {'SearchString1':urllib.quote_plus(keyword),
|
||||
'SearchString':'',
|
||||
'search':'Search'}
|
||||
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.ch/'), ('Accept-encoding', 'gzip'), ]
|
||||
response = self.makeRequest(url, data=data, headers=headers)
|
||||
|
||||
if None != response and 0 < len(response):
|
||||
#print response
|
||||
dat = re.compile(
|
||||
r'''class="epinfo">(.+?)</a>.+?<a href="(magnet.+?)"''',
|
||||
re.DOTALL).findall(response)
|
||||
for (title, link) in dat:
|
||||
size = '? MB'
|
||||
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(title)),
|
||||
self.__class__.__name__ + '::' + link,
|
||||
image,
|
||||
))
|
||||
return filesList
|
|
@ -1,103 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
Torrenter plugin for XBMC
|
||||
Copyright (C) 2012 Vadim Skorba
|
||||
vadim.skorba@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
'''
|
||||
|
||||
import urllib
|
||||
import re
|
||||
import sys
|
||||
#import HTMLParser
|
||||
|
||||
import SearcherABC
|
||||
|
||||
|
||||
class ExtraTorrent(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/ExtraTorrent.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 getTorrentFile(self, url):
|
||||
url=url.replace('download', 'torrent')
|
||||
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', 'http://extratorrent.cc/'), ('Accept-encoding', 'gzip'), ]
|
||||
content = self.makeRequest(url, headers=headers)
|
||||
ok=re.compile('(magnet:.+?)"').findall(content)
|
||||
if len(ok)>0:
|
||||
return ok[0]
|
||||
|
||||
def search(self, keyword):
|
||||
filesList = []
|
||||
#pars = HTMLParser.HTMLParser()
|
||||
url = "http://extratorrent.cc/search/?search=%s&new=1&x=0&y=0" % (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', 'http://extratorrent.cc/'), ('Accept-encoding', 'gzip'), ]
|
||||
response = self.makeRequest(url, headers=headers)
|
||||
self.cookieJar.save(ignore_discard=True)
|
||||
|
||||
if None != response and 0 < len(response):
|
||||
#print response
|
||||
dat = re.compile(
|
||||
r'''<a href="/torrent_(download/\d+).+? title="Download (.+?) torrent".+?</a>.+?</td><td>(.+?)</td>.+?<td class="sy">(.+?)</td>.+?<td class="ly">(.+?)</td>''',
|
||||
re.DOTALL).findall(response)
|
||||
for (link, title, size, seeds, leechers) in dat:
|
||||
size = size.replace(' ', ' ')
|
||||
seeds=seeds.replace('---', '0')
|
||||
leechers=leechers.replace('---', '0')
|
||||
image = sys.modules["__main__"].__root__ + self.searchIcon
|
||||
link = 'http://extratorrent.cc/'+link
|
||||
filesList.append((
|
||||
int(int(self.sourceWeight) * int(seeds)),
|
||||
int(seeds), int(leechers), size,
|
||||
self.unescape(self.stripHtml(title)),
|
||||
self.__class__.__name__ + '::' + link,
|
||||
image,
|
||||
))
|
||||
return filesList
|
|
@ -1,95 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
Torrenter plugin for XBMC
|
||||
Copyright (C) 2012 Vadim Skorba
|
||||
vadim.skorba@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
'''
|
||||
|
||||
import urllib
|
||||
import re
|
||||
import sys
|
||||
|
||||
import SearcherABC
|
||||
|
||||
|
||||
class KickAssSo(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/KickAssSo.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 False
|
||||
|
||||
'''
|
||||
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 = []
|
||||
baseurl="http://kat.cr"
|
||||
url = baseurl+"/usearch/%s/?field=seeders&sorder=desc" % 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', 'http://kickass.so/'), ('Accept-encoding', 'gzip'), ]
|
||||
response = self.makeRequest(url, headers=headers)
|
||||
|
||||
if None != response and 0 < len(response):
|
||||
#print response
|
||||
good_forums=['TV','Anime','Movies']
|
||||
result = re.compile(
|
||||
r'''title="Download torrent file" href="(.+?\.torrent).+?" class=".+?"><i.+?<a.+?<a.+?<a href=".+?html" class=".+?">(.+?)</a>.+? in <span.+?"><strong>.+?">(.+?)</a>.+?<td class="nobr center">(.+?)</td>.+?<td class="green center">(\d+?)</td>.+?<td class="red lasttd center">(\d+?)</td>''',
|
||||
re.DOTALL).findall(response)
|
||||
for link,title,forum,size,seeds,leechers in result:
|
||||
if forum in good_forums:
|
||||
torrentTitle = self.unescape(self.stripHtml(title))
|
||||
size = self.unescape(self.stripHtml(size))
|
||||
image = sys.modules["__main__"].__root__ + self.searchIcon
|
||||
#print link
|
||||
filesList.append((
|
||||
int(int(self.sourceWeight) * int(seeds)),
|
||||
int(seeds), int(leechers), size,
|
||||
torrentTitle,
|
||||
self.__class__.__name__ + '::' + link,
|
||||
image,
|
||||
))
|
||||
#print str(filesList)
|
||||
return filesList
|
||||
|
||||
|
|
@ -1,152 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
Torrenter plugin for XBMC
|
||||
Copyright (C) 2012 Vadim Skorba
|
||||
vadim.skorba@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
'''
|
||||
|
||||
import re
|
||||
import sys
|
||||
|
||||
import SearcherABC
|
||||
|
||||
|
||||
class NNMClubRu(SearcherABC.SearcherABC):
|
||||
'''
|
||||
Weight of source with this searcher provided.
|
||||
Will be multiplied on default weight.
|
||||
Default weight is seeds number
|
||||
'''
|
||||
sourceWeight = 2
|
||||
|
||||
'''
|
||||
Relative (from root directory of plugin) path to image
|
||||
will shown as source image at result listing
|
||||
'''
|
||||
searchIcon = '/resources/searchers/icons/nnm-club.ru.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 False
|
||||
|
||||
'''
|
||||
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://nnm-club.me/forum/tracker.php"
|
||||
|
||||
data = {
|
||||
'prev_sd': '0',
|
||||
'prev_a': '0',
|
||||
'prev_my': '0',
|
||||
'prev_n': '0',
|
||||
'prev_shc': '0',
|
||||
'prev_shf': '1',
|
||||
'prev_sha': '1',
|
||||
'prev_shs': '0',
|
||||
'prev_shr': '0',
|
||||
'prev_sht': '0',
|
||||
'o': '10',
|
||||
's': '2',
|
||||
'tm': '-1',
|
||||
'sd': '1',
|
||||
'shc': '1',
|
||||
'shs': '1',
|
||||
'ta': '-1',
|
||||
'sns': '-1',
|
||||
'sds': '-1',
|
||||
'nm': keyword.decode('utf-8').encode('cp1251'),
|
||||
'submit': '%CF%EE%E8%F1%EA'}
|
||||
|
||||
headers = {('Origin', 'http://nnm-club.me'),
|
||||
('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', 'http://nnm-club.me/forum/tracker.php?def=1')}
|
||||
|
||||
response = self.makeRequest(url, data=data, headers=headers)
|
||||
if None != response and 0 < len(response):
|
||||
response = response.decode('cp1251').encode('utf-8')
|
||||
#self.check_login(response)
|
||||
#print response
|
||||
forums = [24, 27, 23, 14, 26, 15]
|
||||
regex = '<a class="gen" href="tracker\.php\?c=(\d+)&nm=.+?href="viewtopic\.php\?t=(\d+)"><b>(.+?)</b>.+?<td align="center" nowrap="nowrap">(?=#</td>|<a href="download\.php\?id=(\d+)".+?</td>).+?<td .+?><u>\d+?</u> (.+?)</td>.+?<td.+?title="Seeders".+?<b>(\d+)</b>.+?<td .+?title="Leechers".+?<b>(\d+)</b>.+?</tr>'
|
||||
for (forum, topic, title, link, size, seeds, leechers) in re.compile(regex, re.DOTALL).findall(response):
|
||||
if int(forum) in forums and link not in ['', None]:
|
||||
image = sys.modules["__main__"].__root__ + self.searchIcon
|
||||
link = 'http://nnm-club.me/forum/download.php?id=' + link + '&' + topic
|
||||
filesList.append((
|
||||
int(int(self.sourceWeight) * int(seeds)),
|
||||
int(seeds), int(leechers), size,
|
||||
self.unescape(self.stripHtml(title)),
|
||||
self.__class__.__name__ + '::' + link,
|
||||
image,
|
||||
))
|
||||
return filesList
|
||||
|
||||
def check_login(self, response=None):
|
||||
if None != response and 0 < len(response):
|
||||
if re.compile('<a href="login.php" class="mainmenu">').search(response):
|
||||
print 'NNM-Club Not logged!'
|
||||
self.login()
|
||||
return False
|
||||
return True
|
||||
|
||||
def getTorrentFile(self, url):
|
||||
self.timeout(5)
|
||||
|
||||
referer = 'http://nnm-club.me/forum/viewtopic.php?t=' + re.search('(\d+)$', url).group(1)
|
||||
#print url
|
||||
|
||||
headers=[('Referer', referer)]
|
||||
content = self.makeRequest(url,headers=headers)
|
||||
|
||||
if not self.check_login(content):
|
||||
content = self.makeRequest(url,headers=headers)
|
||||
|
||||
return self.saveTorrentFile(url, content)
|
||||
|
||||
def login(self):
|
||||
data = {
|
||||
'password': 'torrenter',
|
||||
'username': 'torrenter-plugin',
|
||||
'login': '%C2%F5%EE%E4',
|
||||
'redirect': 'index.php',
|
||||
'autologin': 'on'
|
||||
}
|
||||
self.makeRequest(
|
||||
'http://nnm-club.me/forum/login.php',
|
||||
data
|
||||
)
|
||||
self.cookieJar.save(ignore_discard=True)
|
||||
for cookie in self.cookieJar:
|
||||
if cookie.name == 'phpbb2mysql_4_sid' and cookie.domain=='.nnm-club.me':
|
||||
return 'phpbb2mysql_4_sid=' + cookie.value
|
||||
return False
|
|
@ -1,89 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
Torrenter plugin for XBMC
|
||||
Copyright (C) 2012 Vadim Skorba
|
||||
vadim.skorba@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
'''
|
||||
|
||||
import urllib
|
||||
import re
|
||||
import sys
|
||||
import HTMLParser
|
||||
|
||||
import SearcherABC
|
||||
|
||||
|
||||
class Nyaa(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/Nyaa.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 False
|
||||
|
||||
'''
|
||||
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 = []
|
||||
pars = HTMLParser.HTMLParser()
|
||||
url = "http://www.nyaa.se/?page=search&cats=1_0&term=%s&sort=2" % (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', 'http://www.nyaa.se/'), ('Accept-encoding', 'gzip'), ]
|
||||
response = self.makeRequest(url, headers=headers)
|
||||
|
||||
if None != response and 0 < len(response):
|
||||
#print response
|
||||
dat = re.compile(
|
||||
r'''<td class="tlistname">.+?>(.+?)</a></td><td class="tlistdownload"><a href="(.+?)" title="Download" rel="nofollow">.+?<td class="tlistsize">(.+?)</td><td class="tlistsn">(\d+)</td><td class="tlistln">(\d+)</td>''',
|
||||
re.DOTALL).findall(response)
|
||||
for (title,link, size, seeds, leechers) in dat:
|
||||
image = sys.modules["__main__"].__root__ + self.searchIcon
|
||||
link = self.unescape(link)
|
||||
filesList.append((
|
||||
int(int(self.sourceWeight) * int(seeds)),
|
||||
int(seeds), int(leechers), size,
|
||||
pars.unescape(self.stripHtml(title)),
|
||||
self.__class__.__name__ + '::' + link,
|
||||
image,
|
||||
))
|
||||
return filesList
|
|
@ -0,0 +1,3 @@
|
|||
Moved to MyShows.me Kodi Repo, please install from it.
|
||||
|
||||
https://bitbucket.org/DiMartino/myshows.me-kodi-repo/downloads/repository.myshows.me.zip
|
|
@ -1,110 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
Torrenter plugin for XBMC
|
||||
Copyright (C) 2012 Vadim Skorba
|
||||
vadim.skorba@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
'''
|
||||
|
||||
import urllib
|
||||
import re
|
||||
import sys
|
||||
|
||||
import SearcherABC
|
||||
|
||||
|
||||
class RuTorOrg(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/rutor.org.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 False
|
||||
|
||||
'''
|
||||
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 = []
|
||||
self.timeout(5)
|
||||
#print 'strating Rutor'
|
||||
url = "http://anti-tor.org/search/0/0/100/2/%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', 'http://anti-tor.org'), ('Accept-encoding', 'gzip'),
|
||||
('Cookie', str(sys.modules["__main__"].__settings__.getSetting("rutor-auth")))]
|
||||
response = self.makeRequest(url, headers=headers)
|
||||
|
||||
#print response
|
||||
|
||||
if None != response and 0 < len(response):
|
||||
cookie = re.compile("document.cookie='(.+?)';").findall(response)
|
||||
if cookie:
|
||||
#print 'ok found cookie'
|
||||
cookie = cookie[0]
|
||||
#print str(cookie)
|
||||
sys.modules["__main__"].__settings__.setSetting("rutor-auth", cookie)
|
||||
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', 'http://anti-tor.org'), ('Accept-encoding', 'gzip'),
|
||||
('Cookie', str(sys.modules["__main__"].__settings__.getSetting("rutor-auth")))]
|
||||
response = self.makeRequest(url, headers=headers)
|
||||
|
||||
#print response
|
||||
|
||||
if None != response and 0 < len(response):
|
||||
dat = re.compile(
|
||||
'<tr class="[tg].+?<a.+?href="(.+?download/\d+)">.+?<a href=".+?">.+?<a href=".+?">(.+?)</a></td>.+?<td align="right">(\d*?\..+? .+?)</td>.+?<img .+?alt="S".+?> (\d+)</span>.+?alt="L".+?> (\d+)',
|
||||
re.DOTALL).findall(response)
|
||||
if dat and len(dat) > 0:
|
||||
for (link, title, size, seeds, leechers) in dat:
|
||||
torrentTitle = title.strip() #"%s [S\L: %s\%s]" % (title, seeds, leechers)
|
||||
size = size.replace(' ', ' ')
|
||||
if link[0]=='/': link='http://anti-tor.org'+link
|
||||
image = sys.modules["__main__"].__root__ + self.searchIcon
|
||||
filesList.append((
|
||||
int(int(self.sourceWeight) * int(seeds)),
|
||||
int(seeds), int(leechers), size,
|
||||
self.unescape(self.stripHtml(torrentTitle)),
|
||||
self.__class__.__name__ + '::' + link,
|
||||
image,
|
||||
))
|
||||
return filesList
|
||||
|
|
@ -1,128 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
Torrenter plugin for XBMC
|
||||
Copyright (C) 2012 Vadim Skorba
|
||||
vadim.skorba@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
'''
|
||||
|
||||
import re
|
||||
import urllib
|
||||
import sys
|
||||
|
||||
import SearcherABC
|
||||
|
||||
|
||||
class T411FR(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/T411FR.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 False
|
||||
|
||||
'''
|
||||
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
|
||||
))'''
|
||||
|
||||
headers = {('Origin', 'http://t411.io'),
|
||||
('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', 'http://t411.io/'), ('X-NewRelic-ID', 'x='),
|
||||
('X-Requested-With', 'XMLHttpRequest'), }
|
||||
|
||||
def search(self, keyword):
|
||||
filesList = []
|
||||
url = 'http://www.t411.io/torrents/search/?search=%s' % urllib.quote_plus(
|
||||
keyword.decode('utf-8').encode('cp1251'))
|
||||
url += '&order=seeders&type=desc'
|
||||
response = self.makeRequest(url, headers=self.headers)
|
||||
if None != response and 0 < len(response):
|
||||
# self.cookieJar.save(ignore_discard=True)
|
||||
# self.check_login(response)
|
||||
# print response
|
||||
regex = '''<a href="//.+?" title="(.+?)">.+?<span class="up">.+?<a href="/torrents/nfo/\?id=(\d+)" class="ajax nfo"></a>.+?</td>.+?<td align="center">.+?</td>.+?<td align="center">.+?</td>.+?<td align="center">(.+?)</td>.+?<td align="center" class="up">(\d+)</td>.+?<td align="center" class="down">(\d+)</td>'''
|
||||
for (title, link, size, seeds, leechers) in re.compile(regex, re.DOTALL).findall(response):
|
||||
title = self.clear_title(title)
|
||||
image = sys.modules["__main__"].__root__ + self.searchIcon
|
||||
link = 'http://www.t411.io/torrents/download/?id=' + link
|
||||
filesList.append((
|
||||
int(int(self.sourceWeight) * int(seeds)),
|
||||
int(seeds), int(leechers), size,
|
||||
title,
|
||||
self.__class__.__name__ + '::' + link,
|
||||
image,
|
||||
))
|
||||
return filesList
|
||||
|
||||
def clear_title(self, s):
|
||||
return self.stripHtml(self.unescape(s)).replace(' ', ' ').replace(' ', ' ').strip()
|
||||
|
||||
def check_login(self, response=None):
|
||||
if None != response and 0 < len(response):
|
||||
# print response
|
||||
if re.compile('<input class="userInput"').search(response) or \
|
||||
re.compile('start cache').search(response):
|
||||
print 'T411FR Not logged!'
|
||||
self.login()
|
||||
return False
|
||||
return True
|
||||
|
||||
def getTorrentFile(self, url):
|
||||
content = self.makeRequest(url, headers=self.headers)
|
||||
# print content
|
||||
if not self.check_login(content):
|
||||
content = self.makeRequest(url, headers=self.headers)
|
||||
# return url
|
||||
return self.saveTorrentFile(url, content)
|
||||
|
||||
def login(self):
|
||||
data = {
|
||||
'password': 'toraddon20',
|
||||
'login': 'zombitorrent',
|
||||
'remember': '1'
|
||||
}
|
||||
x = self.makeRequest(
|
||||
'http://www.t411.io/users/auth/', data=data, headers=self.headers)
|
||||
if re.search('{"status":"OK"', x):
|
||||
print 'LOGGED T411FR'
|
||||
self.cookieJar.save(ignore_discard=True)
|
||||
for cookie in self.cookieJar:
|
||||
if cookie.name == 'authKey' and cookie.domain == '.t411.io':
|
||||
return 'authKey=' + cookie.value
|
||||
return False
|
Before Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 110 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 55 KiB |
|
@ -1,130 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
Torrenter plugin for XBMC
|
||||
Copyright (C) 2012 Vadim Skorba
|
||||
vadim.skorba@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
'''
|
||||
|
||||
import re
|
||||
import urllib
|
||||
import sys
|
||||
|
||||
import SearcherABC
|
||||
|
||||
|
||||
class KinoZalTV(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/KinoZalTV.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 False
|
||||
|
||||
'''
|
||||
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://kinozal.tv/browse.php?s=%s&g=0&c=0&v=0&d=0&w=0&t=1&f=0' % urllib.quote_plus(
|
||||
keyword.decode('utf-8').encode('cp1251'))
|
||||
|
||||
headers = {('Origin', 'http://kinozal.tv'),
|
||||
('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', 'http://kinozal.tv/')}
|
||||
|
||||
response = self.makeRequest(url, headers=headers)
|
||||
if None != response and 0 < len(response):
|
||||
response = response.decode('cp1251').encode('utf-8')
|
||||
# print response
|
||||
bad_forums = [2, 1, 23, 32, 40, 41]
|
||||
regex = '''onclick="cat\((\d+)\);".+?<a href="/details\.php\?id=(\d+)".+?>(.+?)</a>.+?<td class='s'>(.+?)</td>.+?class='sl_s'>(\d+)</td>.+?class='sl_p'>(\d+)</td>'''
|
||||
for (forum, topic, title, size, seeds, leechers) in re.compile(regex, re.DOTALL).findall(response):
|
||||
if int(forum) not in bad_forums:
|
||||
image = sys.modules["__main__"].__root__ + self.searchIcon
|
||||
link = 'http://kinozal.tv/download.php?id=' + topic
|
||||
filesList.append((
|
||||
int(int(self.sourceWeight) * int(seeds)),
|
||||
int(seeds), int(leechers), size,
|
||||
self.unescape(self.stripHtml(title)),
|
||||
self.__class__.__name__ + '::' + link,
|
||||
image,
|
||||
))
|
||||
return filesList
|
||||
|
||||
def check_login(self, response=None):
|
||||
if None != response and 0 < len(response):
|
||||
if re.compile('<html><head>').search(response):
|
||||
print 'KinoZal Not logged!'
|
||||
self.login()
|
||||
return False
|
||||
return True
|
||||
|
||||
def getTorrentFile(self, url):
|
||||
self.timeout(5)
|
||||
|
||||
content = self.makeRequest(url)
|
||||
# print content
|
||||
if not self.check_login(content):
|
||||
content = self.makeRequest(url)
|
||||
# print content
|
||||
|
||||
return self.saveTorrentFile(url, content)
|
||||
|
||||
def login(self):
|
||||
data = {
|
||||
'password': 'torrenter',
|
||||
'username': 'torrenterpl',
|
||||
'returnto:': ''
|
||||
}
|
||||
self.makeRequest(
|
||||
'http://kinozal.tv/takelogin.php',
|
||||
data
|
||||
)
|
||||
self.cookieJar.save(ignore_discard=True)
|
||||
for cookie in self.cookieJar:
|
||||
uid, passed = None, None
|
||||
if cookie.name == 'uid':
|
||||
uid = cookie.value
|
||||
if cookie.name == 'pass':
|
||||
passed = cookie.value
|
||||
if uid and passed:
|
||||
return 'uid=' + uid + '; pass=' + passed
|
||||
return False
|
|
@ -1,93 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
Torrenter plugin for XBMC
|
||||
Copyright (C) 2012 Vadim Skorba
|
||||
vadim.skorba@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
'''
|
||||
|
||||
import urllib
|
||||
import re
|
||||
import sys
|
||||
|
||||
import SearcherABC
|
||||
|
||||
|
||||
class OpenSharing(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/OpenSharing.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 False
|
||||
|
||||
'''
|
||||
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://opensharing.org/newsearch.php?search_word=%s&search_type=1&search_place=0&search_cat=0&search_sort=1&search_direction_asc=1" % 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', 'http://opensharing.org/'), ('Accept-encoding', 'gzip'), ]
|
||||
|
||||
response = self.makeRequest(url, headers=headers)
|
||||
|
||||
if None != response and 0 < len(response):
|
||||
print response
|
||||
dat = re.compile(
|
||||
r'<tr class="\w\w\w".+?<a href="magnet.+?">.+?<a class="downgif" href="(/download/\d+?/)">.+?<a .+?">(.+?)</a></td>.+?<img .+?alt="seeders".+?> (\d+)</span>.+?alt="leechers".+?>.+? (\d+)</span>.+?<td align="right">(.+?)</td><td',
|
||||
re.DOTALL | re.I).findall(response)
|
||||
if dat:
|
||||
for (link, title, seeds, leechers, size) in dat:
|
||||
torrentTitle = title
|
||||
size = self.stripHtml(size)
|
||||
link = 'http://opensharing.org' + self.unescape(link)
|
||||
image = sys.modules["__main__"].__root__ + self.searchIcon
|
||||
filesList.append((
|
||||
int(int(self.sourceWeight) * int(seeds)),
|
||||
int(seeds), int(leechers), size,
|
||||
self.unescape(self.stripHtml(torrentTitle)),
|
||||
self.__class__.__name__ + '::' + link,
|
||||
image,
|
||||
))
|
||||
return filesList
|
||||
|
|
@ -1,179 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
Torrenter plugin for XBMC
|
||||
Copyright (C) 2012 Vadim Skorba
|
||||
vadim.skorba@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
'''
|
||||
|
||||
import urllib
|
||||
import re
|
||||
import sys
|
||||
|
||||
import SearcherABC
|
||||
|
||||
|
||||
class RuTrackerOrg(SearcherABC.SearcherABC):
|
||||
'''
|
||||
Weight of source with this searcher provided.
|
||||
Will be multiplied on default weight.
|
||||
Default weight is seeds number
|
||||
'''
|
||||
sourceWeight = 2
|
||||
|
||||
'''
|
||||
Relative (from root directory of plugin) path to image
|
||||
will shown as source image at result listing
|
||||
'''
|
||||
searchIcon = '/resources/searchers/icons/rutracker.org.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 False
|
||||
|
||||
'''
|
||||
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://rutracker.org/forum/tracker.php?nm=' + urllib.quote_plus(keyword)
|
||||
|
||||
data = {'prev_my': '0',
|
||||
'prev_new': '0',
|
||||
'prev_oop': '0',
|
||||
'o': '10',
|
||||
's': '2',
|
||||
'f[]': '-1',
|
||||
'nm': keyword}
|
||||
|
||||
response = self.makeRequest(url, data=data)
|
||||
if None != response and 0 < len(response):
|
||||
response = response.decode('cp1251').encode('utf8')
|
||||
# print response
|
||||
if not self.check_login(response):
|
||||
response = self.makeRequest(url, data=data)
|
||||
response = response.decode('cp1251').encode('utf8')
|
||||
# print response
|
||||
forums = [7, 187, 2090, 2221, 2091, 2092, 2093, 934, 505, 212, 2459, 1235, 185, 22, 941, 1666, 124, 1543,
|
||||
376, 709, 1577, 511, 656, 93, 905, 1576, 101, 100, 103, 572, 1670, 2198, 2199, 313, 2201, 312,
|
||||
2339, 314, 352, 549, 1213, 2109, 514, 2097, 4, 930, 2365, 1900, 521, 2258, 208, 539, 209, 484,
|
||||
822, 921, 922, 1247, 923, 924, 1991, 925, 1165, 1245, 928, 926, 1246, 1250, 927, 1248, 33, 281,
|
||||
1386, 1387, 1388, 282, 599, 1105, 1389, 404, 1390, 1642, 1391, 893, 1478, 670, 2107, 294, 1453,
|
||||
1475, 46, 2178, 671, 2177, 251, 97, 851, 821, 2076, 98, 56, 1469, 2123, 1280, 876, 752, 1114,
|
||||
2380, 1467, 672, 249, 552, 500, 2112, 1327, 1468, 24, 1959, 115, 939, 1481, 113, 882, 1482, 393,
|
||||
1569, 373, 1186, 137, 1321, 532, 979, 827, 1484, 1485, 114, 1332, 1495, 255, 256, 1986, 1551, 626,
|
||||
262, 1326, 978, 1287, 1188, 1667, 1675, 257, 845, 875, 263, 2073, 550, 2124, 1470, 528, 486, 854,
|
||||
2079, 260, 2111, 1608, 1952, 1613, 1614, 1623, 1615, 1630, 2514, 1616, 2014, 1617, 1987, 2171,
|
||||
1620, 1621, 1998, 751, 1697, 2004, 2001, 2002, 283, 1997, 2003, 2009, 2010, 2006, 2007, 2005, 259,
|
||||
2008, 126, 9, 104, 1535, 91, 1356, 856, 188, 1408, 310, 202, 935, 990, 80, 119, 1530, 175, 79,
|
||||
172, 812, 207, 805, 123, 189, 271, 273, 743, 184, 842, 194, 1605, 85, 1144, 595, 1288, 1171, 1694,
|
||||
1690, 820, 819, 625, 84, 242, 623, 1417, 1798, 106, 166, 236, 507, 504, 536, 173, 918, 920, 203,
|
||||
1243, 1120, 140, 636, 606, 776, 235, 1499, 81, 266, 252, 1102, 1449, 196, 372, 110, 193, 1531,
|
||||
237, 265, 181, 1214, 497, 121, 721, 1117, 1359, 387, 134, 195, 2366, 2390, 2391, 2392, 2407, 2393,
|
||||
2370, 2394, 2408, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 2405, 2406, 911,
|
||||
1691, 704, 1493, 1500, 1574, 1940, 1539, 1939, 823, 1006, 972, 1299, 781, 717, 1300, 1803, 1298,
|
||||
825, 1606, 1458, 1463, 1459, 1938, 1461, 718, 1498, 907, 877, 992, 607, 594, 775, 534, 1462, 904,
|
||||
1460, 816, 815, 325, 1457, 1301, 1692, 1540, 694, 1949, 1678, 1541, 860, 1941, 1537, 2100, 2102,
|
||||
2103, 1242, 2104, 610, 1542, 2335, 1544, 1545, 1546, 1549, 1597, 1552, 1550, 1568, 1553, 1554,
|
||||
617, 1555, 2017, 1257, 1258, 2208, 677, 1255, 1479, 1261, 614, 1259, 2065, 1254, 1260, 2209, 2210,
|
||||
1547, 1548, 2211, 615, 1581, 1590, 1587, 1594, 1591, 1588, 1596, 1585, 1586, 2078, 1929, 1593,
|
||||
1592, 1595, 1556, 1560, 1561, 1653, 1570, 1654, 1655, 1656, 1930, 1931, 1932, 1562, 1563, 1626,
|
||||
1564, 1565, 1559, 1566, 1573, 1567]
|
||||
for (forum, link, title, size, seeds, leechers) in re.compile(
|
||||
'<a class="gen f" href="tracker\.php\?f=(\d+)">.+? class=".+?" href="viewtopic\.php\?t=(\d+)">(.+?)</a>.+?<a .+?href="http://dl.+?">(.+?)</a>.+?class="seedmed".+?(\d+)</.+?class=".+?eechmed".+?(\d+)',
|
||||
re.DOTALL).findall(response):
|
||||
if int(forum) in forums:
|
||||
size = size.replace(' ↓','').replace(' ', ' ')
|
||||
torrentTitle = title
|
||||
image = sys.modules["__main__"].__root__ + self.searchIcon
|
||||
link = 'http://dl.rutracker.org/forum/dl.php?t=' + link
|
||||
filesList.append((
|
||||
int(int(self.sourceWeight) * int(seeds)),
|
||||
int(seeds), int(leechers), size,
|
||||
self.unescape(self.stripHtml(torrentTitle)),
|
||||
self.__class__.__name__ + '::' + link,
|
||||
image,
|
||||
))
|
||||
return filesList
|
||||
|
||||
def getTorrentFile(self, url):
|
||||
self.load_cookie()
|
||||
cookie = None
|
||||
for cookie in self.cookieJar:
|
||||
if cookie.name == 'bb_data' and cookie.domain == '.rutracker.org':
|
||||
cookie = 'bb_data=' + cookie.value + '; bb_dl=' + re.search('(\d+)$', url).group(1)
|
||||
break
|
||||
if not cookie:
|
||||
cookie = self.login() + '; bb_dl=' + re.search('(\d+)$', url).group(1)
|
||||
|
||||
referer = 'http://rutracker.org/forum/viewtopic.php?t=' + re.search('(\d+)$', url).group(1)
|
||||
headers = [('Cookie', cookie), ('Referer', referer)]
|
||||
content = self.makeRequest(url, headers=headers)
|
||||
if not self.check_login(content):
|
||||
cookie = self.login() + '; bb_dl=' + re.search('(\d+)$', url).group(1)
|
||||
content = self.makeRequest(url, headers=[('Cookie', cookie), ('Referer', referer)])
|
||||
|
||||
return self.saveTorrentFile(url, content)
|
||||
|
||||
def check_login(self, response=None):
|
||||
if None != response and 0 < len(response):
|
||||
if re.compile('<input type="text" name="login_username"').search(response):
|
||||
print 'RuTracker Not logged!'
|
||||
self.login()
|
||||
return False
|
||||
return True
|
||||
|
||||
def login(self):
|
||||
pageContent = self.makeRequest('http://login.rutracker.org/forum/login.php')
|
||||
captchaMatch = re.compile(
|
||||
'(http://static\.rutracker\.org/captcha/\d+/\d+/[0-9a-f]+\.jpg\?\d+).+?name="cap_sid" value="(.+?)".+?name="(cap_code_[0-9a-f]+)"',
|
||||
re.DOTALL | re.MULTILINE).search(pageContent)
|
||||
data = {
|
||||
'login_password': 'torrenter_plugin2',
|
||||
'login_username': 'torrenter_plugin2',
|
||||
'login': '%C2%F5%EE%E4',
|
||||
'redirect': 'index.php'
|
||||
}
|
||||
if captchaMatch:
|
||||
captchaCode = self.askCaptcha(captchaMatch.group(1))
|
||||
if captchaCode:
|
||||
data['cap_sid'] = captchaMatch.group(2)
|
||||
data[captchaMatch.group(3)] = captchaCode
|
||||
else:
|
||||
return False
|
||||
self.makeRequest(
|
||||
'http://login.rutracker.org/forum/login.php',
|
||||
data
|
||||
)
|
||||
self.cookieJar.save(ignore_discard=True)
|
||||
for cookie in self.cookieJar:
|
||||
if cookie.name == 'bb_data':
|
||||
return 'bb_data=' + cookie.value
|
||||
return False
|
|
@ -1,127 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
Torrenter plugin for XBMC
|
||||
Copyright (C) 2012 Vadim Skorba
|
||||
vadim.skorba@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
'''
|
||||
|
||||
import re
|
||||
import urllib
|
||||
import sys
|
||||
|
||||
import SearcherABC
|
||||
|
||||
|
||||
class TFileME(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/TFileME.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 False
|
||||
|
||||
'''
|
||||
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://tfile.me/forum/ssearch.php?q=%s' % urllib.quote_plus(keyword.decode('utf-8').encode('cp1251'))
|
||||
url += '&c=2&f=4&f=1488&f=1379&f=1225&f=1331&f=1248&f=1197&f=1026&f=293&f=1227&f=577&f=298&f=297&f=290&f=299&f=230&f=303&f=292&f=1240&f=304&f=296&f=300&f=1332&f=1324&f=691&f=301&f=294&f=1241&f=498&f=367&f=574&f=1226&f=295&f=189&f=1525&f=1224&f=1388&f=1387&f=1276&f=1889&f=1917&f=1907&f=1908&f=1909&f=1910&f=1911&f=1890&f=1891&f=1892&f=1893&f=1912&f=1899&f=1894&f=1895&f=1903&f=1896&f=1897&f=1898&f=1900&f=1902&f=1901&f=1904&f=1905&f=1906&f=1913&f=15&f=1918&f=1374&f=1946&f=1579&f=1947&f=1242&f=1508&f=1165&f=1166&f=1245&f=1158&f=532&f=1167&f=1159&f=1244&f=1160&f=1173&f=1238&f=1678&f=1161&f=1320&f=1162&f=1246&f=496&f=1164&f=1163&f=1172&f=1243&f=1386&f=1312&f=1536&f=1919&f=1577&f=1989&f=1578&f=1554&f=1537&f=1538&f=1539&f=1540&f=1541&f=1542&f=1543&f=1555&f=1680&f=1544&f=1556&f=1545&f=1546&f=1547&f=1848&f=1548&f=1550&f=1620&f=1920&f=193&f=1968&f=1237&f=1420&f=1036&f=449&f=448&f=447&f=537&f=1170&f=37&f=1921&f=1323&f=1252&f=1685&f=697&f=172&f=311&f=183&f=130&f=1024&f=139&f=1023&f=179&f=392&f=308&f=342&f=1612&f=1015&f=96&f=353&f=997&f=285&f=154&f=1613&f=975&f=168&f=1849&f=1020&f=265&f=123&f=1614&f=1615&f=117&f=155&f=1611&f=1616&f=1617&f=152&f=105&f=312&f=127&f=1030&f=150&f=328&f=305&f=149&f=136&f=134&f=158&f=169&f=1421&f=768&f=767&f=309&f=377&f=1017&f=1590&f=1923&f=1591&f=1966&f=1592&f=1607&f=1593&f=1594&f=1595&f=1596&f=1597&f=1598&f=1599&f=1600&f=1844&f=1601&f=1602&f=1603&f=1604&f=1605&f=1681&f=17&f=1924&f=1415&f=1964&f=1416&f=1304&f=1146&f=1147&f=1156&f=1534&f=1142&f=29&f=85&f=1514&f=1148&f=1515&f=384&f=216&f=1149&f=232&f=1535&f=506&f=1517&f=1516&f=1000&f=1518&f=237&f=243&f=1150&f=244&f=239&f=197&f=236&f=1151&f=235&f=1152&f=234&f=1153&f=1018&f=1143&f=1563&f=1925&f=1564&f=1565&f=1566&f=1567&f=1568&f=1569&f=1570&f=1571&f=1572&f=1574&f=1575&f=1576&f=1926&f=175&f=1881&f=1256&f=1145&f=1140&f=1253&f=1157&f=727&f=1551&f=567&f=1254&f=219&f=568&f=974&f=495&f=743&f=494&f=401&f=731&f=499&f=500&f=538&f=206&f=1040&f=446&f=1005&f=210&f=203&f=207&f=204&f=1255&f=202&f=1141&f=16&f=1927&f=1380&f=1425&f=1438&f=1333&f=187&f=1062&f=1310&f=1059&f=1033&f=1509&f=1193&f=1195&f=1064&f=1063&f=1028&f=1058&f=1019&f=490&f=1397&f=1065&f=1419&f=1194&f=1070&f=274&f=1383&f=1334&f=1067&f=1068&f=1066&f=1069&f=1060&f=1282&f=19&f=1915&f=1872&f=1922&f=1284&f=1294&f=1301&f=1288&f=1291&f=1309&f=39&f=1285&f=1290&f=1306&f=1295&f=1300&f=1302&f=1287&f=1307&f=1292&f=1299&f=1297&f=1293&f=1888&f=1286&f=1298&f=1296&f=1519&f=1303&f=1527&g=&act=&y=&ql=&a=&d=&o=&size_min=0&size_max=0'
|
||||
headers = {('Origin', 'http://tfile.me'),
|
||||
('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', 'http://tfile.me/')}
|
||||
|
||||
response = self.makeRequest(url, headers=headers)
|
||||
if None != response and 0 < len(response):
|
||||
response = response.decode('cp1251').encode('utf-8')
|
||||
self.cookieJar.save(ignore_discard=True)
|
||||
# self.check_login(response)
|
||||
# print response
|
||||
# bad_forums = [2,1,23,32,40,41]
|
||||
regex = '''<a href="/forum/viewforum\.php\?f=(\d+)">.+?<a href="/forum/viewtopic\.php\?t=.+?">(.+?)</a>.+?<a href="/forum/download\.php\?id=(\d+)">(.+?)</a>.+?class="sd">(\d+)</b>.+?class="lc">(\d+)'''
|
||||
for (forum, title, link, size, seeds, leechers) in re.compile(regex, re.DOTALL).findall(response):
|
||||
# if int(forum) not in bad_forums:
|
||||
title = self.clear_title(title)
|
||||
image = sys.modules["__main__"].__root__ + self.searchIcon
|
||||
link = 'http://tfile.me/forum/download.php?id=' + link
|
||||
filesList.append((
|
||||
int(int(self.sourceWeight) * int(seeds)),
|
||||
int(seeds), int(leechers), size,
|
||||
title,
|
||||
self.__class__.__name__ + '::' + link,
|
||||
image,
|
||||
))
|
||||
return filesList
|
||||
|
||||
def clear_title(self, s):
|
||||
return self.stripHtml(self.unescape(s)).replace(' ', ' ').replace(' ', ' ').strip()
|
||||
|
||||
def check_login(self, response=None):
|
||||
if None != response and 0 < len(response):
|
||||
# print response
|
||||
if re.compile('<input class="text" type="text" name="username"').search(response):
|
||||
print 'TFileME Not logged!'
|
||||
self.login()
|
||||
return False
|
||||
return True
|
||||
|
||||
def getTorrentFile(self, url):
|
||||
self.timeout(5)
|
||||
self.check_login(self.makeRequest('http://tfile.me/'))
|
||||
content = self.makeRequest(url)
|
||||
# return url
|
||||
return self.saveTorrentFile(url, content)
|
||||
|
||||
def login(self):
|
||||
data = {
|
||||
'password': 'torrenter',
|
||||
'username': 'torrenterpl',
|
||||
'login': 'Вход'
|
||||
}
|
||||
x = self.makeRequest(
|
||||
'http://tfile.me/login/',
|
||||
data
|
||||
)
|
||||
self.cookieJar.save(ignore_discard=True)
|
||||
for cookie in self.cookieJar:
|
||||
if cookie.name == 'phpbb2mysql_data' and cookie.domain == '.tfile.me':
|
||||
return 'phpbb2mysql_data=' + cookie.value
|
||||
return False
|
|
@ -1,88 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
Torrenter plugin for XBMC
|
||||
Copyright (C) 2012 Vadim Skorba
|
||||
vadim.skorba@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
'''
|
||||
|
||||
import urllib
|
||||
import re
|
||||
import sys
|
||||
|
||||
import SearcherABC
|
||||
|
||||
|
||||
class ThePirateBaySe(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/thepiratebay.se.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 = "https://thepiratebay.mn/search/%s/0/99/200" % (urllib.quote_plus(keyword))
|
||||
|
||||
response = self.makeRequest(url)
|
||||
|
||||
if None != response and 0 < len(response):
|
||||
# print response
|
||||
dat = re.compile(
|
||||
r'<div class="detName">.+?">(.+?)</a>.+?<a href="(.+?)".+?<font class="detDesc">Uploaded .+?, Size (.+?), .+?</font>.+?<td align="right">(\d+?)</td>.+?<td align="right">(\d+?)</td>',
|
||||
re.DOTALL).findall(response)
|
||||
for (title, link, size, seeds, leechers) in dat:
|
||||
torrentTitle = title # "%s [S\L: %s\%s]" % (title, seeds, leechers)
|
||||
size = size.replace(' ', ' ')
|
||||
image = sys.modules["__main__"].__root__ + self.searchIcon
|
||||
if not re.match('^https?\://.+', link) and not re.match('^magnet\:.+', link):
|
||||
link = re.search('^(https?\://.+?)/.+', url).group(1) + link
|
||||
filesList.append((
|
||||
int(int(self.sourceWeight) * int(seeds)),
|
||||
int(seeds), int(leechers), size,
|
||||
self.unescape(self.stripHtml(torrentTitle)),
|
||||
self.__class__.__name__ + '::' + link,
|
||||
image,
|
||||
))
|
||||
return filesList
|