Created
April 24, 2025 21:40
-
-
Save gogsbread/32a79c4f1b8d92333bda46d096fba930 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 213d3c6d2460de4634157da304095d94c95d882e Mon Sep 17 00:00:00 2001 | |
From: Antony Deepak Thomas <[email protected]> | |
Date: Thu, 24 Apr 2025 14:38:46 -0700 | |
Subject: [PATCH] Obsidian OneNote Hacks for importing large sections | |
--- | |
src/formats/onenote.ts | 16 +++++++++------- | |
1 file changed, 9 insertions(+), 7 deletions(-) | |
diff --git a/src/formats/onenote.ts b/src/formats/onenote.ts | |
index 8af44ae..0d2477b 100644 | |
--- a/src/formats/onenote.ts | |
+++ b/src/formats/onenote.ts | |
@@ -380,13 +380,14 @@ export class OneNoteImporter extends FormatImporter { | |
progress.reportProgress(progressCurrent, progressTotal); | |
const baseUrl = `https://graph.microsoft.com/v1.0/me/onenote/sections/${sectionId}/pages`; | |
- const params = new URLSearchParams({ | |
- $select: 'id,title,createdDateTime,lastModifiedDateTime,level,order,contentUrl', | |
- $orderby: 'order', | |
- pagelevel: 'true' | |
- }); | |
+ // const params = new URLSearchParams({ | |
+ // $select: 'id,title,createdDateTime,lastModifiedDateTime,level,order,contentUrl', | |
+ // $orderby: 'order', | |
+ // $pagelevel: 'true' | |
+ // }); | |
- const pagesUrl = `${baseUrl}?${params.toString()}`; | |
+ // const pagesUrl = `${baseUrl}?${params.toString()}`; | |
+ const pagesUrl = `${baseUrl}`; | |
let pages: OnenotePage[] | null = null; | |
try { | |
@@ -887,7 +888,8 @@ export class OneNoteImporter extends FormatImporter { | |
// We're rate-limited - let's retry after the suggested amount of time | |
if (err.code === '20166') { | |
- let retryTime = (+!response.headers.get('Retry-After') * 1000) || 15000; | |
+ // let retryTime = (+!response.headers.get('Retry-After') * 1000) || 15000; | |
+ let retryTime = 15000; | |
console.log(`Rate limit exceeded, waiting for: ${retryTime} ms`); | |
if (retryCount < MAX_RETRY_ATTEMPTS) { | |
-- | |
2.43.0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment