check if torrent site still exists
This commit is contained in:
parent
24d7378432
commit
3e9d4f357a
2 changed files with 13 additions and 0 deletions
|
@ -10,6 +10,7 @@ from urllib import quote
|
|||
from oxutils.cache import getUrl, getUrlUnicode
|
||||
from oxutils import findRe, cache, stripTags, decodeHtml, getTorrentInfo, intValue, normalizeNewlines
|
||||
from oxutils.normalize import normalizeImdbId
|
||||
import oxutils
|
||||
|
||||
from torrent import Torrent
|
||||
|
||||
|
@ -55,6 +56,13 @@ def getId(mininovaId):
|
|||
else:
|
||||
return mininovaId[-1]
|
||||
|
||||
def exists(mininovaId):
|
||||
mininovaId = getId(mininovaId)
|
||||
data = oxutils.net.getUrl("http://www.mininova.org/tor/%s" % mininovaId)
|
||||
if not data or 'Torrent not found...' in data:
|
||||
return False
|
||||
return True
|
||||
|
||||
def getData(mininovaId):
|
||||
_key_map = {
|
||||
'by': u'uploader',
|
||||
|
|
|
@ -12,6 +12,7 @@ from urllib2 import URLError
|
|||
from oxutils.cache import getUrl, getUrlUnicode
|
||||
from oxutils import findRe, cache, stripTags, decodeHtml, getTorrentInfo, normalizeNewlines
|
||||
from oxutils.normalize import normalizeImdbId
|
||||
import oxutils
|
||||
|
||||
from torrent import Torrent
|
||||
|
||||
|
@ -66,6 +67,10 @@ def getId(piratebayId):
|
|||
piratebayId = d
|
||||
return piratebayId
|
||||
|
||||
def exists(piratebayId):
|
||||
piratebayId = getId(piratebayId)
|
||||
return oxutils.net.exists("http://thepiratebay.org/tor/%s" % piratebayId)
|
||||
|
||||
def getData(piratebayId):
|
||||
_key_map = {
|
||||
'spoken language(s)': u'language',
|
||||
|
|
Loading…
Reference in a new issue