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: 2 additions & 2 deletions backend/onyx/connectors/web/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,12 +566,12 @@ def _do_scrape(
page_text, metadata, images = read_pdf_file(
file=io.BytesIO(response.content))
last_modified = response.headers.get("Last-Modified")

title = metadata.get("Title") or metadata.get("title")
result.doc = Document(
id=initial_url,
sections=[TextSection(link=initial_url, text=page_text)],
source=DocumentSource.WEB,
semantic_identifier=initial_url.split("/")[-3 if "@@download/file" in initial_url else -1],
semantic_identifier=title or initial_url.split("/")[-3 if "@@download/file" in initial_url else -1],
metadata=metadata,
doc_updated_at=(_get_datetime_from_last_modified_header(
last_modified) if last_modified else None),
Expand Down
Loading