aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/facebook
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/facebook')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/facebook/FbCookie.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/Images.kt8
2 files changed, 7 insertions, 3 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbCookie.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbCookie.kt
index 1a714374..ab041adc 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbCookie.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbCookie.kt
@@ -60,7 +60,7 @@ class FbCookie @Inject internal constructor(
* Note that this is a synchronized call
*/
val webCookie: String?
- get() = CookieManager.getInstance().getCookie(FB_COOKIE_DOMAIN)
+ get() = CookieManager.getInstance().getCookie(HTTPS_FACEBOOK_COM)
val messengerCookie: String?
get() = CookieManager.getInstance().getCookie(HTTPS_MESSENGER_COM)
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/Images.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/Images.kt
index 70f911a8..37f8fab3 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/Images.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/Images.kt
@@ -31,12 +31,15 @@ import kotlinx.coroutines.withTimeout
/**
* Attempts to get the fbcdn url of the supplied image redirect url
*/
-suspend fun String.getFullSizedImageUrl(url: String, timeout: Long = 3000): String? =
- withContext(Dispatchers.IO) {
+suspend fun String.getFullSizedImageUrl(url: String, timeout: Long = 3000): String? {
+ L.v { "Image full size 1 from $url" }
+ return withContext(Dispatchers.IO) {
try {
withTimeout(timeout) {
+ L.v { "Image full size from $url" }
val redirect = requestBuilder().url(url).get().call()
.execute().body?.string() ?: return@withTimeout null
+ L.v { "Image full size from redirect $redirect" }
FB_REDIRECT_URL_MATCHER.find(redirect)[1]?.formattedFbUrl
}
} catch (e: Exception) {
@@ -44,3 +47,4 @@ suspend fun String.getFullSizedImageUrl(url: String, timeout: Long = 3000): Stri
null
}
}
+}