# Path: module/plugins/internal/misc.py
# def encode(value, encoding='utf-8', errors='backslashreplace'):
#     """
#     Unicode string -> encoded string (default to UTF-8)
#     """
#     if isinstance(value, unicode):
#         res = value.encode(encoding, errors)
# 
#     elif isinstance(value, str):
#         decoding = get_console_encoding(sys.stdin.encoding)
#         if encoding == decoding:
#             res = value
#         else:
#             res = transcode(value, decoding, encoding)
# 
#     else:
#         res = str(value)
# 
#     return res


import pycurl
from module.network.HTTPRequest import HTTPRequest
from ..internal.Addon import Addon
from ..internal.misc import encode
# -*- coding: utf-8 -*-




class UserAgentSwitcher(Addon):
    __name__ = "UserAgentSwitcher"
    __type__ = "hook"

# Path: module/plugins/internal/misc.py
# def encode(value, encoding='utf-8', errors='backslashreplace'):
#     """
#     Unicode string -> encoded string (default to UTF-8)
#     """
#     if isinstance(value, unicode):
#         res = value.encode(encoding, errors)
# 
#     elif isinstance(value, str):
#         decoding = get_console_encoding(sys.stdin.encoding)
#         if encoding == decoding:
#             res = value
#         else:
#             res = transcode(value, decoding, encoding)
# 
#     else:
#         res = str(value)
# 
#     return res


# Path: module/plugins/hooks/UserAgentSwitcher.py
import pycurl
from module.network.HTTPRequest import HTTPRequest
from ..internal.Addon import Addon
from ..internal.misc import encode

# -*- coding: utf-8 -*-




class UserAgentSwitcher(Addon):
    __name__ = "UserAgentSwitcher"
    __type__ = "hook"

    __version__ = "0.15"