Use canonical URL

This commit is contained in:
M66B 2020-12-10 22:10:18 +01:00
parent 6daad8ed45
commit 31f4985bee
1 changed files with 8 additions and 0 deletions

View File

@ -477,6 +477,14 @@ public class ContactInfo {
Document doc = JsoupEx.parse(response);
// <link rel="canonical" href="" />
Element canonical = doc.head().select("link[rel=canonical]").first();
if (canonical != null) {
String href = canonical.attr("href");
if (!TextUtils.isEmpty(href))
base = new URL(href);
}
List<Future<Bitmap>> futures = new ArrayList<>();
for (Element link : doc.head().select("link[href~=.*\\.(ico|png|gif|svg)]")) {