Skip to content

Commit 66dc526

Browse files
committed
Add legacy SSL / CA fix
1 parent 7debfe9 commit 66dc526

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

website/apps/importer/util/importer_tools.py

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -853,25 +853,18 @@ def mb_complete_media_task(
853853
rel.save()
854854

855855
# acousticbrainz musical analysis
856-
if mb_id:
857-
url = "http://acousticbrainz.org/{mb_id}/low-level".format(mb_id=mb_id)
858-
log.debug("API request for: %s" % url)
859-
r = requests.get(url, timeout=5)
860-
if r.status_code == 200:
861-
result = r.json()
862-
try:
863-
bpm = result["rhythm"]["bpm"]
864-
log.debug("aquired tempo - {}bpm".format(bpm))
865-
obj.tempo = float(bpm)
866-
except Exception as e:
867-
pass
868-
869-
# try:
870-
# key = result['tonal']['key_key']
871-
# scale = result['tonal']['key_scale']
872-
# obj.tempo = bpm
873-
# except:
874-
# pass
856+
# if mb_id:
857+
# url = "http://acousticbrainz.org/{mb_id}/low-level".format(mb_id=mb_id)
858+
# log.debug("API request for: %s" % url)
859+
# r = requests.get(url, timeout=5)
860+
# if r.status_code == 200:
861+
# result = r.json()
862+
# try:
863+
# bpm = result["rhythm"]["bpm"]
864+
# log.debug("aquired tempo - {}bpm".format(bpm))
865+
# obj.tempo = float(bpm)
866+
# except Exception as e:
867+
# pass
875868

876869
return obj
877870

website/project/settings/components/10-base.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,19 @@
1717
COMPRESS_OFFLINE = False
1818
COMPRESS_ENABLED = True
1919

20-
2120
################################################################################
22-
# language settings
21+
# hacks
2322
################################################################################
23+
# os is outdated, manual download of cacert.pem is required
24+
# wget https://curl.se/ca/cacert.pem -O /etc/ca-manually/cacert.pem
25+
CA_CERT_PATH = "/etc/ca-manually/cacert.pem"
26+
if os.path.exists(CA_CERT_PATH):
27+
os.environ["REQUESTS_CA_BUNDLE"] = CA_CERT_PATH
2428

2529

30+
################################################################################
31+
# language settings
32+
################################################################################
2633
DEFAULT_LANGUAGE = 0
2734
LANGUAGE_CODE = "en"
2835

0 commit comments

Comments
 (0)