habulaj commited on
Commit
95d465d
·
verified ·
1 Parent(s): eee505e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -88,9 +88,18 @@ async def get_tweet_data(tweet_id: str):
88
  except:
89
  pass
90
 
 
 
 
 
 
 
 
 
 
91
  # Combinar os dados
92
  result = {
93
- "data": metadata.get("data", {}),
94
  "fullTextHtml": fulltext_html
95
  }
96
 
 
88
  except:
89
  pass
90
 
91
+ # Processar dados
92
+ data = metadata.get("data", {})
93
+
94
+ # Remover "_normal" da URL do avatar para obter imagem em alta resolução
95
+ if "user" in data and "profile_image_url_https" in data["user"]:
96
+ avatar_url = data["user"]["profile_image_url_https"]
97
+ # Remover _normal antes da extensão (ex: _normal.jpg -> .jpg)
98
+ data["user"]["profile_image_url_https"] = avatar_url.replace("_normal.", ".")
99
+
100
  # Combinar os dados
101
  result = {
102
+ "data": data,
103
  "fullTextHtml": fulltext_html
104
  }
105