iamtheyammer / fetch-ford-service-manuals

Downloads HTML and PDF versions of Ford Service Manuals from PTS
GNU General Public License v3.0
32 stars 12 forks source link

Filename encoding for special chars #24

Open Upgreydd opened 1 month ago

tlovenspclsauce commented 1 week ago

To add clarity to what @onlythetoast and @Upgreydd said:

Edit /src/wiring/savePage.ts

  1. Add the following on line 13. const path = require('path');
  2. Remove line 94 and replace with

    const directoryPath = path.dirname(filePath);
    const fileName = encodeURIComponent(path.basename(filePath)); // Only encode the file name
    const fullPath = `file://${directoryPath}/${fileName}`;
    await browserPage.goto(fullPath);```