# Path: yledl/version.py



import logging
import lxml.html
import lxml.etree
import re
import requests
import sys
from requests.adapters import HTTPAdapter
from .version import version
            from requests.packages.urllib3.util.retry import Retry

logger = logging.getLogger('yledl')


class Redirected(requests.RequestException):
    pass


class HttpClient:
    def __init__(self, io):
        self._session = self._create_session(io.proxy)
        self.x_forwarded_for = io.x_forwarded_for

    def _create_session(self, proxy):
        session = requests.Session()
        session.timeout = 20

        if proxy:
            session.proxies = {
                'http': proxy,
                'https': proxy
            }

        try:

            retry = Retry(total=3,
                          backoff_factor=0.5,
                          status_forcelist=[500, 502, 503, 504])

# Path: yledl/version.py



# Path: yledl/http.py
import logging
import lxml.html
import lxml.etree
import re
import requests
import sys
from requests.adapters import HTTPAdapter
from .version import version
            from requests.packages.urllib3.util.retry import Retry


logger = logging.getLogger('yledl')


class Redirected(requests.RequestException):
    pass


class HttpClient:
    def __init__(self, io):
        self._session = self._create_session(io.proxy)
        self.x_forwarded_for = io.x_forwarded_for

    def _create_session(self, proxy):
        session = requests.Session()
        session.timeout = 20

        if proxy:
            session.proxies = {
                'http': proxy,
                'https': proxy
            }

        try:

            retry = Retry(total=3,
                          backoff_factor=0.5,
                          status_forcelist=[500, 502, 503, 504])

            session.mount('http://', HTTPAdapter(max_retries=retry))