Spaces:
Sleeping
Sleeping
duck3-create Claude Opus 4.6 commited on
Commit ·
11684f2
1
Parent(s): 3eee3bb
Speed up Instagram extraction + auto-copy checked by default
Browse files- Reduce Playwright wait from 10s to early-exit (max 5s)
- Set subtitle auto-copy checkbox checked by default
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- main.py +5 -1
- static/index.html +1 -1
main.py
CHANGED
|
@@ -463,7 +463,11 @@ def _extract_ig_video_url(url):
|
|
| 463 |
|
| 464 |
page.on('response', _on_resp)
|
| 465 |
page.goto(url, wait_until='domcontentloaded', timeout=30000)
|
| 466 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 467 |
|
| 468 |
page_title = page.evaluate("""() => {
|
| 469 |
const d = document.querySelector('meta[property="og:description"]');
|
|
|
|
| 463 |
|
| 464 |
page.on('response', _on_resp)
|
| 465 |
page.goto(url, wait_until='domcontentloaded', timeout=30000)
|
| 466 |
+
# Wait up to 5s, exit early if video URL found
|
| 467 |
+
for _ in range(10):
|
| 468 |
+
page.wait_for_timeout(500)
|
| 469 |
+
if video_urls:
|
| 470 |
+
break
|
| 471 |
|
| 472 |
page_title = page.evaluate("""() => {
|
| 473 |
const d = document.querySelector('meta[property="og:description"]');
|
static/index.html
CHANGED
|
@@ -1162,7 +1162,7 @@
|
|
| 1162 |
|
| 1163 |
<div class="option-group" style="gap: 16px;">
|
| 1164 |
<label class="checkbox-wrapper">
|
| 1165 |
-
<input type="checkbox" id="autoCopy">
|
| 1166 |
<span class="checkbox-custom"></span>
|
| 1167 |
<span>Subtitle Auto Copy</span>
|
| 1168 |
</label>
|
|
|
|
| 1162 |
|
| 1163 |
<div class="option-group" style="gap: 16px;">
|
| 1164 |
<label class="checkbox-wrapper">
|
| 1165 |
+
<input type="checkbox" id="autoCopy" checked>
|
| 1166 |
<span class="checkbox-custom"></span>
|
| 1167 |
<span>Subtitle Auto Copy</span>
|
| 1168 |
</label>
|