mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-21 00:14:02 +01:00
http -> https for internet calls
This commit is contained in:
@@ -22,7 +22,7 @@ from headphones import db, logger, request
|
|||||||
|
|
||||||
TIMEOUT = 60.0 # seconds
|
TIMEOUT = 60.0 # seconds
|
||||||
REQUEST_LIMIT = 1.0 / 5 # seconds
|
REQUEST_LIMIT = 1.0 / 5 # seconds
|
||||||
ENTRY_POINT = "http://ws.audioscrobbler.com/2.0/"
|
ENTRY_POINT = "https://ws.audioscrobbler.com/2.0/"
|
||||||
API_KEY = "395e6ec6bb557382fc41fde867bce66f"
|
API_KEY = "395e6ec6bb557382fc41fde867bce66f"
|
||||||
|
|
||||||
# Required for API request limit
|
# Required for API request limit
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ def getLyrics(artist, song):
|
|||||||
"fmt": 'xml'
|
"fmt": 'xml'
|
||||||
}
|
}
|
||||||
|
|
||||||
url = 'http://lyrics.wikia.com/api.php'
|
url = 'https://lyrics.wikia.com/api.php'
|
||||||
data = request.request_minidom(url, params=params)
|
data = request.request_minidom(url, params=params)
|
||||||
|
|
||||||
if not data:
|
if not data:
|
||||||
|
|||||||
+7
-19
@@ -124,11 +124,7 @@ def findArtist(name, limit=1):
|
|||||||
'Cannot determine the best match from an artist/album search. Using top match instead')
|
'Cannot determine the best match from an artist/album search. Using top match instead')
|
||||||
artistlist.append({
|
artistlist.append({
|
||||||
# Just need the artist id if the limit is 1
|
# Just need the artist id if the limit is 1
|
||||||
# 'name': unicode(result['sort-name']),
|
|
||||||
# 'uniquename': uniquename,
|
|
||||||
'id': str(result['id']),
|
'id': str(result['id']),
|
||||||
# 'url': unicode("http://musicbrainz.org/artist/" + result['id']),#probably needs to be changed
|
|
||||||
# 'score': int(result['ext:score'])
|
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
artistlist.append(artistdict)
|
artistlist.append(artistdict)
|
||||||
@@ -137,7 +133,7 @@ def findArtist(name, limit=1):
|
|||||||
'name': str(result['sort-name']),
|
'name': str(result['sort-name']),
|
||||||
'uniquename': uniquename,
|
'uniquename': uniquename,
|
||||||
'id': str(result['id']),
|
'id': str(result['id']),
|
||||||
'url': str("http://musicbrainz.org/artist/" + result['id']),
|
'url': str("https://musicbrainz.org/artist/" + result['id']),
|
||||||
# probably needs to be changed
|
# probably needs to be changed
|
||||||
'score': int(result['ext:score'])
|
'score': int(result['ext:score'])
|
||||||
})
|
})
|
||||||
@@ -208,9 +204,9 @@ def findRelease(name, limit=1, artist=None):
|
|||||||
'id': str(result['artist-credit'][0]['artist']['id']),
|
'id': str(result['artist-credit'][0]['artist']['id']),
|
||||||
'albumid': str(result['id']),
|
'albumid': str(result['id']),
|
||||||
'url': str(
|
'url': str(
|
||||||
"http://musicbrainz.org/artist/" + result['artist-credit'][0]['artist']['id']),
|
"https://musicbrainz.org/artist/" + result['artist-credit'][0]['artist']['id']),
|
||||||
# probably needs to be changed
|
# probably needs to be changed
|
||||||
'albumurl': str("http://musicbrainz.org/release/" + result['id']),
|
'albumurl': str("https://musicbrainz.org/release/" + result['id']),
|
||||||
# probably needs to be changed
|
# probably needs to be changed
|
||||||
'score': int(result['ext:score']),
|
'score': int(result['ext:score']),
|
||||||
'date': str(result['date']) if 'date' in result else '',
|
'date': str(result['date']) if 'date' in result else '',
|
||||||
@@ -248,7 +244,7 @@ def findSeries(name, limit=1):
|
|||||||
'name': str(result['name']),
|
'name': str(result['name']),
|
||||||
'type': str(result['type']),
|
'type': str(result['type']),
|
||||||
'id': str(result['id']),
|
'id': str(result['id']),
|
||||||
'url': str("http://musicbrainz.org/series/" + result['id']),
|
'url': str("https://musicbrainz.org/series/" + result['id']),
|
||||||
# probably needs to be changed
|
# probably needs to be changed
|
||||||
'score': int(result['ext:score'])
|
'score': int(result['ext:score'])
|
||||||
})
|
})
|
||||||
@@ -295,7 +291,7 @@ def getArtist(artistid, extrasonly=False):
|
|||||||
releasegroups.append({
|
releasegroups.append({
|
||||||
'title': str(rg['title']),
|
'title': str(rg['title']),
|
||||||
'id': str(rg['id']),
|
'id': str(rg['id']),
|
||||||
'url': "http://musicbrainz.org/release-group/" + rg['id'],
|
'url': "https://musicbrainz.org/release-group/" + rg['id'],
|
||||||
'type': str(rg['type'])
|
'type': str(rg['type'])
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -356,7 +352,7 @@ def getArtist(artistid, extrasonly=False):
|
|||||||
releasegroups.append({
|
releasegroups.append({
|
||||||
'title': str(rg['title']),
|
'title': str(rg['title']),
|
||||||
'id': str(rg['id']),
|
'id': str(rg['id']),
|
||||||
'url': "http://musicbrainz.org/release-group/" + rg['id'],
|
'url': "https://musicbrainz.org/release-group/" + rg['id'],
|
||||||
'type': str(rg_type)
|
'type': str(rg_type)
|
||||||
})
|
})
|
||||||
artist_dict['releasegroups'] = releasegroups
|
artist_dict['releasegroups'] = releasegroups
|
||||||
@@ -691,7 +687,7 @@ def getTracksFromRelease(release):
|
|||||||
'number': totalTracks,
|
'number': totalTracks,
|
||||||
'title': track_title,
|
'title': track_title,
|
||||||
'id': str(track['recording']['id']),
|
'id': str(track['recording']['id']),
|
||||||
'url': "http://musicbrainz.org/track/" + track['recording']['id'],
|
'url': "https://musicbrainz.org/track/" + track['recording']['id'],
|
||||||
'duration': int(track['length']) if 'length' in track else 0
|
'duration': int(track['length']) if 'length' in track else 0
|
||||||
})
|
})
|
||||||
totalTracks += 1
|
totalTracks += 1
|
||||||
@@ -733,15 +729,7 @@ def findArtistbyAlbum(name):
|
|||||||
for releaseGroup in results:
|
for releaseGroup in results:
|
||||||
newArtist = releaseGroup['artist-credit'][0]['artist']
|
newArtist = releaseGroup['artist-credit'][0]['artist']
|
||||||
# Only need the artist ID if we're doing an artist+album lookup
|
# Only need the artist ID if we're doing an artist+album lookup
|
||||||
# if 'disambiguation' in newArtist:
|
|
||||||
# uniquename = unicode(newArtist['sort-name'] + " (" + newArtist['disambiguation'] + ")")
|
|
||||||
# else:
|
|
||||||
# uniquename = unicode(newArtist['sort-name'])
|
|
||||||
# artist_dict['name'] = unicode(newArtist['sort-name'])
|
|
||||||
# artist_dict['uniquename'] = uniquename
|
|
||||||
artist_dict['id'] = str(newArtist['id'])
|
artist_dict['id'] = str(newArtist['id'])
|
||||||
# artist_dict['url'] = u'http://musicbrainz.org/artist/' + newArtist['id']
|
|
||||||
# artist_dict['score'] = int(releaseGroup['ext:score'])
|
|
||||||
|
|
||||||
return artist_dict
|
return artist_dict
|
||||||
|
|
||||||
|
|||||||
@@ -920,7 +920,7 @@ class BOXCAR(object):
|
|||||||
def notify(self, title, message, rgid=None):
|
def notify(self, title, message, rgid=None):
|
||||||
try:
|
try:
|
||||||
if rgid:
|
if rgid:
|
||||||
message += '<br></br><a href="http://musicbrainz.org/' \
|
message += '<br></br><a href="https://musicbrainz.org/' \
|
||||||
'release-group/%s">MusicBrainz</a>' % rgid
|
'release-group/%s">MusicBrainz</a>' % rgid
|
||||||
|
|
||||||
data = urllib.parse.urlencode({
|
data = urllib.parse.urlencode({
|
||||||
@@ -1019,7 +1019,7 @@ class TELEGRAM(object):
|
|||||||
|
|
||||||
# MusicBrainz link
|
# MusicBrainz link
|
||||||
if rgid:
|
if rgid:
|
||||||
message += '\n\n <a href="http://musicbrainz.org/' \
|
message += '\n\n <a href="https://musicbrainz.org/' \
|
||||||
'release-group/%s">MusicBrainz</a>' % rgid
|
'release-group/%s">MusicBrainz</a>' % rgid
|
||||||
|
|
||||||
# Send image
|
# Send image
|
||||||
|
|||||||
@@ -19,13 +19,13 @@ class Rutracker(object):
|
|||||||
self.timeout = 60
|
self.timeout = 60
|
||||||
self.loggedin = False
|
self.loggedin = False
|
||||||
self.maxsize = 0
|
self.maxsize = 0
|
||||||
self.search_referer = 'http://rutracker.org/forum/tracker.php'
|
self.search_referer = 'https://rutracker.org/forum/tracker.php'
|
||||||
|
|
||||||
def logged_in(self):
|
def logged_in(self):
|
||||||
return self.loggedin
|
return self.loggedin
|
||||||
|
|
||||||
def still_logged_in(self, html):
|
def still_logged_in(self, html):
|
||||||
if not html or "action=\"http://rutracker.org/forum/login.php\">" in html:
|
if not html or "action=\"https://rutracker.org/forum/login.php\">" in html:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
@@ -35,7 +35,7 @@ class Rutracker(object):
|
|||||||
Logs in user
|
Logs in user
|
||||||
"""
|
"""
|
||||||
|
|
||||||
loginpage = 'http://rutracker.org/forum/login.php'
|
loginpage = 'https://rutracker.org/forum/login.php'
|
||||||
post_params = {
|
post_params = {
|
||||||
'login_username': headphones.CONFIG.RUTRACKER_USER,
|
'login_username': headphones.CONFIG.RUTRACKER_USER,
|
||||||
'login_password': headphones.CONFIG.RUTRACKER_PASSWORD,
|
'login_password': headphones.CONFIG.RUTRACKER_PASSWORD,
|
||||||
@@ -159,7 +159,7 @@ class Rutracker(object):
|
|||||||
# Torrent topic page
|
# Torrent topic page
|
||||||
torrent_id = dict([part.split('=') for part in urlparse(url)[4].split('&')])[
|
torrent_id = dict([part.split('=') for part in urlparse(url)[4].split('&')])[
|
||||||
't']
|
't']
|
||||||
topicurl = 'http://rutracker.org/forum/viewtopic.php?t=' + torrent_id
|
topicurl = 'https://rutracker.org/forum/viewtopic.php?t=' + torrent_id
|
||||||
rulist.append((title, size, topicurl, 'rutracker.org', 'torrent', True))
|
rulist.append((title, size, topicurl, 'rutracker.org', 'torrent', True))
|
||||||
else:
|
else:
|
||||||
logger.info("%s is larger than the maxsize or has too little seeders for this category, "
|
logger.info("%s is larger than the maxsize or has too little seeders for this category, "
|
||||||
@@ -179,7 +179,7 @@ class Rutracker(object):
|
|||||||
return the .torrent data
|
return the .torrent data
|
||||||
"""
|
"""
|
||||||
torrent_id = dict([part.split('=') for part in urlparse(url)[4].split('&')])['t']
|
torrent_id = dict([part.split('=') for part in urlparse(url)[4].split('&')])['t']
|
||||||
downloadurl = 'http://rutracker.org/forum/dl.php?t=' + torrent_id
|
downloadurl = 'https://rutracker.org/forum/dl.php?t=' + torrent_id
|
||||||
cookie = {'bb_dl': torrent_id}
|
cookie = {'bb_dl': torrent_id}
|
||||||
try:
|
try:
|
||||||
headers = {'Referer': url}
|
headers = {'Referer': url}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ from bencode import decode as bdecode
|
|||||||
|
|
||||||
# Magnet to torrent services, for Black hole. Stolen from CouchPotato.
|
# Magnet to torrent services, for Black hole. Stolen from CouchPotato.
|
||||||
TORRENT_TO_MAGNET_SERVICES = [
|
TORRENT_TO_MAGNET_SERVICES = [
|
||||||
'http://itorrents.org/torrent/%s.torrent',
|
'https://itorrents.org/torrent/%s.torrent',
|
||||||
'https://cache.torrentgalaxy.org/get/%s',
|
'https://cache.torrentgalaxy.org/get/%s',
|
||||||
'https://www.seedpeer.me/torrent/%s'
|
'https://www.seedpeer.me/torrent/%s'
|
||||||
]
|
]
|
||||||
@@ -611,7 +611,7 @@ def searchNZB(album, new=False, losslessOnly=False, albumlength=None,
|
|||||||
provider = newznab_host[0]
|
provider = newznab_host[0]
|
||||||
|
|
||||||
# Add a little mod for kere.ws
|
# Add a little mod for kere.ws
|
||||||
if newznab_host[0] == "http://kere.ws":
|
if newznab_host[0] == "https://kere.ws":
|
||||||
if categories == "3040":
|
if categories == "3040":
|
||||||
categories = categories + ",4070"
|
categories = categories + ",4070"
|
||||||
elif categories == "3040,3010":
|
elif categories == "3040,3010":
|
||||||
@@ -682,7 +682,7 @@ def searchNZB(album, new=False, losslessOnly=False, albumlength=None,
|
|||||||
}
|
}
|
||||||
|
|
||||||
data = request.request_feed(
|
data = request.request_feed(
|
||||||
url='http://beta.nzbs.org/api',
|
url='https://beta.nzbs.org/api',
|
||||||
params=params, headers=headers,
|
params=params, headers=headers,
|
||||||
timeout=5
|
timeout=5
|
||||||
)
|
)
|
||||||
@@ -731,7 +731,7 @@ def searchNZB(album, new=False, losslessOnly=False, albumlength=None,
|
|||||||
}
|
}
|
||||||
|
|
||||||
data = request.request_json(
|
data = request.request_json(
|
||||||
url='http://api.omgwtfnzbs.me/json/',
|
url='https://api.omgwtfnzbs.me/json/',
|
||||||
params=params, headers=headers
|
params=params, headers=headers
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1261,7 +1261,7 @@ def searchTorrent(album, new=False, losslessOnly=False, albumlength=None,
|
|||||||
|
|
||||||
def set_proxy(proxy_url):
|
def set_proxy(proxy_url):
|
||||||
if not proxy_url.startswith('http'):
|
if not proxy_url.startswith('http'):
|
||||||
proxy_url = 'http://' + proxy_url
|
proxy_url = 'https://' + proxy_url
|
||||||
if proxy_url.endswith('/'):
|
if proxy_url.endswith('/'):
|
||||||
proxy_url = proxy_url[:-1]
|
proxy_url = proxy_url[:-1]
|
||||||
|
|
||||||
@@ -1467,7 +1467,7 @@ def searchTorrent(album, new=False, losslessOnly=False, albumlength=None,
|
|||||||
|
|
||||||
if headphones.CONFIG.ORPHEUS:
|
if headphones.CONFIG.ORPHEUS:
|
||||||
provider = "Orpheus.network"
|
provider = "Orpheus.network"
|
||||||
providerurl = "http://orpheus.network/"
|
providerurl = "https://orpheus.network/"
|
||||||
|
|
||||||
bitrate = None
|
bitrate = None
|
||||||
bitrate_string = bitrate
|
bitrate_string = bitrate
|
||||||
|
|||||||
@@ -1677,16 +1677,16 @@ class WebInterface(object):
|
|||||||
|
|
||||||
# Return the Cover Art Archive urls if not found on last.fm
|
# Return the Cover Art Archive urls if not found on last.fm
|
||||||
if AlbumID and not image_dict:
|
if AlbumID and not image_dict:
|
||||||
image_url = "http://coverartarchive.org/release/%s/front-500.jpg" % AlbumID
|
image_url = "https://coverartarchive.org/release/%s/front-500.jpg" % AlbumID
|
||||||
thumb_url = "http://coverartarchive.org/release/%s/front-250.jpg" % AlbumID
|
thumb_url = "https://coverartarchive.org/release/%s/front-250.jpg" % AlbumID
|
||||||
image_dict = {'artwork': image_url, 'thumbnail': thumb_url}
|
image_dict = {'artwork': image_url, 'thumbnail': thumb_url}
|
||||||
elif AlbumID and (not image_dict['artwork'] or not image_dict['thumbnail']):
|
elif AlbumID and (not image_dict['artwork'] or not image_dict['thumbnail']):
|
||||||
if not image_dict['artwork']:
|
if not image_dict['artwork']:
|
||||||
image_dict[
|
image_dict[
|
||||||
'artwork'] = "http://coverartarchive.org/release/%s/front-500.jpg" % AlbumID
|
'artwork'] = "https://coverartarchive.org/release/%s/front-500.jpg" % AlbumID
|
||||||
if not image_dict['thumbnail']:
|
if not image_dict['thumbnail']:
|
||||||
image_dict[
|
image_dict[
|
||||||
'thumbnail'] = "http://coverartarchive.org/release/%s/front-250.jpg" % AlbumID
|
'thumbnail'] = "https://coverartarchive.org/release/%s/front-250.jpg" % AlbumID
|
||||||
|
|
||||||
return image_dict
|
return image_dict
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user