Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When ServiceUnavailable, log error instead of exception (traceback) (#…
…764) * Don't log exception on 503 Service Unavailable but log error 503 status is not an unexpected error. Quite common btw Also OpenSubtitle raises a xmlrpclib.ProtocolError when unavailable: <ProtocolError for api.opensubtitles.org/xml-rpc: 503 Backend fetch failed> Full traceback: Unexpected error in provider 'opensubtitles' Traceback (most recent call last): File "/home/osmc/Medusa/lib/subliminal/core.py", line 118, in list_subtitles_provider return self[provider].list_subtitles(video, provider_languages) File "/home/osmc/Medusa/lib/subliminal/core.py", line 68, in __getitem__ provider.initialize() File "/home/osmc/Medusa/lib/subliminal/providers/opensubtitles.py", line 142, in initialize 'subliminal v%s' % __short_version__)) File "/usr/lib/python2.7/xmlrpclib.py", line 1233, in __call__ return self.__send(self.__name, args) File "/usr/lib/python2.7/xmlrpclib.py", line 1591, in __request verbose=self.__verbose File "/usr/lib/python2.7/xmlrpclib.py", line 1273, in request return self.single_request(host, handler, request_body, verbose) File "/usr/lib/python2.7/xmlrpclib.py", line 1321, in single_request response.msg, ProtocolError: <ProtocolError for api.opensubtitles.org/xml-rpc: 503 Backend fetch failed> * LegendasTV need a custom function as it returns 200 when unavailable * Proper handle empty content in Addic7ed Provider wrongful return a status of 304 Not Modified with an empty content raise_for_status won't raise exception for that status code * Review
- Loading branch information
Showing
9 changed files
with
123 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
interactions: | ||
- request: | ||
body: null | ||
headers: | ||
Accept: ['*/*'] | ||
Accept-Encoding: ['gzip, deflate'] | ||
Connection: [keep-alive] | ||
User-Agent: [Subliminal/2.1] | ||
method: GET | ||
uri: http://legendas.tv/legenda/sugestao/man%20of%20steel | ||
response: | ||
body: | ||
string: !!binary | | ||
H4sIAAAAAAAAA3VU207cMBB971cMqSrvqptkUUHQXEAg8YZohWhfEEImmU0Mjh3syS6r0o+p+tAP | ||
4cfqrLPLRW2kyJ45Y885nrGzrVIXtGwRamrkwbusH0ByVeVBS8fnwcE7gKxGXvYTN22QOBQ1NxYp | ||
DzqahfvBAJEgiQenWKEquYWL71nsXR62hREtQZ8sDwgfKL7lc+69wxYAc27guuL3kPvh8REur9IB | ||
7D1R29l6dMmuXf6jotCdIjYB9u0o3N+fft7dCbfZ1fifC8jw4u4rr3AucPEiaDTrVEFCq9EYfgw+ | ||
T6TijoY7n65BRVFhkBOeSOytEfPE2Th1YdHqBHNgb2SxFcjtUhUOJdNhukngAGt694jVRK1NGOQv | ||
skld8J5U1BpNutASDmEIjGNrJYPE285cLBZsDB+BRZXWlcSQKy6XJAobFbqJXaZby9JX0uxLZRXS | ||
IMseLy94dcYbfBZ4Ob1KwUYtNy7gTJcYCWXR0DHOtMFRxSdgN4f5czwa5lnsNxiqL4W6g9rgLN+o | ||
mGmXcKDMW+HJFtYezngj5DI/1zdOerIznU7cL4hLUUz2nLW3thgYlDmztJRoa0Rivr18HdxWbNW+ | ||
8bp/sxtdLgdCpZjDamEeuNPVJnn/afWl0PNKmM/uestyZUMnWMw8FHp6/4moUVQ19aTbhxQabiqh | ||
EtjedSbwjjSsJz34EC5ESXWy66O9sT2dfkg3FyJr1yx7TaFTXamkcJVA44Iy0VTg2igPhlYQkRzu | ||
X0TzWOpKR62qAuDS3dbTZ8gtjdvnHAdf5NOvrdeuE0u80RawcUxVR6ie/jz91hGcNHBjcI6ALsJg | ||
H1MizLUkHkEyfrPLfSfc3dik7l+FAc9iVwNfIF8XV6jVI/QX3eL2o5UEAAA= | ||
headers: | ||
accept-ranges: [bytes] | ||
age: ['0'] | ||
connection: [keep-alive] | ||
content-encoding: [gzip] | ||
content-length: ['671'] | ||
content-type: [text/html] | ||
date: ['Thu, 22 Jun 2017 21:09:05 GMT'] | ||
vary: [Accept-Encoding] | ||
via: [1.1 varnish] | ||
x-backend: [default_director] | ||
x-cache: [MISS] | ||
x-cacheable: ['NO:Not Cacheable'] | ||
x-varnish: ['1338282906'] | ||
status: {code: 200, message: OK} | ||
version: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters