@danhachuel/thunderbolt 0.6.26 → 0.6.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/main.py +1 -1
- package/integrations/instagram_public.py +17 -16
- package/package.json +1 -1
package/app/main.py
CHANGED
|
@@ -1721,7 +1721,7 @@ def render_growth_youtube():
|
|
|
1721
1721
|
|
|
1722
1722
|
def render_dashboard():
|
|
1723
1723
|
ui_language = current_ui_language()
|
|
1724
|
-
st.title("Thunderbolt")
|
|
1724
|
+
st.title("Thunderbolt Dashboard")
|
|
1725
1725
|
st.caption(ui_text("Interface local para operação e automação de conteúdo faceless", ui_language))
|
|
1726
1726
|
summary = pipeline_summary()
|
|
1727
1727
|
active_note = f'{summary["active_channels"]} {ui_text("activos", ui_language)}'
|
|
@@ -111,6 +111,23 @@ def _fetch_web_profile_user(username: str) -> dict[str, Any] | None:
|
|
|
111
111
|
f'https://www.instagram.com/api/v1/users/web_profile_info/?username={username}',
|
|
112
112
|
f'https://i.instagram.com/api/v1/users/web_profile_info/?username={username}',
|
|
113
113
|
)
|
|
114
|
+
curl = shutil.which('curl')
|
|
115
|
+
if curl:
|
|
116
|
+
for endpoint in endpoints:
|
|
117
|
+
try:
|
|
118
|
+
completed = subprocess.run(
|
|
119
|
+
[curl, '-L', '--max-time', '20', '-sS', '-A', headers['User-Agent'], '-H', f"x-ig-app-id: {headers['x-ig-app-id']}", '-H', 'Accept: application/json, text/plain, */*', endpoint],
|
|
120
|
+
capture_output=True,
|
|
121
|
+
text=True,
|
|
122
|
+
timeout=25,
|
|
123
|
+
check=False,
|
|
124
|
+
)
|
|
125
|
+
payload = json.loads(completed.stdout) if completed.returncode == 0 and completed.stdout else None
|
|
126
|
+
user = ((payload.get('data') or {}).get('user') if isinstance(payload, dict) else None)
|
|
127
|
+
if isinstance(user, dict):
|
|
128
|
+
return user
|
|
129
|
+
except (OSError, subprocess.SubprocessError, ValueError):
|
|
130
|
+
continue
|
|
114
131
|
for endpoint in endpoints:
|
|
115
132
|
try:
|
|
116
133
|
response = requests.get(endpoint, headers=headers, timeout=15)
|
|
@@ -122,22 +139,6 @@ def _fetch_web_profile_user(username: str) -> dict[str, Any] | None:
|
|
|
122
139
|
user = ((payload.get('data') or {}).get('user') if isinstance(payload, dict) else None)
|
|
123
140
|
if isinstance(user, dict):
|
|
124
141
|
return user
|
|
125
|
-
curl = shutil.which('curl')
|
|
126
|
-
if curl:
|
|
127
|
-
try:
|
|
128
|
-
completed = subprocess.run(
|
|
129
|
-
[curl, '-L', '--max-time', '20', '-sS', '-A', headers['User-Agent'], '-H', f"x-ig-app-id: {headers['x-ig-app-id']}", endpoint],
|
|
130
|
-
capture_output=True,
|
|
131
|
-
text=True,
|
|
132
|
-
timeout=25,
|
|
133
|
-
check=False,
|
|
134
|
-
)
|
|
135
|
-
payload = json.loads(completed.stdout) if completed.returncode == 0 and completed.stdout else None
|
|
136
|
-
user = ((payload.get('data') or {}).get('user') if isinstance(payload, dict) else None)
|
|
137
|
-
if isinstance(user, dict):
|
|
138
|
-
return user
|
|
139
|
-
except (OSError, subprocess.SubprocessError, ValueError):
|
|
140
|
-
pass
|
|
141
142
|
return None
|
|
142
143
|
|
|
143
144
|
|
package/package.json
CHANGED