Beispiel #1
0
    def make_page_soup(cls, html):
        """Returns BeautifulSoup object from a html.

        :param html: str
        :return: object
        :rtype: BeautifulSoup
        """
        return make_soup(html)
Beispiel #2
0
    def make_page_soup(cls, html):
        """Returns BeautifulSoup object from a html.

        :param html: str
        :return: object
        :rtype: BeautifulSoup
        """
        return make_soup(html)
Beispiel #3
0
 def login(self):
     try:
         response = requests.get(urljoin(self.url, self.token_page_path), auth=(self.user, self.password), cookies=self.cookies)
         self.csrf_token = make_soup(response.text).find(id='token').text
         if not self.csrf_token:
             raise UTorrentRPCException('Unable to fetch CSRF token.')
         self.cookies = response.cookies
     except Exception as e:
         LOGGER.error('Failed to login using `%s` RPC: %s' % (self.url, e.message))
         raise UTorrentRPCException(e.message)
Beispiel #4
0
 def login(self):
     try:
         response = requests.get(urljoin(self.url, self.token_page_path),
                                 auth=(self.user, self.password),
                                 cookies=self.cookies)
         self.csrf_token = make_soup(response.text).find(id='token').text
         if not self.csrf_token:
             raise UTorrentRPCException('Unable to fetch CSRF token.')
         self.cookies = response.cookies
     except Exception as e:
         LOGGER.error('Failed to login using `%s` RPC: %s', self.url,
                      e.message)
         raise UTorrentRPCException(e.message)