1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-12-23 01:16:18 +00:00

Use HTTPS when communicating with Last.fm

This commit is contained in:
Carey Metcalfe 2019-01-17 04:46:56 -05:00
parent 7cfd958eeb
commit 69c43b749b
2 changed files with 4 additions and 4 deletions

View File

@ -80,9 +80,9 @@ class LastFm:
try: try:
if write: if write:
r = requests.post('http://ws.audioscrobbler.com/2.0/', data = kwargs, timeout = 5) r = requests.post('https://ws.audioscrobbler.com/2.0/', data = kwargs, timeout = 5)
else: else:
r = requests.get('http://ws.audioscrobbler.com/2.0/', params = kwargs, timeout = 5) r = requests.get('https://ws.audioscrobbler.com/2.0/', params = kwargs, timeout = 5)
except requests.exceptions.RequestException as e: except requests.exceptions.RequestException as e:
logger.warning('Error while connecting to LastFM: ' + str(e)) logger.warning('Error while connecting to LastFM: ' + str(e))
return None return None

View File

@ -68,9 +68,9 @@
<input type="text" class="form-control" id="lastfm" placeholder="Unlinked" readonly> <input type="text" class="form-control" id="lastfm" placeholder="Unlinked" readonly>
<div class="input-group-btn"> <div class="input-group-btn">
{% if request.user.id == user.id %} {% if request.user.id == user.id %}
<a href="http://www.last.fm/api/auth/?api_key={{ api_key }}&cb={{ request.url_root[:-(request.script_root|length+1)] + url_for('frontend.lastfm_reg', uid = 'me') }}" class="btn btn-default">Link</a> <a href="https://www.last.fm/api/auth/?api_key={{ api_key }}&cb={{ request.url_root[:-(request.script_root|length+1)] + url_for('frontend.lastfm_reg', uid = 'me') }}" class="btn btn-default">Link</a>
{% else %} {% else %}
<a href="http://www.last.fm/api/auth/?api_key={{ api_key }}&cb={{ request.url_root[:-(request.script_root|length+1)] + url_for('frontend.lastfm_reg', uid = user.id) }}" class="btn btn-default">Link</a> <a href="https://www.last.fm/api/auth/?api_key={{ api_key }}&cb={{ request.url_root[:-(request.script_root|length+1)] + url_for('frontend.lastfm_reg', uid = user.id) }}" class="btn btn-default">Link</a>
{% endif %} {% endif %}
</div> </div>
{% endif %} {% endif %}