update PassThePopcorn for tv branch
This commit is contained in:
1 parent
de8aefebb7
commit
f77a8f5573
1 file changed
+41
-32
@@ -1,6 +1,8 @@
|
|||||||
from couchpotato.core.helpers.encoding import tryUrlencode
|
from couchpotato.core.helpers.encoding import tryUrlencode
|
||||||
from couchpotato.core.helpers.variable import getTitle, tryInt, mergeDicts
|
from couchpotato.core.helpers.variable import getTitle, tryInt, mergeDicts
|
||||||
from couchpotato.core.logger import CPLog
|
from couchpotato.core.logger import CPLog
|
||||||
|
from couchpotato.core.providers.base import MultiProvider
|
||||||
|
from couchpotato.core.providers.info.base import MovieProvider
|
||||||
from couchpotato.core.providers.torrent.base import TorrentProvider
|
from couchpotato.core.providers.torrent.base import TorrentProvider
|
||||||
from dateutil.parser import parse
|
from dateutil.parser import parse
|
||||||
import htmlentitydefs
|
import htmlentitydefs
|
||||||
@@ -11,8 +13,13 @@ import traceback
|
|||||||
|
|
||||||
log = CPLog(__name__)
|
log = CPLog(__name__)
|
||||||
|
|
||||||
|
class PassThePopcorn(MultiProvider):
|
||||||
|
|
||||||
class PassThePopcorn(TorrentProvider):
|
def getTypes(self):
|
||||||
|
return [Movie]
|
||||||
|
|
||||||
|
|
||||||
|
class Base(TorrentProvider):
|
||||||
|
|
||||||
urls = {
|
urls = {
|
||||||
'domain': 'https://tls.passthepopcorn.me',
|
'domain': 'https://tls.passthepopcorn.me',
|
||||||
@@ -25,43 +32,15 @@ class PassThePopcorn(TorrentProvider):
|
|||||||
|
|
||||||
http_time_between_calls = 2
|
http_time_between_calls = 2
|
||||||
|
|
||||||
quality_search_params = {
|
def _search(self, media, quality, results):
|
||||||
'bd50': {'media': 'Blu-ray', 'format': 'BD50'},
|
|
||||||
'1080p': {'resolution': '1080p'},
|
|
||||||
'720p': {'resolution': '720p'},
|
|
||||||
'brrip': {'media': 'Blu-ray'},
|
|
||||||
'dvdr': {'resolution': 'anysd'},
|
|
||||||
'dvdrip': {'media': 'DVD'},
|
|
||||||
'scr': {'media': 'DVD-Screener'},
|
|
||||||
'r5': {'media': 'R5'},
|
|
||||||
'tc': {'media': 'TC'},
|
|
||||||
'ts': {'media': 'TS'},
|
|
||||||
'cam': {'media': 'CAM'}
|
|
||||||
}
|
|
||||||
|
|
||||||
post_search_filters = {
|
movie_title = getTitle(media['library'])
|
||||||
'bd50': {'Codec': ['BD50']},
|
|
||||||
'1080p': {'Resolution': ['1080p']},
|
|
||||||
'720p': {'Resolution': ['720p']},
|
|
||||||
'brrip': {'Source': ['Blu-ray'], 'Quality': ['High Definition'], 'Container': ['!ISO']},
|
|
||||||
'dvdr': {'Codec': ['DVD5', 'DVD9']},
|
|
||||||
'dvdrip': {'Source': ['DVD'], 'Codec': ['!DVD5', '!DVD9']},
|
|
||||||
'scr': {'Source': ['DVD-Screener']},
|
|
||||||
'r5': {'Source': ['R5']},
|
|
||||||
'tc': {'Source': ['TC']},
|
|
||||||
'ts': {'Source': ['TS']},
|
|
||||||
'cam': {'Source': ['CAM']}
|
|
||||||
}
|
|
||||||
|
|
||||||
def _search(self, movie, quality, results):
|
|
||||||
|
|
||||||
movie_title = getTitle(movie['library'])
|
|
||||||
quality_id = quality['identifier']
|
quality_id = quality['identifier']
|
||||||
|
|
||||||
params = mergeDicts(self.quality_search_params[quality_id].copy(), {
|
params = mergeDicts(self.quality_search_params[quality_id].copy(), {
|
||||||
'order_by': 'relevance',
|
'order_by': 'relevance',
|
||||||
'order_way': 'descending',
|
'order_way': 'descending',
|
||||||
'searchstr': movie['library']['identifier']
|
'searchstr': media['library']['identifier']
|
||||||
})
|
})
|
||||||
|
|
||||||
url = '%s?json=noredirect&%s' % (self.urls['torrent'], tryUrlencode(params))
|
url = '%s?json=noredirect&%s' % (self.urls['torrent'], tryUrlencode(params))
|
||||||
@@ -203,3 +182,33 @@ class PassThePopcorn(TorrentProvider):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
loginCheckSuccess = loginSuccess
|
loginCheckSuccess = loginSuccess
|
||||||
|
|
||||||
|
class Movie(MovieProvider, Base):
|
||||||
|
|
||||||
|
quality_search_params = {
|
||||||
|
'bd50': {'media': 'Blu-ray', 'format': 'BD50'},
|
||||||
|
'1080p': {'resolution': '1080p'},
|
||||||
|
'720p': {'resolution': '720p'},
|
||||||
|
'brrip': {'media': 'Blu-ray'},
|
||||||
|
'dvdr': {'resolution': 'anysd'},
|
||||||
|
'dvdrip': {'media': 'DVD'},
|
||||||
|
'scr': {'media': 'DVD-Screener'},
|
||||||
|
'r5': {'media': 'R5'},
|
||||||
|
'tc': {'media': 'TC'},
|
||||||
|
'ts': {'media': 'TS'},
|
||||||
|
'cam': {'media': 'CAM'}
|
||||||
|
}
|
||||||
|
|
||||||
|
post_search_filters = {
|
||||||
|
'bd50': {'Codec': ['BD50']},
|
||||||
|
'1080p': {'Resolution': ['1080p']},
|
||||||
|
'720p': {'Resolution': ['720p']},
|
||||||
|
'brrip': {'Source': ['Blu-ray'], 'Quality': ['High Definition'], 'Container': ['!ISO']},
|
||||||
|
'dvdr': {'Codec': ['DVD5', 'DVD9']},
|
||||||
|
'dvdrip': {'Source': ['DVD'], 'Codec': ['!DVD5', '!DVD9']},
|
||||||
|
'scr': {'Source': ['DVD-Screener']},
|
||||||
|
'r5': {'Source': ['R5']},
|
||||||
|
'tc': {'Source': ['TC']},
|
||||||
|
'ts': {'Source': ['TS']},
|
||||||
|
'cam': {'Source': ['CAM']}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user