ElegantSolutions commited on
Commit
2320627
·
verified ·
1 Parent(s): eb340f9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -21
app.py CHANGED
@@ -142,27 +142,27 @@ if uploaded_file and api_key:
142
  with open(output_file, "rb") as f:
143
  csv_bytes = f.read()
144
 
145
- b64 = base64.b64encode(csv_bytes).decode()
146
- href = f'<a href="data:text/csv;base64,{b64}" download="updated_with_linkedin_links.csv" id="auto-download-link"></a>'
 
 
 
 
 
 
 
 
 
 
147
 
148
- st.markdown(href, unsafe_allow_html=True)
149
- st.markdown(
150
- """
151
- <script>
152
- document.getElementById('auto-download-link').click();
153
- </script>
154
- """,
155
- unsafe_allow_html=True
156
- )
157
-
158
- st.success("✅ Processing complete. Your file is downloading automatically! Or click below if it didn't start.")
159
- # st.success("✅ Processing complete. Download the updated file below.")
160
- st.download_button(
161
- label="📥 Download CSV with LinkedIn Links",
162
- data=f,
163
- file_name="updated_with_linkedin_links.csv",
164
- mime="text/csv"
165
- )
166
- shutil.rmtree(os.path.dirname(output_file)) # Cleanup temp directory
167
  elif not api_key:
168
  st.warning("⚠️ Please enter your BrightData SERP API key to proceed.")
 
142
  with open(output_file, "rb") as f:
143
  csv_bytes = f.read()
144
 
145
+ b64 = base64.b64encode(csv_bytes).decode()
146
+ href = f'<a href="data:text/csv;base64,{b64}" download="updated_with_linkedin_links.csv" id="auto-download-link"></a>'
147
+
148
+ st.markdown(href, unsafe_allow_html=True)
149
+ st.markdown(
150
+ """
151
+ <script>
152
+ document.getElementById('auto-download-link').click();
153
+ </script>
154
+ """,
155
+ unsafe_allow_html=True
156
+ )
157
 
158
+ st.success("✅ Processing complete. Your file is downloading automatically! Or click below if it didn't start.")
159
+ # st.success("✅ Processing complete. Download the updated file below.")
160
+ st.download_button(
161
+ label="📥 Download CSV with LinkedIn Links",
162
+ data=f,
163
+ file_name="updated_with_linkedin_links.csv",
164
+ mime="text/csv"
165
+ )
166
+ shutil.rmtree(os.path.dirname(output_file)) # Cleanup temp directory
 
 
 
 
 
 
 
 
 
 
167
  elif not api_key:
168
  st.warning("⚠️ Please enter your BrightData SERP API key to proceed.")