<commit_before><?php
function resolve_external_url($url) {
	if (substr($url, 0, 10) == 'jamendo://') {
		return process_jamendo_url($url);
	}

	return $url;
}

function process_jamendo_url($url) {
	if (substr($url, 10, 13) == 'track/stream/') {
		$id = substr($url, 23);
		return 'http://api.jamendo.com/get2/stream/track/redirect/?id=' . $id . '&streamencoding=ogg2';
	}

	if (substr($url, 10, 15) == 'album/download/') {
		$id = substr($url, 25);
		return 'http://api.jamendo.com/get2/bittorrent/file/plain/?album_id=' . $id . '&type=archive&class=ogg3';
	}

	if (substr($url, 10, 10) == 'album/art/') {
		$id = substr($url, 20);
		return 'http://api.jamendo.com/get2/image/album/redirect/?id=' . $id . '&imagesize=200';
	}

	// We don't know what this is
	return $url;
}
<commit_msg>Switch to using Eimann's mirror to resolve jamendo track ids, due to jamendo downtime.<commit_after><?php
function resolve_external_url($url) {
	if (substr($url, 0, 10) == 'jamendo://') {
		return process_jamendo_url($url);
	}

	return $url;
}

function process_jamendo_url($url) {
	if (substr($url, 10, 13) == 'track/stream/') {
		$id = substr($url, 23);
		return 'http://gigue.rrbone.net/' . $id . '.ogg2';
	}

	if (substr($url, 10, 15) == 'album/download/') {
		$id = substr($url, 25);
		return 'http://api.jamendo.com/get2/bittorrent/file/plain/?album_id=' . $id . '&type=archive&class=ogg3';
	}

	if (substr($url, 10, 10) == 'album/art/') {
		$id = substr($url, 20);
		return 'http://api.jamendo.com/get2/image/album/redirect/?id=' . $id . '&imagesize=200';
	}

	// We don't know what this is
	return $url;
}

{'fraction_non_alphanumeric': 0.2175, 'fraction_numerical': 0.035625, 'mean_word_length': 3.911042944785276, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4606673', 'n_tokens_mistral': 716, 'n_tokens_neox': 630, 'n_words': 129}