It's being replace with Javascript.
/themes/default/assets/js/main.min.js
Code:
$(".good-res").length && ($(".dl_links").data("width") >= screen.width && $(".dl_links").data("height") >= screen.height ? $(".good-res").each(function(t, e) {
$(e).attr("href", $(e).attr("href").replace("{R_WIDTH}", screen.width).replace("{R_HEIGHT}", screen.height)).removeClass("hide")
}) : ($(".dl_links").remove(), $(".dl_links_error").removeClass("hide"))), $(".wpd").on("click", function() {
noty({
text: $(this).data("msg"),
type: "success"
})
})
You need to modify your build_link so that it dosen't add {R_WIDTH}x{R_HEIGHT} and later on append the URL with javascript instead of replacing it.