ElegantSolutions commited on
Commit
c464196
·
verified ·
1 Parent(s): 493967f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -19
app.py CHANGED
@@ -184,26 +184,12 @@ if uploaded_file and api_key:
184
  with open(output_file, "rb") as f:
185
  csv_bytes = f.read()
186
 
187
- b64 = base64.b64encode(csv_bytes).decode()
188
- href = f'<a href="data:text/csv;base64,{b64}" download="updated_with_linkedin_links.csv" id="auto-download-link"></a>'
189
-
190
- st.markdown(href, unsafe_allow_html=True)
191
- st.markdown(
192
- """
193
- <script>
194
- document.getElementById('auto-download-link').click();
195
- </script>
196
- """,
197
- unsafe_allow_html=True
198
  )
199
 
200
- st.success("✅ Processing complete. Your file is downloading automatically! Or click below if it didn't start.")
201
- st.download_button(
202
- label="📥 Download CSV with LinkedIn Links",
203
- data=f,
204
- file_name="updated_with_linkedin_links.csv",
205
- mime="text/csv"
206
- )
207
- shutil.rmtree(os.path.dirname(output_file)) # Cleanup temp directory
208
  elif not api_key:
209
  st.warning("⚠️ Please enter your BrightData SERP API key to proceed.")
 
184
  with open(output_file, "rb") as f:
185
  csv_bytes = f.read()
186
 
187
+ zip_and_auto_download(
188
+ file_bytes=csv_bytes,
189
+ inner_filename="updated_with_linkedin_links.csv",
190
+ zip_prefix="LinkedIn_Links"
 
 
 
 
 
 
 
191
  )
192
 
193
+ shutil.rmtree(os.path.dirname(output_file))
 
 
 
 
 
 
 
194
  elif not api_key:
195
  st.warning("⚠️ Please enter your BrightData SERP API key to proceed.")