mirror of
https://github.com/beetbox/beets.git
synced 2025-12-16 05:34:47 +01:00
Fix #1204: insecure request warning in lyrics
This commit is contained in:
parent
fd2c57f736
commit
daba9e770e
2 changed files with 12 additions and 2 deletions
|
|
@ -23,6 +23,7 @@ import unicodedata
|
|||
import urllib
|
||||
import difflib
|
||||
import itertools
|
||||
import warnings
|
||||
from HTMLParser import HTMLParseError
|
||||
|
||||
from beets import logging
|
||||
|
|
@ -61,7 +62,13 @@ def fetch_url(url):
|
|||
is unreachable.
|
||||
"""
|
||||
try:
|
||||
r = requests.get(url, verify=False)
|
||||
# Disable the InsecureRequestWarning that comes from using
|
||||
# `verify=false`.
|
||||
# https://github.com/kennethreitz/requests/issues/2214
|
||||
# We're not overly worried about the NSA MITMing our lyrics scraper.
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter('ignore')
|
||||
r = requests.get(url, verify=False)
|
||||
except requests.RequestException as exc:
|
||||
log.debug(u'lyrics request failed: {0}', exc)
|
||||
return
|
||||
|
|
|
|||
|
|
@ -4,7 +4,10 @@ Changelog
|
|||
1.3.11 (in development)
|
||||
-----------------------
|
||||
|
||||
Changelog goes here!
|
||||
Fixes:
|
||||
|
||||
* :doc:`/plugins/lyrics`: Silence a warning about insecure requests in the new
|
||||
MusixMatch backend. :bug:`1204`
|
||||
|
||||
|
||||
1.3.10 (January 5, 2015)
|
||||
|
|
|
|||
Loading…
Reference in a new issue