tpb changed its urls
This commit is contained in:
parent
6892909b3b
commit
3c82645837
1 changed files with 6 additions and 3 deletions
|
@ -37,7 +37,7 @@ def findMovies(query, max_results=10):
|
||||||
url = "/" + url
|
url = "/" + url
|
||||||
url = "http://thepiratebay.org" + url
|
url = "http://thepiratebay.org" + url
|
||||||
data = _getUrlUnicode(url)
|
data = _getUrlUnicode(url)
|
||||||
regexp = '''<tr.*?<td class="vertTh"><a href="/browse/(.*?)".*?<td><a href="(/tor/.*?)" class="detLink".*?>(.*?)</a>.*?</tr>'''
|
regexp = '''<tr.*?<td class="vertTh"><a href="/browse/(.*?)".*?<td><a href="(/torrent/.*?)" class="detLink".*?>(.*?)</a>.*?</tr>'''
|
||||||
for row in re.compile(regexp, re.DOTALL).findall(data):
|
for row in re.compile(regexp, re.DOTALL).findall(data):
|
||||||
torrentType = row[0]
|
torrentType = row[0]
|
||||||
torrentLink = "http://thepiratebay.org" + row[1]
|
torrentLink = "http://thepiratebay.org" + row[1]
|
||||||
|
@ -57,13 +57,16 @@ def getId(piratebayId):
|
||||||
if piratebayId.startswith('http://torrents.thepiratebay.org/'):
|
if piratebayId.startswith('http://torrents.thepiratebay.org/'):
|
||||||
piratebayId = piratebayId.split('org/')[1]
|
piratebayId = piratebayId.split('org/')[1]
|
||||||
d = findRe(piratebayId, "tor/(\d+)")
|
d = findRe(piratebayId, "tor/(\d+)")
|
||||||
|
if d:
|
||||||
|
piratebayId = d
|
||||||
|
d = findRe(piratebayId, "torrent/(\d+)")
|
||||||
if d:
|
if d:
|
||||||
piratebayId = d
|
piratebayId = d
|
||||||
return piratebayId
|
return piratebayId
|
||||||
|
|
||||||
def exists(piratebayId):
|
def exists(piratebayId):
|
||||||
piratebayId = getId(piratebayId)
|
piratebayId = getId(piratebayId)
|
||||||
return oxlib.net.exists("http://thepiratebay.org/tor/%s" % piratebayId)
|
return oxlib.net.exists("http://thepiratebay.org/torrent/%s" % piratebayId)
|
||||||
|
|
||||||
def getData(piratebayId):
|
def getData(piratebayId):
|
||||||
_key_map = {
|
_key_map = {
|
||||||
|
@ -77,7 +80,7 @@ def getData(piratebayId):
|
||||||
torrent = dict()
|
torrent = dict()
|
||||||
torrent[u'id'] = piratebayId
|
torrent[u'id'] = piratebayId
|
||||||
torrent[u'domain'] = 'thepiratebay.org'
|
torrent[u'domain'] = 'thepiratebay.org'
|
||||||
torrent[u'comment_link'] = 'http://thepiratebay.org/tor/%s' % piratebayId
|
torrent[u'comment_link'] = 'http://thepiratebay.org/torrent/%s' % piratebayId
|
||||||
|
|
||||||
data = _getUrlUnicode(torrent['comment_link'])
|
data = _getUrlUnicode(torrent['comment_link'])
|
||||||
torrent[u'title'] = findRe(data, '<title>(.*?) \(download torrent\) - TPB</title>')
|
torrent[u'title'] = findRe(data, '<title>(.*?) \(download torrent\) - TPB</title>')
|
||||||
|
|
Loading…
Add table
Reference in a new issue