some more images

This commit is contained in:
2024-12-17 10:28:33 +01:00
parent d186a51a87
commit e78bee4597
3 changed files with 80 additions and 66 deletions

View File

@@ -58,3 +58,14 @@ Future<String?> getImageUrlFromName(String title) async {
}
return await getImageUrl(pageId);
}
Future<String?> getImageUrlFromGooglePhotos(String url) async {
// this is a very simple implementation that just gets the image behind the link
// it is not guaranteed to work for all google photos links
final response = await dio.get(url);
final data = response.toString();
final int start = data.indexOf("https://lh3.googleusercontent.com");
final int end = data.indexOf('"', start);
return data.substring(start, end);
}