Add SNI_SUPPORTED variable for https check

This commit is contained in:
tigranl 2016-12-06 17:10:35 +03:00
parent d065b33a81
commit 5ae13764d8

View file

@ -25,6 +25,7 @@ from tempfile import NamedTemporaryFile
from six.moves.urllib.parse import urlencode
from beets import logging
from beets import util
from beets import ui
import six
# Resizing methods
@ -32,7 +33,10 @@ PIL = 1
IMAGEMAGICK = 2
WEBPROXY = 3
PROXY_URL = 'http://images.weserv.nl/'
if ui.SNI_SUPPORTED >= (2, 7, 9):
PROXY_URL = 'https://images.weserv.nl/'
else:
PROXY_URL = 'http://images.weserv.nl/'
log = logging.getLogger('beets')