From bcc0fd3765673c88321b4ebba84e48fa53a4b43d Mon Sep 17 00:00:00 2001 From: morpheus65535 <5130500+morpheus65535@users.noreply.github.com> Date: Fri, 18 Jan 2019 00:12:45 -0500 Subject: [PATCH] Replacing Sub-Zero user agent with Bazarr. --- libs/subliminal_patch/providers/argenteam.py | 2 +- libs/subliminal_patch/providers/assrt.py | 2 +- libs/subliminal_patch/providers/hosszupuska.py | 2 +- libs/subliminal_patch/providers/opensubtitles.py | 4 ++-- libs/subliminal_patch/providers/supersubtitles.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/subliminal_patch/providers/argenteam.py b/libs/subliminal_patch/providers/argenteam.py index 6a2c7aec8..5220a50b9 100644 --- a/libs/subliminal_patch/providers/argenteam.py +++ b/libs/subliminal_patch/providers/argenteam.py @@ -147,7 +147,7 @@ class ArgenteamProvider(Provider, ProviderSubtitleArchiveMixin): def initialize(self): self.session = Session() - self.session.headers = {'User-Agent': os.environ.get("SZ_USER_AGENT", "Sub-Zero/2")} + self.session.headers = {'User-Agent': "Bazarr/1"} def terminate(self): self.session.close() diff --git a/libs/subliminal_patch/providers/assrt.py b/libs/subliminal_patch/providers/assrt.py index 67300dd0b..eec57f12a 100644 --- a/libs/subliminal_patch/providers/assrt.py +++ b/libs/subliminal_patch/providers/assrt.py @@ -103,7 +103,7 @@ class AssrtProvider(Provider): def initialize(self): self.session = Session() - self.session.headers = {'User-Agent': os.environ.get("SZ_USER_AGENT", "Sub-Zero/2")} + self.session.headers = {'User-Agent': "Bazarr/1"} def terminate(self): self.session.close() diff --git a/libs/subliminal_patch/providers/hosszupuska.py b/libs/subliminal_patch/providers/hosszupuska.py index 186fb06d7..ab3c4f608 100644 --- a/libs/subliminal_patch/providers/hosszupuska.py +++ b/libs/subliminal_patch/providers/hosszupuska.py @@ -133,7 +133,7 @@ class HosszupuskaProvider(Provider, ProviderSubtitleArchiveMixin): def initialize(self): self.session = Session() - self.session.headers = {'User-Agent': os.environ.get("SZ_USER_AGENT", "Sub-Zero/2")} + self.session.headers = {'User-Agent': "Bazarr/1"} def terminate(self): self.session.close() diff --git a/libs/subliminal_patch/providers/opensubtitles.py b/libs/subliminal_patch/providers/opensubtitles.py index 376c8ce19..f9fa8c080 100644 --- a/libs/subliminal_patch/providers/opensubtitles.py +++ b/libs/subliminal_patch/providers/opensubtitles.py @@ -121,7 +121,7 @@ class OpenSubtitlesProvider(ProviderRetryMixin, _OpenSubtitlesProvider): def get_server_proxy(self, url, timeout=None): return ServerProxy(url, SubZeroRequestsTransport(use_https=self.use_ssl, timeout=timeout or self.timeout, - user_agent=os.environ.get("SZ_USER_AGENT", "Sub-Zero/2"))) + user_agent="Bazarr/1")) def log_in(self, server_url=None): if server_url: @@ -132,7 +132,7 @@ class OpenSubtitlesProvider(ProviderRetryMixin, _OpenSubtitlesProvider): response = self.retry( lambda: checked( lambda: self.server.LogIn(self.username, self.password, 'eng', - os.environ.get("SZ_USER_AGENT", "Sub-Zero/2")) + "Bazarr/1") ) ) diff --git a/libs/subliminal_patch/providers/supersubtitles.py b/libs/subliminal_patch/providers/supersubtitles.py index 97c841103..7af3f0e0e 100644 --- a/libs/subliminal_patch/providers/supersubtitles.py +++ b/libs/subliminal_patch/providers/supersubtitles.py @@ -150,7 +150,7 @@ class SuperSubtitlesProvider(Provider, ProviderSubtitleArchiveMixin): def initialize(self): self.session = Session() - self.session.headers = {'User-Agent': os.environ.get("SZ_USER_AGENT", "Sub-Zero/2")} + self.session.headers = {'User-Agent': "Bazarr/1"} def terminate(self): self.session.close()