Skip to content

Commit f93e9b9

Browse files
feat: update extract script for october 2025; misc fixes and robustness improvements
1 parent 76f81b5 commit f93e9b9

11 files changed

+982
-367
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,15 @@
3333
"node-id3": "^0.2.6",
3434
"openai-fetch": "^3.3.1",
3535
"p-map": "^7.0.2",
36+
"p-race": "^3.1.0",
3637
"patchright": "^1.56.1",
3738
"pdfkit": "^0.15.0",
3839
"playwright": "^1.48.0",
3940
"playwright-core": "^1.48.0",
41+
"sharp": "^0.34.4",
42+
"tar": "^7.5.1",
43+
"tempy": "^3.1.0",
44+
"type-fest": "^5.1.0",
4045
"unrealspeech-api": "^1.0.2"
4146
},
4247
"devDependencies": {

pnpm-lock.yaml

Lines changed: 408 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
onlyBuiltDependencies:
2+
- sharp

src/browserbase-experiment.ts

Lines changed: 0 additions & 99 deletions
This file was deleted.

src/export-book-audio.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ By ${authors.join(', ')}`
144144
.replaceAll('\n', '\n\n')
145145

146146
// Split the text in this chapter into paragraphs.
147-
const t = `${tocItem.title}
147+
const t = `${tocItem.label}
148148
149149
${text}`.split('\n\n')
150150

@@ -175,7 +175,7 @@ ${text}`.split('\n\n')
175175

176176
for (const [k, element] of t.entries()) {
177177
batches.push({
178-
title: k === 0 ? tocItem.title : undefined,
178+
title: k === 0 ? tocItem.label : undefined,
179179
text: element!
180180
})
181181
}

src/export-book-markdown.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ ${metadata.toc
5353
)
5454
.map(
5555
(tocItem) =>
56-
`- [${tocItem.title}](#${tocItem.title.toLowerCase().replaceAll(/[^\da-z]+/g, '-')})`
56+
`- [${tocItem.label}](#${tocItem.label.toLowerCase().replaceAll(/[^\da-z]+/g, '-')})`
5757
)
5858
.join('\n')}
5959
@@ -78,7 +78,7 @@ ${metadata.toc
7878

7979
output += `
8080
81-
## ${tocItem.title}
81+
## ${tocItem.label}
8282
8383
${text}`
8484

src/export-book-pdf.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ async function main() {
8383
const chunks = content.slice(index, nextIndex)
8484
const text = chunks.map((chunk) => chunk.text).join(' ')
8585

86-
;(doc as any).outline.addItem(tocItem.title)
86+
;(doc as any).outline.addItem(tocItem.label)
8787
doc.fontSize(20)
88-
doc.text(tocItem.title, { align: 'center', lineGap: 16 })
88+
doc.text(tocItem.label, { align: 'center', lineGap: 16 })
8989

9090
doc.fontSize(fontSize)
9191
doc.moveDown(1)

0 commit comments

Comments
 (0)