STRM files for Movies and TV on local

So i get it strm for remote files but how can u make it work for local dir as well. It seems to scan in alot quicker when its a strm vs the file it self. Am i missing something? I put the files in the Import folder and works and imports, just can not play the strm file that i have it map to a local drive. * linux

If your files are local, you need to be scanning them in as local files.

STRM files don’t work with local file URLs.

The reason it’s faster is because STRM files aren’t indexed for streaming optimizations like actual files are. Obviously because they can’t be.

so what makes it any difference in making strm for apps like emby. I make them for the gdrives to keep the api hits down and play just fine.? just asking

import os
import shutil
from tqdm import tqdm

input_directory = r"/mnt/xxx/Media"  # Replace with the input directory containing the video files
output_directory = r"/mnt/Media"  # Replace with the output directory to save the .strm files

# Recursively copy the directory structure of the input directory to the output directory
for root, dirs, files in tqdm(os.walk(input_directory), desc="Processing files", unit="file"):
    # Create the corresponding directory in the output directory
    relative_path = os.path.relpath(root, input_directory)
    output_path = os.path.join(output_directory, relative_path)
    if not os.path.exists(output_path):
        os.makedirs(output_path)
    # Create .strm files for video files in the input directory
    for file in files:
        # Check if the file is a video file with a supported extension
        if file.endswith(('.mkv', '.mp4', '.avi', '.mov', '.wmv')):
            # Create the .strm file with the same name as the video file in the corresponding output directory
            strm_file_name = os.path.splitext(file)[0] + ".strm"
            strm_file_path = os.path.join(output_path, strm_file_name)
            video_file_path = os.path.join(root, file)
            if not os.path.exists(strm_file_path):
                try:
                    with open(strm_file_path, "w", encoding="utf-8") as f:
                        f.write(video_file_path)
                except FileNotFoundError:
                    print(f"Error: The file or directory {strm_file_path} does not exist.")
            else:
                print(f"Skipping existing file: {strm_file_path}")

Channels uses the URL in the strm file and plays it directly from the client. It can't resolve and playback file URLs.

ok np.. future development?

No, there's no plans to support file URLs in STRM files. They are designed for offsite assets, not local ones.

Again, if your files are local, import them normally. You will get a much better experience this way as Channels will have more information about the files.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.