Merge branch 'develop'
This commit is contained in:
@@ -40,6 +40,8 @@ class WebHandler(BaseHandler):
|
|||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
if route == 'robots.txt':
|
||||||
|
self.set_header('Content-Type', 'text/plain')
|
||||||
self.write(views[route]())
|
self.write(views[route]())
|
||||||
except:
|
except:
|
||||||
log.error("Failed doing web request '%s': %s", (route, traceback.format_exc()))
|
log.error("Failed doing web request '%s': %s", (route, traceback.format_exc()))
|
||||||
@@ -60,6 +62,13 @@ def index():
|
|||||||
addView('', index)
|
addView('', index)
|
||||||
|
|
||||||
|
|
||||||
|
# Web view
|
||||||
|
def robots():
|
||||||
|
return 'User-agent: * \n' \
|
||||||
|
'Disallow: /'
|
||||||
|
addView('robots.txt', robots)
|
||||||
|
|
||||||
|
|
||||||
# API docs
|
# API docs
|
||||||
def apiDocs():
|
def apiDocs():
|
||||||
routes = list(api.keys())
|
routes = list(api.keys())
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ class Base(TorrentProvider):
|
|||||||
|
|
||||||
link = result.find('td', attrs = {'class': 'ttr_name'}).find('a')
|
link = result.find('td', attrs = {'class': 'ttr_name'}).find('a')
|
||||||
url = result.find('td', attrs = {'class': 'td_dl'}).find('a')
|
url = result.find('td', attrs = {'class': 'td_dl'}).find('a')
|
||||||
|
seeders = result.find('td', attrs = {'class': 'ttr_seeders'}).find('a')
|
||||||
leechers = result.find('td', attrs = {'class': 'ttr_leechers'}).find('a')
|
leechers = result.find('td', attrs = {'class': 'ttr_leechers'}).find('a')
|
||||||
torrent_id = link['href'].replace('details?id=', '')
|
torrent_id = link['href'].replace('details?id=', '')
|
||||||
|
|
||||||
@@ -51,7 +52,7 @@ class Base(TorrentProvider):
|
|||||||
'url': self.urls['download'] % url['href'],
|
'url': self.urls['download'] % url['href'],
|
||||||
'detail_url': self.urls['detail'] % torrent_id,
|
'detail_url': self.urls['detail'] % torrent_id,
|
||||||
'size': self.parseSize(result.find('td', attrs = {'class': 'ttr_size'}).contents[0]),
|
'size': self.parseSize(result.find('td', attrs = {'class': 'ttr_size'}).contents[0]),
|
||||||
'seeders': tryInt(result.find('td', attrs = {'class': 'ttr_seeders'}).find('a').string),
|
'seeders': tryInt(seeders.string) if seeders else 0,
|
||||||
'leechers': tryInt(leechers.string) if leechers else 0,
|
'leechers': tryInt(leechers.string) if leechers else 0,
|
||||||
'get_more_info': self.getMoreInfo,
|
'get_more_info': self.getMoreInfo,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -394,8 +394,9 @@ class MovieSearcher(SearcherBase, MovieTypeBase):
|
|||||||
log.info('Trying next release for: %s', getTitle(media))
|
log.info('Trying next release for: %s', getTitle(media))
|
||||||
self.single(media, manual = manual, force_download = force_download)
|
self.single(media, manual = manual, force_download = force_download)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
except:
|
except:
|
||||||
log.error('Failed searching for next release: %s', traceback.format_exc())
|
log.error('Failed searching for next release: %s', traceback.format_exc())
|
||||||
return False
|
return False
|
||||||
|
|||||||
@@ -110,11 +110,11 @@ class CoreNotifier(Notification):
|
|||||||
|
|
||||||
if limit_offset:
|
if limit_offset:
|
||||||
splt = splitString(limit_offset)
|
splt = splitString(limit_offset)
|
||||||
limit = splt[0]
|
limit = tryInt(splt[0])
|
||||||
offset = 0 if len(splt) is 1 else splt[1]
|
offset = tryInt(0 if len(splt) is 1 else splt[1])
|
||||||
results = db.get_many('notification', limit = limit, offset = offset, with_doc = True)
|
results = db.all('notification', limit = limit, offset = offset, with_doc = True)
|
||||||
else:
|
else:
|
||||||
results = db.get_many('notification', limit = 200, with_doc = True)
|
results = db.all('notification', limit = 200, with_doc = True)
|
||||||
|
|
||||||
notifications = []
|
notifications = []
|
||||||
for n in results:
|
for n in results:
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<meta name="mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
<meta name="robots" content="noindex, nofollow" />
|
||||||
|
|
||||||
{% for url in fireEvent('clientscript.get_styles', as_html = True, location = 'front', single = True) %}
|
{% for url in fireEvent('clientscript.get_styles', as_html = True, location = 'front', single = True) %}
|
||||||
<link rel="stylesheet" href="{{ Env.get('web_base') }}{{ url }}" type="text/css">{% end %}
|
<link rel="stylesheet" href="{{ Env.get('web_base') }}{{ url }}" type="text/css">{% end %}
|
||||||
|
|||||||
Reference in New Issue
Block a user