Spaces:
Sleeping
Sleeping
fix: corrige montagem e redirecionamento da URL do Facebook
Browse files
app.py
CHANGED
|
@@ -921,14 +921,17 @@ def comments():
|
|
| 921 |
total_likes = 0
|
| 922 |
for c in comments_data:
|
| 923 |
from_data = c.get("from", {})
|
| 924 |
-
# Build Facebook comment URL
|
| 925 |
-
|
| 926 |
-
|
| 927 |
-
|
| 928 |
-
if
|
| 929 |
-
|
| 930 |
-
|
| 931 |
-
|
|
|
|
|
|
|
|
|
|
| 932 |
|
| 933 |
comments.append({
|
| 934 |
"id": c["id"],
|
|
|
|
| 921 |
total_likes = 0
|
| 922 |
for c in comments_data:
|
| 923 |
from_data = c.get("from", {})
|
| 924 |
+
# Build Facebook comment URL utilizing the requested API permalink
|
| 925 |
+
fb_url = c.get("permalink_url")
|
| 926 |
+
|
| 927 |
+
# Fallback de segurança mantendo a sua lógica original
|
| 928 |
+
if not fb_url:
|
| 929 |
+
comment_full_id = c["id"]
|
| 930 |
+
parts = comment_full_id.split("_")
|
| 931 |
+
if len(parts) >= 2:
|
| 932 |
+
fb_url = f"https://www.facebook.com/{parts[0]}?comment_id={parts[1]}"
|
| 933 |
+
else:
|
| 934 |
+
fb_url = f"https://www.facebook.com/{comment_full_id}"
|
| 935 |
|
| 936 |
comments.append({
|
| 937 |
"id": c["id"],
|