Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes pdfs not found if .pdf is not present #29

Merged
merged 16 commits into from
May 17, 2024
Merged

Fixes pdfs not found if .pdf is not present #29

merged 16 commits into from
May 17, 2024

Conversation

nickscamara
Copy link
Member

Pdfs that don't include the .pdf at the end of the url are not picked up by the extractor. This method uses 2 ways to check it:

  1. The url first, that way is fast. If it doesn't work fallback to looking at the content type.
  2. Fetch the page and look at the content type

Bottlenecks: If there are many pages to crawl, we will fetching it multiple multiple times.

Solution for now:

  1. Lets keep this in the /scrape endpoint but not crawl for now (DONE)
  2. Bundle it with the crawling system that way it fetches only one. (Do another PR for it)

@rafaelsideguide rafaelsideguide marked this pull request as draft April 25, 2024 16:46
@rafaelsideguide rafaelsideguide self-assigned this Apr 25, 2024
@rafaelsideguide rafaelsideguide marked this pull request as ready for review April 30, 2024 14:00
@rafaelsideguide rafaelsideguide removed their request for review April 30, 2024 14:01
@rafaelsideguide
Copy link
Collaborator

@nickscamara I'm not being able to add you as a reviewer for some reason. Got a rate limit 429 testing on preview routes.

Checks if the URL is a PDF during the scraping process (single_url.ts).

TODO: Run integration tests - Does this strat affect the running time?

ps. Some comments need to be removed if we decide to proceed with this strategy.
@nickscamara nickscamara removed the wip label May 17, 2024
@nickscamara
Copy link
Member Author

All readyy!

@nickscamara nickscamara merged commit 2a1f2e3 into main May 17, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants