[Issue]: Special character [:] in OTA program guide title causes invalid path/file name error. #5637

Closed
opened 2026-02-07 02:02:06 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @chibiconsulting on GitHub (Apr 26, 2024).

Please describe your bug

OTA TV show names than include the [:] colon character cause recordings to fail on Samba file systems & probably other file systems as well with System.IO.IOException: Invalid argument.

Some recent examples include:
Law & Order: Organized Crime
Law & Order: Special Victims Unit
NCIS: Hawai'i
RFDS: Royal Flying Doctor Service

A quick web search on Samba invalid characters shows all of these problematic characters that should be removed from file paths and names in Samba file systems.
: colon
< less than
> greater than
“ double quote
/ forward slash
\ backslash
| vertical bar or pipe
? question mark
* asterisk

Additionally, these special characters are also listed as bad for Samba, but, do seem to work in show names. It is still possible these could cause issues elsewhere.
‘ single quote or apostrophe
! exclamation mark

I was not able to test all of these other characters with OTA shows; however, if any of these are present in a title, it would be possible to have failures.

A quick look at the code in Jellyfin-master/Emby.Naming/TV indicates that there are several parsers that seem to be dealing with handling naming of TV shows being recorded; (EpisodePathParser.cs, SeasonPathParser.cs, & SeriesPathParser.cs) and there is a section in each which already seems to deal with removing some special characters. Perhaps this could be a starting point to address these invalid characters.

Specifically:
EpisodePathParser.cs, Line 87
.Trim('_', '.', '-')
SeasonPathParser.cs, Line 111:
var parts = filename.Split(new[] { '.', '_', ' ', '-' }, StringSplitOptions.RemoveEmptyEntries);
SeriesPathParser.cs, Line 35:
result.SeriesName = result.SeriesName.Trim(' ', '_', '.', '-');

Reproduction Steps

Initiate an OTA recording either by schedule or while watching the channel for a show name that includes the [:] colon character and the recording will fail with a System.IO.IOException: Invalid argument.

Jellyfin Version

10.8.13

if other:

No response

Environment

- OS:  Ubuntu 22.04.4 LTS
- Linux Kernel: Linux 6.5.0-28-generic
- Virtualization: None
- Clients: N/A
- Browser: Any
- FFmpeg Version:  N/A
- Playback Method: N/A
- Hardware Acceleration: N/A
- GPU Model: N/A
- Plugins: N/A
- Reverse Proxy: N/A
- Base URL: N/A
- Networking: N/A
- Storage: Samba share

Jellyfin logs

[ERR] Error recording to "/sambashare/Recordings/Law & Order: Organized Crime/Law & Order: Organized Crime 2024_04_25_22_00_00 - The Last Supper.ts"
System.IO.IOException: Invalid argument : '/sambashare/Recordings/Law & Order: Organized Crime'
   at System.IO.FileSystem.CreateDirectory(String fullPath)
   at System.IO.Directory.CreateDirectory(String path)
   at Emby.Server.Implementations.LiveTv.EmbyTV.DirectRecorder.RecordFromDirectStreamProvider(IDirectStreamProvider directStreamProvider, String targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken)
   at Emby.Server.Implementations.LiveTv.EmbyTV.EmbyTV.RecordStream(TimerInfo timer, DateTime recordingEndDate, ActiveRecordingInfo activeRecordingInfo)
[ERR] Error recording to "/sambashare/Recordings/Law & Order: Special Victims Unit/Law & Order: Special Victims Unit 2024_04_25_21_00_00 - Duty to Report.ts"
System.IO.IOException: Invalid argument : '/sambashare/Recordings/Law & Order: Special Victims Unit'
   at System.IO.FileSystem.CreateDirectory(String fullPath)
   at System.IO.Directory.CreateDirectory(String path)
   at Emby.Server.Implementations.LiveTv.EmbyTV.DirectRecorder.RecordFromDirectStreamProvider(IDirectStreamProvider directStreamProvider, String targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken)
   at Emby.Server.Implementations.LiveTv.EmbyTV.EmbyTV.RecordStream(TimerInfo timer, DateTime recordingEndDate, ActiveRecordingInfo activeRecordingInfo)
[ERR] Error recording to "/sambashare/Recordings/NCIS: Hawai'i/Season 3/NCIS: Hawai'i S03E05 Serve and Protect.ts"
System.IO.IOException: Invalid argument : '/sambashare/Recordings/NCIS: Hawai'i/Season 3'
at System.IO.FileSystem.CreateDirectory(String fullPath)
at System.IO.Directory.CreateDirectory(String path)
at Emby.Server.Implementations.LiveTv.EmbyTV.DirectRecorder.RecordFromDirectStreamProvider(IDirectStreamProvider directStreamProvider, String targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken)
at Emby.Server.Implementations.LiveTv.EmbyTV.EmbyTV.RecordStream(TimerInfo timer, DateTime recordingEndDate, ActiveRecordingInfo activeRecordingInfo)

[ERR] Error recording to "/sambashare/Recordings/RFDS: Royal Flying Doctor Service/Season 2/RFDS: Royal Flying Doctor Service S02E03.ts"
System.IO.IOException: Invalid argument : '/sambashare/Recordings/RFDS: Royal Flying Doctor Service/Season 2'
   at System.IO.FileSystem.CreateDirectory(String fullPath)
   at System.IO.Directory.CreateDirectory(String path)
   at Emby.Server.Implementations.LiveTv.EmbyTV.DirectRecorder.RecordFromDirectStreamProvider(IDirectStreamProvider directStreamProvider, String targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken)
   at Emby.Server.Implementations.LiveTv.EmbyTV.EmbyTV.RecordStream(TimerInfo timer, DateTime recordingEndDate, ActiveRecordingInfo activeRecordingInfo)

FFmpeg logs

N/A

Please attach any browser or client logs here

N/A

Please attach any screenshots here

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
Originally created by @chibiconsulting on GitHub (Apr 26, 2024). ### Please describe your bug OTA TV show names than include the [:] colon character cause recordings to fail on Samba file systems & probably other file systems as well with System.IO.IOException: Invalid argument. Some recent examples include: Law & Order: Organized Crime Law & Order: Special Victims Unit NCIS: Hawai'i RFDS: Royal Flying Doctor Service A quick web search on Samba invalid characters shows all of these problematic characters that should be removed from file paths and names in Samba file systems. : colon < less than > greater than “ double quote / forward slash \ backslash | vertical bar or pipe ? question mark * asterisk Additionally, these special characters are also listed as bad for Samba, but, do seem to work in show names. It is still possible these could cause issues elsewhere. ‘ single quote or apostrophe ! exclamation mark I was not able to test all of these other characters with OTA shows; however, if any of these are present in a title, it would be possible to have failures. A quick look at the code in Jellyfin-master/Emby.Naming/TV indicates that there are several parsers that seem to be dealing with handling naming of TV shows being recorded; (EpisodePathParser.cs, SeasonPathParser.cs, & SeriesPathParser.cs) and there is a section in each which already seems to deal with removing some special characters. Perhaps this could be a starting point to address these invalid characters. Specifically: EpisodePathParser.cs, Line 87 `.Trim('_', '.', '-')` SeasonPathParser.cs, Line 111: `var parts = filename.Split(new[] { '.', '_', ' ', '-' }, StringSplitOptions.RemoveEmptyEntries);` SeriesPathParser.cs, Line 35: `result.SeriesName = result.SeriesName.Trim(' ', '_', '.', '-');` ### Reproduction Steps Initiate an OTA recording either by schedule or while watching the channel for a show name that includes the [:] colon character and the recording will fail with a System.IO.IOException: Invalid argument. ### Jellyfin Version 10.8.13 ### if other: _No response_ ### Environment ```markdown - OS: Ubuntu 22.04.4 LTS - Linux Kernel: Linux 6.5.0-28-generic - Virtualization: None - Clients: N/A - Browser: Any - FFmpeg Version: N/A - Playback Method: N/A - Hardware Acceleration: N/A - GPU Model: N/A - Plugins: N/A - Reverse Proxy: N/A - Base URL: N/A - Networking: N/A - Storage: Samba share ``` ### Jellyfin logs ```shell [ERR] Error recording to "/sambashare/Recordings/Law & Order: Organized Crime/Law & Order: Organized Crime 2024_04_25_22_00_00 - The Last Supper.ts" System.IO.IOException: Invalid argument : '/sambashare/Recordings/Law & Order: Organized Crime' at System.IO.FileSystem.CreateDirectory(String fullPath) at System.IO.Directory.CreateDirectory(String path) at Emby.Server.Implementations.LiveTv.EmbyTV.DirectRecorder.RecordFromDirectStreamProvider(IDirectStreamProvider directStreamProvider, String targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken) at Emby.Server.Implementations.LiveTv.EmbyTV.EmbyTV.RecordStream(TimerInfo timer, DateTime recordingEndDate, ActiveRecordingInfo activeRecordingInfo) [ERR] Error recording to "/sambashare/Recordings/Law & Order: Special Victims Unit/Law & Order: Special Victims Unit 2024_04_25_21_00_00 - Duty to Report.ts" System.IO.IOException: Invalid argument : '/sambashare/Recordings/Law & Order: Special Victims Unit' at System.IO.FileSystem.CreateDirectory(String fullPath) at System.IO.Directory.CreateDirectory(String path) at Emby.Server.Implementations.LiveTv.EmbyTV.DirectRecorder.RecordFromDirectStreamProvider(IDirectStreamProvider directStreamProvider, String targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken) at Emby.Server.Implementations.LiveTv.EmbyTV.EmbyTV.RecordStream(TimerInfo timer, DateTime recordingEndDate, ActiveRecordingInfo activeRecordingInfo) [ERR] Error recording to "/sambashare/Recordings/NCIS: Hawai'i/Season 3/NCIS: Hawai'i S03E05 Serve and Protect.ts" System.IO.IOException: Invalid argument : '/sambashare/Recordings/NCIS: Hawai'i/Season 3' at System.IO.FileSystem.CreateDirectory(String fullPath) at System.IO.Directory.CreateDirectory(String path) at Emby.Server.Implementations.LiveTv.EmbyTV.DirectRecorder.RecordFromDirectStreamProvider(IDirectStreamProvider directStreamProvider, String targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken) at Emby.Server.Implementations.LiveTv.EmbyTV.EmbyTV.RecordStream(TimerInfo timer, DateTime recordingEndDate, ActiveRecordingInfo activeRecordingInfo) [ERR] Error recording to "/sambashare/Recordings/RFDS: Royal Flying Doctor Service/Season 2/RFDS: Royal Flying Doctor Service S02E03.ts" System.IO.IOException: Invalid argument : '/sambashare/Recordings/RFDS: Royal Flying Doctor Service/Season 2' at System.IO.FileSystem.CreateDirectory(String fullPath) at System.IO.Directory.CreateDirectory(String path) at Emby.Server.Implementations.LiveTv.EmbyTV.DirectRecorder.RecordFromDirectStreamProvider(IDirectStreamProvider directStreamProvider, String targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken) at Emby.Server.Implementations.LiveTv.EmbyTV.EmbyTV.RecordStream(TimerInfo timer, DateTime recordingEndDate, ActiveRecordingInfo activeRecordingInfo) ``` ### FFmpeg logs ```shell N/A ``` ### Please attach any browser or client logs here N/A ### Please attach any screenshots here _No response_ ### Code of Conduct - [X] I agree to follow this project's Code of Conduct
OVERLORD added the buglive-tv labels 2026-02-07 02:02:06 +03:00
Author
Owner

@jellyfin-bot commented on GitHub (Apr 26, 2024):

Hi, it seems like your issue report has the following item(s) that need to be addressed:

  • You have not provided the ffmpeg log unaltered from the server. Please provide a valid ffmpeg log.

This is an automated message, currently under testing. Please file an issue here if you encounter any problems.

@jellyfin-bot commented on GitHub (Apr 26, 2024): Hi, it seems like your issue report has the following item(s) that need to be addressed: - You have not provided the ffmpeg log unaltered from the server. Please provide a valid ffmpeg log. This is an automated message, currently under testing. Please file an issue [here](https://github.com/jellyfin/jellyfin-triage-scripts/issues) if you encounter any problems.
Author
Owner

@chibiconsulting commented on GitHub (Apr 30, 2024):

Here are the changes proposed:

EpisodePathParser.cs, Line 87
.Trim('_', '.', '-', ':', '<', '>', '|', '?', '*')
SeasonPathParser.cs, Line 111:
var parts = filename.Split(new[] { '.', '_', ' ', '-', ':', '<', '>', '|', '?', '*' }, StringSplitOptions.RemoveEmptyEntries);
SeriesPathParser.cs, Line 35:
result.SeriesName = result.SeriesName.Trim(' ', '_', '.', '-', ':', '<', '>', '|', '?', '*');
Issue11442.tar.gz

@chibiconsulting commented on GitHub (Apr 30, 2024): Here are the changes proposed: EpisodePathParser.cs, Line 87 `.Trim('_', '.', '-', ':', '<', '>', '|', '?', '*')` SeasonPathParser.cs, Line 111: `var parts = filename.Split(new[] { '.', '_', ' ', '-', ':', '<', '>', '|', '?', '*' }, StringSplitOptions.RemoveEmptyEntries);` SeriesPathParser.cs, Line 35: `result.SeriesName = result.SeriesName.Trim(' ', '_', '.', '-', ':', '<', '>', '|', '?', '*');` [Issue11442.tar.gz](https://github.com/jellyfin/jellyfin/files/15167259/Issue11442.tar.gz)
Author
Owner

@jellyfin-bot commented on GitHub (Aug 29, 2024):

This issue has gone 120 days without an update and will be closed within 21 days if there is no new activity. To prevent this issue from being closed, please confirm the issue has not already been fixed by providing updated examples or logs.

If you have any questions you can use one of several ways to contact us.

@jellyfin-bot commented on GitHub (Aug 29, 2024): This issue has gone 120 days without an update and will be closed within 21 days if there is no new activity. To prevent this issue from being closed, please confirm the issue has not already been fixed by providing updated examples or logs. If you have any questions you can use one of several ways to [contact us](https://jellyfin.org/contact).
Author
Owner

@felix920506 commented on GitHub (Sep 2, 2024):

If you already have an idea on how to fix it, please just open a PR.

@felix920506 commented on GitHub (Sep 2, 2024): If you already have an idea on how to fix it, please just open a PR.
Author
Owner

@chibiconsulting commented on GitHub (Dec 18, 2024):

After testing with several Linux native format drives, it appears to only affect SAMBA shares so I have moved away from using SAMBA.

If anyone requires titles that do not work with SAMBA, the best work around would be to use XML to import the TV schedules and while processing the schedule in XML, remove any offending characters in titles that affect you.

For example, this simply removes the ":" character.
sed -i 's/NCIS:/NCIS/g' ota.xml
sed -i 's/Order:/Order/g' ota.xml

@chibiconsulting commented on GitHub (Dec 18, 2024): After testing with several Linux native format drives, it appears to only affect SAMBA shares so I have moved away from using SAMBA. If anyone requires titles that do not work with SAMBA, the best work around would be to use XML to import the TV schedules and while processing the schedule in XML, remove any offending characters in titles that affect you. For example, this simply removes the ":" character. sed -i 's/NCIS:/NCIS/g' ota.xml sed -i 's/Order:/Order/g' ota.xml
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#5637