diff options
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt index 22fc275f..0e74bb59 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt @@ -31,7 +31,7 @@ class FbUrlFormatter(url: String) { var cleanedUrl = url discardable.forEach { cleanedUrl = cleanedUrl.replace(it, "", true) } converter.forEach { (k, v) -> cleanedUrl = cleanedUrl.replace(k, v, true) } - if (cleanedUrl != url) cleanedUrl = cleanedUrl.replaceFirst("&", "?") + if (cleanedUrl != url && !cleanedUrl.contains("?")) cleanedUrl = cleanedUrl.replaceFirst("&", "?") cleanedUrl = URLDecoder.decode(cleanedUrl, StandardCharsets.UTF_8.name()) val qm = cleanedUrl.indexOf("?") if (qm > -1) { @@ -70,6 +70,8 @@ class FbUrlFormatter(url: String) { } companion object { + + const val VIDEO_REDIRECT = "/video_redirect/?src=" /** * Items here are explicitly removed from the url * Taken from FaceSlim @@ -82,7 +84,7 @@ class FbUrlFormatter(url: String) { "https://m.facebook.com/l.php?u=", "http://touch.facebook.com/l.php?u=", "https://touch.facebook.com/l.php?u=", - "/video_redirect/?src=" + VIDEO_REDIRECT ) val misc = arrayOf("&" to "&") |