summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBogdan Ilisei <[email protected]>2021-10-11 03:50:46 +0300
committerGitHub <[email protected]>2021-10-10 20:50:46 -0400
commit17dd5ddde5bd9a67f9c3ffea3d9e485927b824e2 (patch)
tree3f157fa740aed64198a692dcbc3b7d9efbb78c2f
parent779cac144812a3094cee72070a0af25192fb6268 (diff)
downloadbazarr-17dd5ddde5bd9a67f9c3ffea3d9e485927b824e2.tar.gz
bazarr-17dd5ddde5bd9a67f9c3ffea3d9e485927b824e2.zip
Fixed titrari.ro provider
-rw-r--r--libs/subliminal_patch/providers/titrari.py25
1 files changed, 22 insertions, 3 deletions
diff --git a/libs/subliminal_patch/providers/titrari.py b/libs/subliminal_patch/providers/titrari.py
index c5ee01d59..967aca6cb 100644
--- a/libs/subliminal_patch/providers/titrari.py
+++ b/libs/subliminal_patch/providers/titrari.py
@@ -104,7 +104,9 @@ class TitrariProvider(Provider, ProviderSubtitleArchiveMixin):
def initialize(self):
self.session = Session()
- self.session.headers['User-Agent'] = AGENT_LIST[randint(0, len(AGENT_LIST) - 1)]
+ # Hardcoding the UA to bypass the 30s throttle that titrari.ro uses for IP/UA pair
+ self.session.headers['User-Agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4535.2 Safari/537.36'
+ # self.session.headers['User-Agent'] = AGENT_LIST[randint(0, len(AGENT_LIST) - 1)]
def terminate(self):
self.session.close()
@@ -184,11 +186,28 @@ class TitrariProvider(Provider, ProviderSubtitleArchiveMixin):
else:
return None
-
+ # titrari.ro seems to require all parameters now
+ # z2 = comment (empty)
+ # z3 = fps (-1: any, 0: N/A, 1: 23.97 FPS etc.)
+ # z4 = CD count (-1: any)
+ # z5 = imdb_id (empty or integer)
+ # z6 = sort order (0: unsorted, 1: by date, 2: by name)
+ # z7 = title (empty or string)
+ # z8 = language (-1: all, 1: ron, 2: eng)
+ # z9 = genre (All: all, Action: action etc.)
+ # z11 = type (0: any, 1: movie, 2: series)
def getQueryParams(self, imdb_id, title):
queryParams = {
'page': self.query_advanced_search,
- 'z8': '1'
+ 'z7': '',
+ 'z2': '',
+ 'z5': '',
+ 'z3': '-1',
+ 'z4': '-1',
+ 'z8': '-1',
+ 'z9': 'All',
+ 'z11': '0',
+ 'z6': '0'
}
if imdb_id is not None:
queryParams["z5"] = imdb_id