mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
skills/video-quote-finder: strip URL fragments before adding timestamp
This commit is contained in:
committed by
Peter Steinberger
parent
61726a2fbd
commit
e2f28ff4cb
@@ -19,8 +19,9 @@ def ts_to_seconds(ts: str) -> int:
|
|||||||
|
|
||||||
def with_timestamp_url(url: str, ts: str) -> str:
|
def with_timestamp_url(url: str, ts: str) -> str:
|
||||||
sec = ts_to_seconds(ts)
|
sec = ts_to_seconds(ts)
|
||||||
joiner = '&' if '?' in url else '?'
|
base_url = url.split('#', 1)[0] # drop fragment so query params are honored
|
||||||
return f"{url}{joiner}t={sec}s"
|
joiner = '&' if '?' in base_url else '?'
|
||||||
|
return f"{base_url}{joiner}t={sec}s"
|
||||||
|
|
||||||
|
|
||||||
def run_extract(url: str) -> str:
|
def run_extract(url: str) -> str:
|
||||||
|
|||||||
Reference in New Issue
Block a user