Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion skyvern/forge/sdk/api/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
from skyvern.forge.sdk.api.aws import AsyncAWSClient, aws_client
from skyvern.utils.url_validators import encode_url

_drive_file_id_re = re.compile(r"/file/d/([a-zA-Z0-9_-]+)")

LOG = structlog.get_logger()


Expand Down Expand Up @@ -58,7 +60,7 @@ def get_file_name_and_suffix_from_headers(headers: CIMultiDictProxy[str]) -> tup
def extract_google_drive_file_id(url: str) -> str | None:
"""Extract file ID from Google Drive URL."""
# Handle format: https://drive.google.com/file/d/{file_id}/view
match = re.search(r"/file/d/([a-zA-Z0-9_-]+)", url)
match = _drive_file_id_re.search(url)
if match:
return match.group(1)
return None
Expand Down