[PR #3776] [MERGED] Fix ffmpeg concat file escaping #4078

Closed
opened 2026-04-25 00:18:14 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3776
Author: @mikiher
Created: 1/2/2025
Status: Merged
Merged: 1/4/2025
Merged by: @advplyr

Base: masterHead: fix-ffmpeg-concat-file


📝 Commits (1)

  • fe2ba08 Fix ffmpeg concat file escaping

📊 Changes

1 file changed (+3 additions, -3 deletions)

View changed files

📝 server/utils/ffmpegHelpers.js (+3 -3)

📄 Description

Brief summary

This fixes an escaping issue causing UNC paths not to be read correctly in ffmpeg concat files generated by ABS

Which issue is fixed?

Fixes the re-opened audiobookshelf-windows issue #29.

In-depth Description

The issue was that the \\ chatacters in the beginning of the UNC path were not escaped in the ffmpeg concat file, and therefore the path was mangled.

Rather than escaping those, I fixed this by surrounding file paths in the concat file with single quotes (and consequently also modifying escapeSingleQuotes)

This way is safer, since now the only character that needs escaping inside a file name is a single quote, which the aptly named escapeSingleQuotes function now really does - no other characters (like spaces or backslashes) need to be escaped.

How have you tested this?

I tested with a combination of UNC paths that also contain single quotes.
I tested both codepaths that call writeConcatFile (encode m4b, and stream).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/3776 **Author:** [@mikiher](https://github.com/mikiher) **Created:** 1/2/2025 **Status:** ✅ Merged **Merged:** 1/4/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `fix-ffmpeg-concat-file` --- ### 📝 Commits (1) - [`fe2ba08`](https://github.com/advplyr/audiobookshelf/commit/fe2ba083be74de090f359c544f8e03bfe542dd34) Fix ffmpeg concat file escaping ### 📊 Changes **1 file changed** (+3 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `server/utils/ffmpegHelpers.js` (+3 -3) </details> ### 📄 Description ## Brief summary This fixes an escaping issue causing UNC paths not to be read correctly in ffmpeg concat files generated by ABS ## Which issue is fixed? Fixes the re-opened [audiobookshelf-windows issue #29](https://github.com/mikiher/audiobookshelf-windows/issues/29#issuecomment-2547238819). ## In-depth Description The issue was that the \\\\ chatacters in the beginning of the UNC path were not escaped in the ffmpeg concat file, and therefore the path was mangled. Rather than escaping those, I fixed this by surrounding file paths in the concat file with single quotes (and consequently also modifying `escapeSingleQuotes`) This way is safer, since now the only character that needs escaping inside a file name is a single quote, which the aptly named `escapeSingleQuotes` function now really does - no other characters (like spaces or backslashes) need to be escaped. ## How have you tested this? I tested with a combination of UNC paths that also contain single quotes. I tested both codepaths that call `writeConcatFile` (encode m4b, and stream). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:18:14 +02:00
adam closed this issue 2026-04-25 00:18:14 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4078