name: pdf-source-recovery description: Extract direct PDF links from flipbooks and web viewers. version: 0.1.0 author: Hermes platforms: [linux, macos, windows] metadata: hermes: tags: [Scraping, PDF, Flipbook, DearFlip]
Extract direct PDF source URLs from embedded flipbook viewers (DearFlip, FlipHTML5, FlowPaper) and restricted web viewers. This skill uses browser inspection and terminal-based downloading to bypass hotlink protection.
terminal with curl or wget.browser_navigate and browser_console.browser_navigate.browser_console.terminal.Locate the Container:
Identify the flipbook plugin by looking for classes or IDs like df-container, flipbook, or dearflip.
Inspect JavaScript Configuration:
Many viewers (like DearFlip) store the PDF source in a global options object. Run this in browser_console:
javascript
// Check for DearFlip config objects
Object.keys(window).filter(k => k.startsWith('option_df_')).map(k => window[k].source);
Check Data Attributes:
Look for data-pdf, data-src, or data-file on the viewer element.
Verify Direct URL:
Confirm the URL ends in .pdf or returns an application/pdf Content-Type.
Download with Headers:
To bypass hotlink protection, use the Referer and a realistic User-Agent in terminal:
bash
curl -L -o output.pdf -A "Mozilla/5.0..." -H "Referer: https://source-site.com/" "https://url.com/file.pdf"
curl -C - for resumption.Run file output.pdf in terminal to confirm it is a valid PDF document.