Plex plugin to to play various online streams (mostly Latvian).

__init__.py 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. # -*- coding: utf-8 -*-
  2. # __
  3. # /__) _ _ _ _ _/ _
  4. # / ( (- (/ (/ (- _) / _)
  5. # /
  6. """
  7. Requests HTTP library
  8. ~~~~~~~~~~~~~~~~~~~~~
  9. Requests is an HTTP library, written in Python, for human beings. Basic GET
  10. usage:
  11. >>> import requests
  12. >>> r = requests.get('https://www.python.org')
  13. >>> r.status_code
  14. 200
  15. >>> 'Python is a programming language' in r.content
  16. True
  17. ... or POST:
  18. >>> payload = dict(key1='value1', key2='value2')
  19. >>> r = requests.post('http://httpbin.org/post', data=payload)
  20. >>> print(r.text)
  21. {
  22. ...
  23. "form": {
  24. "key2": "value2",
  25. "key1": "value1"
  26. },
  27. ...
  28. }
  29. The other HTTP methods are supported - see `requests.api`. Full documentation
  30. is at <http://python-requests.org>.
  31. :copyright: (c) 2016 by Kenneth Reitz.
  32. :license: Apache 2.0, see LICENSE for more details.
  33. """
  34. __title__ = 'requests'
  35. __version__ = '2.11.1'
  36. __build__ = 0x021101
  37. __author__ = 'Kenneth Reitz'
  38. __license__ = 'Apache 2.0'
  39. __copyright__ = 'Copyright 2016 Kenneth Reitz'
  40. # Attempt to enable urllib3's SNI support, if possible
  41. try:
  42. from .packages.urllib3.contrib import pyopenssl
  43. pyopenssl.inject_into_urllib3()
  44. except ImportError:
  45. pass
  46. import warnings
  47. # urllib3's DependencyWarnings should be silenced.
  48. from .packages.urllib3.exceptions import DependencyWarning
  49. warnings.simplefilter('ignore', DependencyWarning)
  50. from . import utils
  51. from .models import Request, Response, PreparedRequest
  52. from .api import request, get, head, post, patch, put, delete, options
  53. from .sessions import session, Session
  54. from .status_codes import codes
  55. from .exceptions import (
  56. RequestException, Timeout, URLRequired,
  57. TooManyRedirects, HTTPError, ConnectionError,
  58. FileModeWarning, ConnectTimeout, ReadTimeout
  59. )
  60. # Set default logging handler to avoid "No handler found" warnings.
  61. import logging
  62. try: # Python 2.7+
  63. from logging import NullHandler
  64. except ImportError:
  65. class NullHandler(logging.Handler):
  66. def emit(self, record):
  67. pass
  68. logging.getLogger(__name__).addHandler(NullHandler())
  69. # FileModeWarnings go off per the default.
  70. warnings.simplefilter('default', FileModeWarning, append=True)