Skip to content

Add download of embed PDF attachment#61

Open
JellyKuo wants to merge 3 commits intoFallingLights:mainfrom
JellyKuo:feature/download_pdf_embed
Open

Add download of embed PDF attachment#61
JellyKuo wants to merge 3 commits intoFallingLights:mainfrom
JellyKuo:feature/download_pdf_embed

Conversation

@JellyKuo
Copy link
Copy Markdown

@JellyKuo JellyKuo commented Jul 22, 2025

Teachable courses could contain PDF with class lecture-attachment-type-pdf_embed
This PR searches for PDF embeds with download link, and triggers download with WebDriver + file polling.

Additionally, the file polling download logic previously in download_video_file is moved out to a separate function webdriver_download. The new function accepts these parameters:

  • output_path: The path to which the download file is emitted. This is passed to CDP command Page.setDownloadBehavior.downloadPath
  • trigger_download: A lambda function to actually trigger the download. Eg. lambda: element.click()
  • timeout = -1: Optional timeout for file polling as there is no method to retrieve the download progress. Default is -1 (No timeout).

This should close #38. But I'm not sure about MP3 attachments as I do not have courses that use this. This PR should address PDFs though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Download of attachments (PDF, MP3)

1 participant