Ejemplo n.º 1
0
    def __init__(self, language=None, user_agent=None):
        self.language = language or Settings.LANGUAGE
        self.token = None
        self.user_agent = user_agent or os.getenv('OS_USER_AGENT') or Settings.USER_AGENT

        transport = Transport()
        transport.user_agent = self.user_agent

        self.xmlrpc = ServerProxy(Settings.OPENSUBTITLES_SERVER,
                                  allow_none=True, transport=transport)
Ejemplo n.º 2
0
    def __init__(self, language="en", user_agent="TemporaryUserAgent"):
        self._token = None
        self.language = language
        self.user_agent = user_agent

        transport = Transport()
        transport.user_agent = self.user_agent

        self._server = ServerProxy(self.API_XMLRPC,
                                   allow_none=True,
                                   transport=transport)
Ejemplo n.º 3
0
    def __init__(self,
                 user_agent=DEFAULT_USER_AGENT,
                 username=None,
                 password=None):

        self.user_agent = user_agent
        self.username = username
        self.password = password

        transport = Transport()
        transport.user_agent = self.user_agent

        self.xmlrpc = ServerProxy(API_URL,
                                  allow_none=True,
                                  transport=transport)

        self._token = None
Ejemplo n.º 4
0
    def __init__(self, language=None, user_agent=None):
        """
        Initialize the OpenSubtitles client

        :param language: language for login
        :param user_agent: User Agent to include with requests.
            Can be specified here, via the OS_USER_AGENT environment variable,
            or via Settings.USER_AGENT (default)

            For more information: http://trac.opensubtitles.org/projects/opensubtitles/wiki/DevReadFirst#Howtorequestanewuseragent
        """
        self.language = language or Settings.LANGUAGE
        self.token = None
        self.user_agent = user_agent or os.getenv('OS_USER_AGENT') or Settings.USER_AGENT

        transport = Transport()
        transport.user_agent = self.user_agent

        self.xmlrpc = ServerProxy(Settings.OPENSUBTITLES_SERVER,
                                  allow_none=True, transport=transport)