|
22 | 22 | import sonarr |
23 | 23 | import settings |
24 | 24 |
|
25 | | -__version__ = "2.1.3" |
| 25 | +__version__ = "2.1.4" |
26 | 26 |
|
27 | 27 | DBPATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "data") |
28 | 28 | DBFILE = "searcharr.db" |
@@ -382,7 +382,7 @@ def cmd_movie(self, update, context): |
382 | 382 | reply_markup=reply_markup, |
383 | 383 | ) |
384 | 384 | except BadRequest as e: |
385 | | - if str(e) == "Wrong type of the web page content": |
| 385 | + if str(e) in self._bad_request_poster_error_messages: |
386 | 386 | logger.error( |
387 | 387 | f"Error sending photo [{r['remotePoster']}]: BadRequest: {e}. Attempting to send with default poster..." |
388 | 388 | ) |
@@ -453,7 +453,7 @@ def cmd_series(self, update, context): |
453 | 453 | reply_markup=reply_markup, |
454 | 454 | ) |
455 | 455 | except BadRequest as e: |
456 | | - if str(e) == "Wrong type of the web page content": |
| 456 | + if str(e) in self._bad_request_poster_error_messages: |
457 | 457 | logger.error( |
458 | 458 | f"Error sending photo [{r['remotePoster']}]: BadRequest: {e}. Attempting to send with default poster..." |
459 | 459 | ) |
@@ -591,7 +591,7 @@ def callback(self, update, context): |
591 | 591 | reply_markup=reply_markup, |
592 | 592 | ) |
593 | 593 | except BadRequest as e: |
594 | | - if str(e) == "Wrong type of the web page content": |
| 594 | + if str(e) in self._bad_request_poster_error_messages: |
595 | 595 | logger.error( |
596 | 596 | f"Error sending photo [{r['remotePoster']}]: BadRequest: {e}. Attempting to send with default poster..." |
597 | 597 | ) |
@@ -641,7 +641,7 @@ def callback(self, update, context): |
641 | 641 | reply_markup=reply_markup, |
642 | 642 | ) |
643 | 643 | except BadRequest as e: |
644 | | - if str(e) == "Wrong type of the web page content": |
| 644 | + if str(e) in self._bad_request_poster_error_messages: |
645 | 645 | logger.error( |
646 | 646 | f"Error sending photo [{r['remotePoster']}]: BadRequest: {e}. Attempting to send with default poster..." |
647 | 647 | ) |
@@ -704,7 +704,7 @@ def callback(self, update, context): |
704 | 704 | reply_markup=reply_markup, |
705 | 705 | ) |
706 | 706 | except BadRequest as e: |
707 | | - if str(e) == "Wrong type of the web page content": |
| 707 | + if str(e) in self._bad_request_poster_error_messages: |
708 | 708 | logger.error( |
709 | 709 | f"Error sending photo [{r['remotePoster']}]: BadRequest: {e}. Attempting to send with default poster..." |
710 | 710 | ) |
@@ -786,7 +786,7 @@ def callback(self, update, context): |
786 | 786 | reply_markup=reply_markup, |
787 | 787 | ) |
788 | 788 | except BadRequest as e: |
789 | | - if str(e) == "Wrong type of the web page content": |
| 789 | + if str(e) in self._bad_request_poster_error_messages: |
790 | 790 | logger.error( |
791 | 791 | f"Error sending photo [{r['remotePoster']}]: BadRequest: {e}. Attempting to send with default poster..." |
792 | 792 | ) |
@@ -851,7 +851,7 @@ def callback(self, update, context): |
851 | 851 | reply_markup=reply_markup, |
852 | 852 | ) |
853 | 853 | except BadRequest as e: |
854 | | - if str(e) == "Wrong type of the web page content": |
| 854 | + if str(e) in self._bad_request_poster_error_messages: |
855 | 855 | logger.error( |
856 | 856 | f"Error sending photo [{r['remotePoster']}]: BadRequest: {e}. Attempting to send with default poster..." |
857 | 857 | ) |
@@ -905,7 +905,7 @@ def callback(self, update, context): |
905 | 905 | reply_markup=reply_markup, |
906 | 906 | ) |
907 | 907 | except BadRequest as e: |
908 | | - if str(e) == "Wrong type of the web page content": |
| 908 | + if str(e) in self._bad_request_poster_error_messages: |
909 | 909 | logger.error( |
910 | 910 | f"Error sending photo [{r['remotePoster']}]: BadRequest: {e}. Attempting to send with default poster..." |
911 | 911 | ) |
@@ -1761,6 +1761,11 @@ def _xlate(self, key, **kwargs): |
1761 | 1761 | logger.error(f"No translation found for key [{key}]!") |
1762 | 1762 | return "(translation not found)" |
1763 | 1763 |
|
| 1764 | + _bad_request_poster_error_messages = [ |
| 1765 | + "Wrong type of the web page content", |
| 1766 | + "Wrong file identifier/http url specified", |
| 1767 | + ] |
| 1768 | + |
1764 | 1769 |
|
1765 | 1770 | if __name__ == "__main__": |
1766 | 1771 | args = parse_args() |
|
0 commit comments