platform fix
This commit is contained in:
1 parent
30df420b4f
commit
ca92203b75
33 files changed
+1835
-1356
No files matched your search
@@ -18,7 +18,10 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
'''
|
||||
|
||||
import Content, re
|
||||
import re
|
||||
|
||||
import Content
|
||||
|
||||
|
||||
class EZTV(Content.Content):
|
||||
category_dict = {
|
||||
@@ -59,31 +62,31 @@ class EZTV(Content.Content):
|
||||
response = self.makeRequest(url, headers=self.headers)
|
||||
|
||||
if None != response and 0 < len(response):
|
||||
#print response
|
||||
# print response
|
||||
if category in ['hot']:
|
||||
contentList = self.mode(response)
|
||||
#print str(contentList)
|
||||
# print str(contentList)
|
||||
return contentList
|
||||
|
||||
def mode(self, response):
|
||||
contentList = []
|
||||
#print str(result)
|
||||
# print str(result)
|
||||
num = 51
|
||||
result = re.compile(
|
||||
r'''class="epinfo">(.+?)</a>.+?<a href="(magnet.+?)".+?<td align="center" class="forum_thread_post">(.+?) </td>''',
|
||||
re.DOTALL).findall(response)
|
||||
r'''class="epinfo">(.+?)</a>.+?<a href="(magnet.+?)".+?<td align="center" class="forum_thread_post">(.+?) </td>''',
|
||||
re.DOTALL).findall(response)
|
||||
for title, link, date in result:
|
||||
#main
|
||||
# main
|
||||
info = {}
|
||||
num = num - 1
|
||||
original_title = None
|
||||
year = 0
|
||||
img = ''
|
||||
#info
|
||||
# info
|
||||
|
||||
info['label'] = info['title'] = title
|
||||
info['link'] = link
|
||||
info['plot'] = info['title']+'\r\nAge: %s' % (date)
|
||||
info['plot'] = info['title'] + '\r\nAge: %s' % (date)
|
||||
|
||||
contentList.append((
|
||||
int(int(self.sourceWeight) * (int(num))),
|
||||
|
||||
@@ -18,19 +18,24 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
'''
|
||||
import re
|
||||
|
||||
import Content
|
||||
from BeautifulSoup import BeautifulSoup
|
||||
|
||||
|
||||
class KickAssSo(Content.Content):
|
||||
category_dict = {
|
||||
'hot': ('Most Recent', '/new/?field=seeders&sorder=desc', {'page': '/new/%d/?field=seeders&sorder=desc', 'increase': 1, 'second_page': 2,
|
||||
' ':[{'name':' ', 'url_after':'?field=seeders&sorder=desc'}]}),
|
||||
'hot': ('Most Recent', '/new/?field=seeders&sorder=desc',
|
||||
{'page': '/new/%d/?field=seeders&sorder=desc', 'increase': 1, 'second_page': 2,
|
||||
' ': [{'name': ' ', 'url_after': '?field=seeders&sorder=desc'}]}),
|
||||
'anime': ('Anime', '/anime/', {'page': '/anime/%d/', 'increase': 1, 'second_page': 2,
|
||||
' ':[{'name':' ', 'url_after':'?field=seeders&sorder=desc'}]}),
|
||||
'tvshows': ('TV Shows', '/tv/?field=seeders&sorder=desc', {'page': '/tv/%d/?field=seeders&sorder=desc', 'increase': 1, 'second_page': 2,
|
||||
' ':[{'name':' ', 'url_after':'?field=seeders&sorder=desc'}]}),
|
||||
'movies': ('Movies', '/movies/?field=seeders&sorder=desc', {'page': '/movies/%d/?field=seeders&sorder=desc', 'increase': 1, 'second_page': 2,
|
||||
' ':[{'name':' ', 'url_after':'?field=seeders&sorder=desc'}]}),
|
||||
' ': [{'name': ' ', 'url_after': '?field=seeders&sorder=desc'}]}),
|
||||
'tvshows': ('TV Shows', '/tv/?field=seeders&sorder=desc',
|
||||
{'page': '/tv/%d/?field=seeders&sorder=desc', 'increase': 1, 'second_page': 2,
|
||||
' ': [{'name': ' ', 'url_after': '?field=seeders&sorder=desc'}]}),
|
||||
'movies': ('Movies', '/movies/?field=seeders&sorder=desc',
|
||||
{'page': '/movies/%d/?field=seeders&sorder=desc', 'increase': 1, 'second_page': 2,
|
||||
' ': [{'name': ' ', 'url_after': '?field=seeders&sorder=desc'}]}),
|
||||
}
|
||||
|
||||
baseurl = "http://kat.cr"
|
||||
@@ -70,36 +75,37 @@ class KickAssSo(Content.Content):
|
||||
response = self.makeRequest(url, headers=self.headers)
|
||||
|
||||
if None != response and 0 < len(response):
|
||||
#print response
|
||||
# print response
|
||||
if category:
|
||||
contentList = self.mode(response)
|
||||
#print str(contentList)
|
||||
# print str(contentList)
|
||||
return contentList
|
||||
|
||||
def mode(self, response):
|
||||
contentList = []
|
||||
#print str(result)
|
||||
# print str(result)
|
||||
num = 51
|
||||
good_forums=['TV','Anime','Movies']
|
||||
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="center">(\d+ .+?)</td>.+?<td class="green center">(\d+?)</td>.+?<td class="red lasttd center">(\d+?)</td>''',
|
||||
re.DOTALL).findall(response)
|
||||
for link,infolink,title,forum,size,date,seeds,leechers in result:
|
||||
#main
|
||||
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="center">(\d+ .+?)</td>.+?<td class="green center">(\d+?)</td>.+?<td class="red lasttd center">(\d+?)</td>''',
|
||||
re.DOTALL).findall(response)
|
||||
for link, infolink, title, forum, size, date, seeds, leechers in result:
|
||||
# main
|
||||
if forum in good_forums:
|
||||
info = {}
|
||||
num = num - 1
|
||||
original_title = None
|
||||
year = 0
|
||||
img = ''
|
||||
#info
|
||||
# info
|
||||
|
||||
info['label'] = info['title'] = self.unescape(title)
|
||||
info['link'] = link
|
||||
info['infolink']=self.baseurl+infolink
|
||||
info['infolink'] = self.baseurl + infolink
|
||||
size = self.unescape(self.stripHtml(size))
|
||||
date=self.unescape(self.stripHtml(date))
|
||||
info['plot'] = info['title']+'\r\n[I](%s) [S/L: %s/%s] [/I]\r\nAge: %s' % (size, seeds, leechers, date)
|
||||
date = self.unescape(self.stripHtml(date))
|
||||
info['plot'] = info['title'] + '\r\n[I](%s) [S/L: %s/%s] [/I]\r\nAge: %s' % (
|
||||
size, seeds, leechers, date)
|
||||
|
||||
contentList.append((
|
||||
int(int(self.sourceWeight) * (int(num))),
|
||||
@@ -108,8 +114,8 @@ class KickAssSo(Content.Content):
|
||||
return contentList
|
||||
|
||||
def get_info(self, url):
|
||||
movieInfo={}
|
||||
color='[COLOR blue]%s:[/COLOR] %s\r\n'
|
||||
movieInfo = {}
|
||||
color = '[COLOR blue]%s:[/COLOR] %s\r\n'
|
||||
response = self.makeRequest(url, headers=self.headers)
|
||||
|
||||
if None != response and 0 < len(response):
|
||||
@@ -117,57 +123,59 @@ class KickAssSo(Content.Content):
|
||||
result = Soup.find('div', 'torrentMediaInfo')
|
||||
if not result:
|
||||
return None
|
||||
li=result.findAll('li')
|
||||
info,movieInfo={'Cast':''},{'desc':'','poster':'','title':'','views':'0','rating':'50','kinopoisk':''}
|
||||
li = result.findAll('li')
|
||||
info, movieInfo = {'Cast': ''}, {'desc': '', 'poster': '', 'title': '', 'views': '0', 'rating': '50',
|
||||
'kinopoisk': ''}
|
||||
try:
|
||||
img=result.find('a',{'class':'movieCover'}).find('img').get('src')
|
||||
movieInfo['poster']='http:'+img
|
||||
img = result.find('a', {'class': 'movieCover'}).find('img').get('src')
|
||||
movieInfo['poster'] = 'http:' + img
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
movie=re.compile('View all <strong>(.+?)</strong> episodes</a>').match(str(result))
|
||||
movie = re.compile('View all <strong>(.+?)</strong> episodes</a>').match(str(result))
|
||||
if movie:
|
||||
info['Movie']=movie.group(1)
|
||||
info['Movie'] = movie.group(1)
|
||||
except:
|
||||
pass
|
||||
for i in li:
|
||||
name=i.find('strong').text
|
||||
name = i.find('strong').text
|
||||
if name:
|
||||
info[name.rstrip(':')]=i.text.replace(name,'',1)
|
||||
plot=result.find('div',{'id':'summary'})
|
||||
info[name.rstrip(':')] = i.text.replace(name, '', 1)
|
||||
plot = result.find('div', {'id': 'summary'})
|
||||
if plot:
|
||||
cut=plot.find('strong').text
|
||||
info['plot']=plot.text.replace(cut,'',1).replace('report summary','')
|
||||
#print str(result)
|
||||
cast=re.compile('<a href="/movies/actor/.+?">(.+?)</a>').findall(str(result))
|
||||
cut = plot.find('strong').text
|
||||
info['plot'] = plot.text.replace(cut, '', 1).replace('report summary', '')
|
||||
# print str(result)
|
||||
cast = re.compile('<a href="/movies/actor/.+?">(.+?)</a>').findall(str(result))
|
||||
if cast:
|
||||
for actor in cast:
|
||||
info['Cast']+=actor+", "
|
||||
info['Cast'] += actor + ", "
|
||||
if 'Genres' in info:
|
||||
info['Genres']=info['Genres'].replace(', ',',').replace(',',', ')
|
||||
info['Genres'] = info['Genres'].replace(', ', ',').replace(',', ', ')
|
||||
for key in info.keys():
|
||||
if not 'Movie' in info and info[key]=='addto bookmarks':
|
||||
movieInfo['title']=self.unescape(key)
|
||||
info['TV Show']=self.unescape(key)
|
||||
if not 'Movie' in info and info[key] == 'addto bookmarks':
|
||||
movieInfo['title'] = self.unescape(key)
|
||||
info['TV Show'] = self.unescape(key)
|
||||
if not 'plot' in info and 'Summary' in key:
|
||||
info['plot']=info[key]
|
||||
info['plot'] = info[key]
|
||||
|
||||
for i in ['Movie','TV Show','Release date','Original run','Episode','Air date','Genres','Language','Director','Writers','Cast','Original run','IMDb rating','AniDB rating']:
|
||||
for i in ['Movie', 'TV Show', 'Release date', 'Original run', 'Episode', 'Air date', 'Genres', 'Language',
|
||||
'Director', 'Writers', 'Cast', 'Original run', 'IMDb rating', 'AniDB rating']:
|
||||
if info.get(i) and info.get(i) not in ['']:
|
||||
movieInfo['desc']+=color %(i,info.get(i))
|
||||
if i=='Movie':
|
||||
movieInfo['title']=info.get(i)
|
||||
movieInfo['desc'] += color % (i, info.get(i))
|
||||
if i == 'Movie':
|
||||
movieInfo['title'] = info.get(i)
|
||||
|
||||
for i in ['plot','IMDb link','RottenTomatoes']:
|
||||
for i in ['plot', 'IMDb link', 'RottenTomatoes']:
|
||||
if info.get(i) and info.get(i) not in ['']:
|
||||
if i=='plot':
|
||||
movieInfo['desc']+='\r\n[COLOR blue]Plot:[/COLOR]\r\n'+info.get(i)
|
||||
if i=='RottenTomatoes':
|
||||
movieInfo['rating']=str(info.get(i).split('%')[0])
|
||||
if i=='IMDb link':
|
||||
movieInfo['kinopoisk']='http://imdb.snick.ru/ratefor/02/tt%s.png' % info.get(i)
|
||||
if i == 'plot':
|
||||
movieInfo['desc'] += '\r\n[COLOR blue]Plot:[/COLOR]\r\n' + info.get(i)
|
||||
if i == 'RottenTomatoes':
|
||||
movieInfo['rating'] = str(info.get(i).split('%')[0])
|
||||
if i == 'IMDb link':
|
||||
movieInfo['kinopoisk'] = 'http://imdb.snick.ru/ratefor/02/tt%s.png' % info.get(i)
|
||||
|
||||
|
||||
#print str(info)
|
||||
# print str(info)
|
||||
|
||||
return movieInfo
|
||||
return movieInfo
|
||||
@@ -17,35 +17,41 @@
|
||||
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 Content
|
||||
from BeautifulSoup import BeautifulSoup
|
||||
|
||||
|
||||
class SWESUB(Content.Content):
|
||||
category_dict = {
|
||||
'tvshows': ('TV Shows', '/senaste-tv-serier/', {'page': '/senaste-tv-serier/?page=%d',
|
||||
'increase': 1, 'second_page': 2,}),
|
||||
'movies': ('Movies', '/senaste-filmer/'),#, {'page': '/senaste-filmer/?page=%d', 'increase': 1, 'second_page': 2,}),
|
||||
'increase': 1, 'second_page': 2, }),
|
||||
'movies': ('Movies', '/senaste-filmer/'),
|
||||
# , {'page': '/senaste-filmer/?page=%d', 'increase': 1, 'second_page': 2,}),
|
||||
'genre': {'genre': 'by Genre',
|
||||
'action': ('Action', '/action/', {'page': '/action/?page=%d', 'increase': 1, 'second_page': 2,}),
|
||||
'adventure': ('Adventure', '/aventyr/', {'page': '/aventyr/?page=%d', 'increase': 1, 'second_page': 2,}),
|
||||
'animation': ('Animation', '/animerat/', {'page': '/animerat/?page=%d', 'increase': 1, 'second_page': 2,}),
|
||||
'comedy': ('Comedy', '/komedi/', {'page': '/komedi/?page=%d', 'increase': 1, 'second_page': 2,}),
|
||||
'crime': ('Crime', '/kriminal/', {'page': '/kriminal/?page=%d', 'increase': 1, 'second_page': 2,}),
|
||||
'documentary': ('Documentary', '/dokumentar/', {'page': '/dokumentar/?page=%d', 'increase': 1, 'second_page': 2,}),
|
||||
'drama': ('Drama', '/drama/', {'page': '/drama/?page=%d', 'increase': 1, 'second_page': 2,}),
|
||||
'family': ('Family', '/familj/', {'page': '/familj/?page=%d', 'increase': 1, 'second_page': 2,}),
|
||||
'fantasy': ('Fantasy', '/fantasy/', {'page': '/fantasy/?page=%d', 'increase': 1, 'second_page': 2,}),
|
||||
'horror': ('Horror', '/skrack/', {'page': '/skrack/?page=%d', 'increase': 1, 'second_page': 2,}),
|
||||
'music': ('Music', '/dans/', {'page': '/dans/?page=%d', 'increase': 1, 'second_page': 2,}),
|
||||
'musical': ('Musical', '/musikal/', {'page': '/musikal/?page=%d', 'increase': 1, 'second_page': 2,}),
|
||||
'romance': ('Romance', '/romantik/', {'page': '/romantik/?page=%d', 'increase': 1, 'second_page': 2,}),
|
||||
'sci_fi': ('Sci-Fi', '/sci-fi/', {'page': '/sci-fi/?page=%d', 'increase': 1, 'second_page': 2,}),
|
||||
'sport': ('Sport', '/sport/', {'page': '/sport/?page=%d', 'increase': 1, 'second_page': 2,}),
|
||||
'thriller': ('Thriller', '/thriller/', {'page': '/thriller/?page=%d', 'increase': 1, 'second_page': 2,}),
|
||||
'war': ('War', '/krig/', {'page': '/krig/?page=%d', 'increase': 1, 'second_page': 2,}),
|
||||
'western': ('Western', '/western/', {'page': '/western/?page=%d', 'increase': 1, 'second_page': 2,}),
|
||||
}
|
||||
'action': ('Action', '/action/', {'page': '/action/?page=%d', 'increase': 1, 'second_page': 2, }),
|
||||
'adventure': (
|
||||
'Adventure', '/aventyr/', {'page': '/aventyr/?page=%d', 'increase': 1, 'second_page': 2, }),
|
||||
'animation': (
|
||||
'Animation', '/animerat/', {'page': '/animerat/?page=%d', 'increase': 1, 'second_page': 2, }),
|
||||
'comedy': ('Comedy', '/komedi/', {'page': '/komedi/?page=%d', 'increase': 1, 'second_page': 2, }),
|
||||
'crime': ('Crime', '/kriminal/', {'page': '/kriminal/?page=%d', 'increase': 1, 'second_page': 2, }),
|
||||
'documentary': (
|
||||
'Documentary', '/dokumentar/', {'page': '/dokumentar/?page=%d', 'increase': 1, 'second_page': 2, }),
|
||||
'drama': ('Drama', '/drama/', {'page': '/drama/?page=%d', 'increase': 1, 'second_page': 2, }),
|
||||
'family': ('Family', '/familj/', {'page': '/familj/?page=%d', 'increase': 1, 'second_page': 2, }),
|
||||
'fantasy': ('Fantasy', '/fantasy/', {'page': '/fantasy/?page=%d', 'increase': 1, 'second_page': 2, }),
|
||||
'horror': ('Horror', '/skrack/', {'page': '/skrack/?page=%d', 'increase': 1, 'second_page': 2, }),
|
||||
'music': ('Music', '/dans/', {'page': '/dans/?page=%d', 'increase': 1, 'second_page': 2, }),
|
||||
'musical': ('Musical', '/musikal/', {'page': '/musikal/?page=%d', 'increase': 1, 'second_page': 2, }),
|
||||
'romance': (
|
||||
'Romance', '/romantik/', {'page': '/romantik/?page=%d', 'increase': 1, 'second_page': 2, }),
|
||||
'sci_fi': ('Sci-Fi', '/sci-fi/', {'page': '/sci-fi/?page=%d', 'increase': 1, 'second_page': 2, }),
|
||||
'sport': ('Sport', '/sport/', {'page': '/sport/?page=%d', 'increase': 1, 'second_page': 2, }),
|
||||
'thriller': (
|
||||
'Thriller', '/thriller/', {'page': '/thriller/?page=%d', 'increase': 1, 'second_page': 2, }),
|
||||
'war': ('War', '/krig/', {'page': '/krig/?page=%d', 'increase': 1, 'second_page': 2, }),
|
||||
'western': ('Western', '/western/', {'page': '/western/?page=%d', 'increase': 1, 'second_page': 2, }),
|
||||
}
|
||||
}
|
||||
|
||||
baseurl = "http://swesub.tv"
|
||||
@@ -83,42 +89,42 @@ class SWESUB(Content.Content):
|
||||
url = self.get_url(category, subcategory, apps_property)
|
||||
|
||||
response = self.makeRequest(url, headers=self.headers)
|
||||
response=response.decode('iso-8859-1')
|
||||
response = response.decode('iso-8859-1')
|
||||
|
||||
if None != response and 0 < len(response):
|
||||
if category:
|
||||
contentList = self.mode(response)
|
||||
#print str(contentList)
|
||||
# print str(contentList)
|
||||
return contentList
|
||||
|
||||
def mode(self, response):
|
||||
contentList = []
|
||||
num = 51
|
||||
Soup = BeautifulSoup(response)
|
||||
result = Soup.findAll('article', {'class':'box'})
|
||||
#print str(result)
|
||||
result = Soup.findAll('article', {'class': 'box'})
|
||||
# print str(result)
|
||||
for article in result:
|
||||
#main
|
||||
# main
|
||||
info = {}
|
||||
num = num - 1
|
||||
original_title = None
|
||||
year = 0
|
||||
|
||||
div=article.find('div', {'class':'box-img'})
|
||||
title=div.find('img').get('alt')
|
||||
img=div.find('img').get('src')
|
||||
link=div.find('a').get('href').replace(self.baseurl,'').replace('.html','')
|
||||
div = article.find('div', {'class': 'box-img'})
|
||||
title = div.find('img').get('alt')
|
||||
img = div.find('img').get('src')
|
||||
link = div.find('a').get('href').replace(self.baseurl, '').replace('.html', '')
|
||||
|
||||
#info
|
||||
# info
|
||||
|
||||
info['label'] = info['title'] = self.unescape(title)
|
||||
info['link'] = '%s::%s' % ('Nyaa', self.baseurl+'/downloads'+link+'/')
|
||||
info['infolink']=self.baseurl+link+'.html'
|
||||
info['link'] = '%s::%s' % ('Nyaa', self.baseurl + '/downloads' + link + '/')
|
||||
info['infolink'] = self.baseurl + link + '.html'
|
||||
|
||||
info['plot'] = article.find('div',{'class':'item-content'}).text
|
||||
info['plot'] = article.find('div', {'class': 'item-content'}).text
|
||||
|
||||
contentList.append((
|
||||
int(int(self.sourceWeight) * (int(num))),
|
||||
original_title, title, int(year), img, info,
|
||||
))
|
||||
return contentList
|
||||
return contentList
|
||||
@@ -18,22 +18,24 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
'''
|
||||
import re
|
||||
|
||||
import Content
|
||||
|
||||
|
||||
class ThePirateBaySe(Content.Content):
|
||||
category_dict = {
|
||||
'tvshows': ('TV Shows', '/browse/205', {'page': '/browse/208/%d', 'increase': 1, 'second_page': 1,
|
||||
'sort':[{'name':'by Seeders', 'url_after':'/0/7/0'},
|
||||
{'name':'by Date', 'url_after':'/0/3/0'}]}),
|
||||
'sort': [{'name': 'by Seeders', 'url_after': '/0/7/0'},
|
||||
{'name': 'by Date', 'url_after': '/0/3/0'}]}),
|
||||
'tvshowshd': ('TV Shows [HD]', '/browse/208', {'page': '/browse/208/%d', 'increase': 1, 'second_page': 1,
|
||||
'sort':[{'name':'by Seeders', 'url_after':'/0/7/0'},
|
||||
{'name':'by Date', 'url_after':'/0/3/0'}]}),
|
||||
'sort': [{'name': 'by Seeders', 'url_after': '/0/7/0'},
|
||||
{'name': 'by Date', 'url_after': '/0/3/0'}]}),
|
||||
'movies': ('Movies', '/browse/201', {'page': '/browse/208/%d', 'increase': 1, 'second_page': 1,
|
||||
'sort':[{'name':'by Seeders', 'url_after':'/0/7/0'},
|
||||
{'name':'by Date', 'url_after':'/0/3/0'}]}),
|
||||
'sort': [{'name': 'by Seeders', 'url_after': '/0/7/0'},
|
||||
{'name': 'by Date', 'url_after': '/0/3/0'}]}),
|
||||
'movieshd': ('Movies [HD]', '/browse/207', {'page': '/browse/208/%d', 'increase': 1, 'second_page': 1,
|
||||
'sort':[{'name':'by Seeders', 'url_after':'/0/7/0'},
|
||||
{'name':'by Date', 'url_after':'/0/3/0'}]}),
|
||||
'sort': [{'name': 'by Seeders', 'url_after': '/0/7/0'},
|
||||
{'name': 'by Date', 'url_after': '/0/3/0'}]}),
|
||||
}
|
||||
|
||||
baseurl = "https://thepiratebay.se"
|
||||
@@ -73,19 +75,19 @@ class ThePirateBaySe(Content.Content):
|
||||
response = self.makeRequest(url, headers=self.headers)
|
||||
|
||||
if None != response and 0 < len(response):
|
||||
#print response
|
||||
# print response
|
||||
if category:
|
||||
contentList = self.mode(response)
|
||||
#print str(contentList)
|
||||
# print str(contentList)
|
||||
return contentList
|
||||
|
||||
def mode(self, response):
|
||||
contentList = []
|
||||
#print str(result)
|
||||
# print str(result)
|
||||
num = 31
|
||||
result = 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)
|
||||
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, date, size, seeds, leechers in result:
|
||||
info = {}
|
||||
num = num - 1
|
||||
@@ -95,11 +97,11 @@ class ThePirateBaySe(Content.Content):
|
||||
size = size.replace(' ', ' ')
|
||||
date = self.stripHtml(date.replace(' ', ' '))
|
||||
|
||||
#info
|
||||
# info
|
||||
|
||||
info['label'] = info['title'] = self.unescape(title)
|
||||
info['link'] = link
|
||||
info['plot'] = info['title']+'\r\n[I](%s) [S/L: %s/%s] [/I]\r\n%s' % (size, seeds, leechers, date)
|
||||
info['plot'] = info['title'] + '\r\n[I](%s) [S/L: %s/%s] [/I]\r\n%s' % (size, seeds, leechers, date)
|
||||
contentList.append((
|
||||
int(int(self.sourceWeight) * (int(num))),
|
||||
original_title, title, int(year), img, info,
|
||||
|
||||
Reference in new issue
Block a user