spec.md 3.2 KB

Bingewatching Playlist Format Specification

This file specifies Bingewatching Playlist Format.

The Bingewatching Playlist format is loosely based on the M3U Playlist format. The primary purpose of this format is to enable it's user to designate a number of periods in the listed mediafiles and assign them to a category.

In practice, this enables media-players and other programs that implement this format to skip the designated sections when desired by the user.

File Extension

Bingewatching Playlist shall be stored with the extension "bwp"

Example:

myBingewatchPlaylist.bwp

MIME-Type

TBD

File format specification

Bingewatching Playlists are textfiles. They are intended to be easily editable by hand. Thus they are designed to be simple to read by humans.

Lines in Bingewatching playlists can be one type of the following four:

  • Whitespace (will be ignored)
  • Commentline preceded with "#" (will be ignored)
  • Media file specifier. A relative path to a mediafile. Relative to the path the bingewatching playlist resides in. Folder names are being divided by slashes as done in *nix-filesystems.
  • Section-Designation. Section designations must be indented by at least one whitespace and placed under their respective media-files.

Section designations are composed of three parameters:

  • Name (string)
  • Start time (timestamp or time in milliseconds or "start" for start of mediaile)
  • End time (timestamp or time in milliseconds or "end" for end of mediafile)

Example:

# This is an example bingewatching playlist

videos/video1.ogv
    intro           start       30000
    outro           3600000     end

videos/video2.mp4
    advertisement   00:25:15    00:30:46
    outro           00:45:22    00:47:11

# Have fun watching

The following section declares a file format specification in Extended Backus-Naur-Form:

#TODO: modify this definition in a manner that there is a more well formed definiton for character
#TODO: think of more section_names that could be useful
newline = "\n";
character = every character that is allowed by the filesystem to specify paths;
number = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
number_to_five = "0" | "1" | "2" | "3" | "4" | "5"
milliseconds = number,{number};
timestamp = 2 * number, ":", number_to_five, number, ":", number_to_five, number;
whitespace = "	", " ";
section_name = "intro" | "outro" | "advertisement" | "preview" | "misc";
folder = character, {character}, "/";
file = character, {character};
mediafile_specifier = {folder}, file, newline;
section_designation = whitespace, {whitespace}, 
                      section_name, whitespace, {whitespace},
                      timestamp | milliseconds | "start", whitespace, {whitespace},
                      timestamp | milliseconds | "end", {whitespace},
                      newline;
comment = {whitespace}, "#", {character}, newline;
whiteline = {whitespace}, newline;
bingewatching_playlist = {whiteline | comment}, 
                         {mediafile_specifier, {comment | whiteline | section_designation}},
                         {whiteline | comment};