discogs importer: make it work with https

This commit is contained in:
Laurent Monin 2016-02-13 23:39:06 +01:00
parent 5e92db537a
commit e202ed54f2

View file

@ -6,10 +6,10 @@
// @namespace http://userscripts.org/users/22504
// @downloadURL https://raw.github.com/murdos/musicbrainz-userscripts/master/discogs_importer.user.js
// @updateURL https://raw.github.com/murdos/musicbrainz-userscripts/master/discogs_importer.user.js
// @include http://www.discogs.com/*
// @include http://*.discogs.com/*release/*
// @exclude http://*.discogs.com/*release/*?f=xml*
// @exclude http://www.discogs.com/release/add
// @include http*://www.discogs.com/*
// @include http*://*.discogs.com/*release/*
// @exclude http*://*.discogs.com/*release/*?f=xml*
// @exclude http*://www.discogs.com/release/add
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
// @require lib/mbimport.js
// @require lib/logger.js
@ -284,7 +284,7 @@ var link_infos = {};
// Parse discogs url to extract info, returns a key and set link_infos for this key
// the key is in the form discogs_type/discogs_id
function getDiscogsLinkKey(url) {
var re = /^http:\/\/(?:www|api)\.discogs\.com\/(?:(?:(?!sell).+|sell.+)\/)?(master|release|artist|label)s?\/(\d+)(?:[^\?#]*)(?:\?noanv=1|\?anv=[^=]+)?$/i;
var re = /^https?:\/\/(?:www|api)\.discogs\.com\/(?:(?:(?!sell).+|sell.+)\/)?(master|release|artist|label)s?\/(\d+)(?:[^\?#]*)(?:\?noanv=1|\?anv=[^=]+)?$/i;
if (m = re.exec(url)) {
var key = m[1] + '/' + m[2];
if (!link_infos[key]) {