Browse Source

Merge pull request #3109 from mano3m/develop_provider

Provider fixes
pull/2589/head
Ruud Burger 11 years ago
parent
commit
26f5e8aa4b
  1. 2
      couchpotato/core/media/_base/providers/base.py
  2. 4
      couchpotato/core/media/_base/providers/torrent/kickasstorrents.py
  3. 8
      couchpotato/core/media/_base/providers/torrent/thepiratebay.py
  4. 2
      couchpotato/core/media/movie/providers/torrent/publichd.py
  5. 2
      couchpotato/core/media/movie/providers/torrent/thepiratebay.py
  6. 4
      couchpotato/core/media/movie/providers/torrent/torrentshack.py

2
couchpotato/core/media/_base/providers/base.py

@ -200,7 +200,7 @@ class YarrProvider(Provider):
self._search(media, quality, results)
# Search possible titles
else:
media_title = fireEvent('library.query', media, single = True)
media_title = fireEvent('library.query', media, include_year = False, single = True)
for title in possibleTitles(media_title):
self._searchOnTitle(title, media, quality, results)

4
couchpotato/core/media/_base/providers/torrent/kickasstorrents.py

@ -65,8 +65,8 @@ class Base(TorrentMagnetProvider):
if column_name:
if column_name == 'name':
link = td.find('div', {'class': 'torrentname'}).find_all('a')[1]
new['id'] = temp.get('id')[-8:]
link = td.find('div', {'class': 'torrentname'}).find_all('a')[2]
new['id'] = temp.get('id')[-7:]
new['name'] = link.text
new['url'] = td.find('a', 'imagnet')['href']
new['detail_url'] = self.urls['detail'] % (self.getDomain(), link['href'][1:])

8
couchpotato/core/media/_base/providers/torrent/thepiratebay.py

@ -65,7 +65,7 @@ class Base(TorrentMagnetProvider):
pass
entries = results_table.find_all('tr')
for result in entries[2:]:
for result in entries[1:]:
link = result.find(href = re.compile('torrent\/\d+\/'))
download = result.find(href = re.compile('magnet:'))
@ -109,7 +109,11 @@ class Base(TorrentMagnetProvider):
full_description = self.getCache('tpb.%s' % item['id'], item['detail_url'], cache_timeout = 25920000)
html = BeautifulSoup(full_description)
nfo_pre = html.find('div', attrs = {'class': 'nfo'})
description = toUnicode(nfo_pre.text) if nfo_pre else ''
description = ''
try:
description = toUnicode(nfo_pre.text)
except:
pass
item['description'] = description
return item

2
couchpotato/core/media/movie/providers/torrent/publichd.py

@ -11,4 +11,4 @@ autoload = 'PublicHD'
class PublicHD(MovieProvider, Base):
def buildUrl(self, media):
return fireEvent('library.query', media, single = True)
return fireEvent('library.query', media, single = True).replace(':', '')

2
couchpotato/core/media/movie/providers/torrent/thepiratebay.py

@ -13,7 +13,7 @@ class ThePirateBay(MovieProvider, Base):
cat_ids = [
([209], ['3d']),
([207], ['720p', '1080p']),
([207], ['720p', '1080p', 'bd50']),
([201], ['cam', 'ts', 'dvdrip', 'tc', 'r5', 'scr']),
([201, 207], ['brrip']),
([202], ['dvdr'])

4
couchpotato/core/media/movie/providers/torrent/torrentshack.py

@ -31,6 +31,6 @@ class TorrentShack(MovieProvider, Base):
def buildUrl(self, media, quality):
query = (tryUrlencode(fireEvent('library.query', media, single = True)),
self.getCatId(quality)[0],
self.getSceneOnly())
self.getSceneOnly(),
self.getCatId(quality)[0])
return query

Loading…
Cancel
Save