Transfer existing recordings form BeyonWiz T4 to Icebox - Meta data generation

Started by deanzilla, June 24, 2025, 04:32:32 PM

Previous topic - Next topic

deanzilla

I've had a look at the forum and can't find anything specific on how to generate the correct metadata for Icebox.  I see that the T4 has files such as .eit and .meta and they need to be converted to a correctly formatted .nfo.

Has anyone done this before and has scripts or programs they can share?

prl

The .meta file is a simple text file. The .eit file is a dump of the DVB-T data for the recorded program's EPG entry.

The text data in a .eit file an be extracted using simple text extraction tools like the U*ix strings program, but it might need to be edited. The text contents are UTF-8 encoded Unicode, but the IceTV feed mangles most non-ASCII Unicode characters, and that's reflected in .eit files made from the IceTV EPG, and strings and the like might mangle them further.

For example:
root@beyonwizt4:/media/hdd/movie# strings '20180121 1705 - WIN Canberra - Ten News.eit'
eng
Ten News
Ten's headline news broadcast presents all the news that's fit to print, or rather see, of what's happening in the world with an emphasis on social issues, sports events and entertainment industry gossip.
root@beyonwizt4:/media/hdd/movie#


There's an outline of the Beyonwiz recording files' contents here:
https://bitbucket.org/beyonwiz/easy-ui-4/src/master/doc/FILEFORMAT

It has a line-by-line description of the contents of the .meta file, including the difficult-to-guess units for the recording length entry.
Peter
Beyonwiz T4 in-use
Beyonwiz T2, T3, T4, U4 & V2 for testing

deanzilla

Ok, after a bit of work, here is my Python script (that will run on the BeyonWiz T4) to create the .NFO prior to importing them into the new ICEBOX.

Enable SSH on the BeyonWiz, give it a password.

"ssh root@IP_ADDRESS"

Create a local script called "meta2nfo.py"

"vi meta2nfo.py"

Copy this into the editor:

import os
import xml.etree.ElementTree as ET
from datetime import datetime

def parse_meta(meta_path):
    try:
        with open(meta_path, 'r') as f:
            lines = [line.strip() for line in f.readlines() if line.strip()]
        if len(lines) < 4:
            return None, None, None, None
        channel = lines[0].split(':')[-1].strip()
        title = lines[1].strip()
        plot = lines[2].strip()
        timestamp_unix = lines[3].strip()
        return title, plot, channel, timestamp_unix
    except Exception as e:
        print("[!] Error reading {}: {}".format(meta_path, e))
        return None, None, None, None

def normalize_title(title):
    return "Movie:" + title[6:] if title.startswith("MOVIE:") else title

def write_nfo(title, plot, studio, timestamp_unix, output_path):
    title = normalize_title(title)
    root = ET.Element('movie')
    ET.SubElement(root, 'title').text = title
    ET.SubElement(root, 'plot').text = plot
    if studio:
        ET.SubElement(root, 'studio').text = studio
    if timestamp_unix and timestamp_unix.isdigit():
        dt = datetime.utcfromtimestamp(int(timestamp_unix))
        date_str = dt.strftime('%Y-%m-%d')
        ET.SubElement(root, 'premiered').text = date_str
        ET.SubElement(root, 'aired').text = date_str
    tree = ET.ElementTree(root)
    tree.write(output_path, encoding='utf-8', xml_declaration=True)

def main(folder_path):
    if not os.path.isdir(folder_path):
        print("[!] Invalid directory.")
        return

    meta_files = sorted(f for f in os.listdir(folder_path) if f.endswith('.meta'))
    total = len(meta_files)
    print("[OK] Found {} .meta file(s).\n".format(total))

    for idx, filename in enumerate(meta_files, 1):
        full_path = os.path.join(folder_path, filename)
        title, plot, channel, timestamp = parse_meta(full_path)

        if not title:
            print("[{}/{}] Skipped {} (missing title)".format(idx, total, filename))
            continue

        name = filename.replace('.ts.', '.', 1)
        if name.endswith('.meta'):
            name = name[:-5]
        nfo_path = os.path.join(folder_path, name + '.nfo')

        write_nfo(title, plot, channel, timestamp, nfo_path)
        print("[{}/{}] Created: {} | Title: \"{}\" | Channel: {}".format(
            idx, total, os.path.basename(nfo_path), normalize_title(title), channel))

if __name__ == '__main__':
    folder = input("Enter full path to folder with .meta files: ").strip()
    main(folder)


The run "python3 meta2nfo.py"

When prompted, enter the directory "/hdd/movie"

This will then create all of the .NFO files


deanzilla

Example input meta file: 20250619 1925 - SBS World Movies - Movie_ The Year Of Living Dangerously.ts.meta

1:0:19:357:350:3202:EEEE0000:0:0:0::SBS World Movies
Movie: The Year Of Living Dangerously
A news reporter becomes hot property when he is stationed in Indonesia at the same time its president incites civil unrest. Moral dilemmas surface, as the correspondent must decide how far he wants to go to get the story of the moment.  Mel Gibson, Sigourney Weaver, Bill Kerr.
1750325100
Movie:_The_Year_Of_Living_Dangerously Tuner-C
709306621
2613641048
f:0,c:0000a2,c:010053,c:02002a,c:0300a2,c:050001
188
0


Example NFO file output: 20250619 1925 - SBS World Movies - Movie_ The Year Of Living Dangerously.nfo

<?xml version='1.0' encoding='utf-8'?>
<movie><title>Movie: The Year Of Living Dangerously</title><plot>A news reporter becomes hot property when he is stationed in Indonesia at the same time its president incites civil unrest. Moral dilemmas surface, as the correspondent must decide how far he wants to go to get the story of the moment.  Mel Gibson, Sigourney Weaver, Bill Kerr.</plot><studio>SBS World Movies</studio><premiered>2025-06-19</premiered><aired>2025-06-19</aired></movie>


deanzilla

On the ICEBOX, I add a video source being the BeyonWiz T4 Ip address:

"smb://192.168.1.95:445/Movie" (change the IP address to your own one)

When importing as "Movies", make sure you "Choose information provider" to "Local information only", eg it will use the .nfo files you created.

prl

Peter
Beyonwiz T4 in-use
Beyonwiz T2, T3, T4, U4 & V2 for testing