diff --git a/common.py b/common.py index dce768c..b20f6e4 100644 --- a/common.py +++ b/common.py @@ -34,13 +34,6 @@ def path_to_episode(name, format): return f"{base}/{name}.{format}" -def get_chapters(episode): - with open(path_to_episode(episode, "txt")) as f: - chapter_reader = csv.reader(f, delimiter="\t") - for chapter in chapter_reader: - yield {"start": float(chapter[0]), "title": chapter[2]} - - def get_episode_info(name, format): path = path_to_episode(name, format) return json.loads( diff --git a/config.toml b/config.toml index 10e3b4d..5ca286b 100644 --- a/config.toml +++ b/config.toml @@ -2,7 +2,7 @@ base_url = "https://schulischer-schabernack.de" compile_sass = true default_language = "de" feed_filename = "rss.xml" -# source opus files and chapter data are not published +# source opus files are not published ignored_content = ["sch???-*.opus", "sch???-*.txt"] title = "Schulischer Schabernack" diff --git a/content/sch001-aller-anfang-ist-schwer.txt b/content/sch001-aller-anfang-ist-schwer.txt deleted file mode 100644 index 82e6223..0000000 --- a/content/sch001-aller-anfang-ist-schwer.txt +++ /dev/null @@ -1,8 +0,0 @@ -0.000000 0.000000 Intro -19.343339 19.343339 Übersicht -49.177982 49.177982 Das Leib-Seele-Problem -251.672047 251.672047 Dualistische Antworten auf das Leib-Seele Problem -666.674603 666.674603 noch mehr -1030.055181 1030.055181 kapitel -1250.372539 1250.372539 aber -1542.221506 1542.221506 kein bock diff --git a/content/sch002-noch-mehr-boilerplate.txt b/content/sch002-noch-mehr-boilerplate.txt deleted file mode 100644 index dfb76a7..0000000 --- a/content/sch002-noch-mehr-boilerplate.txt +++ /dev/null @@ -1,11 +0,0 @@ -0.000000 0.000000 auch -84.910579 84.910579 für -156.622622 156.622622 diesen -222.175348 222.175348 test -294.767294 294.767294 will -343.601876 343.601876 ich -402.995286 402.995286 nicht -468.108061 468.108061 so -512.983082 512.983082 viel -597.013758 597.013758 Zeit -674.885118 674.885118 verschwenden diff --git a/encode.py b/encode.py index bf9ae86..b7e10bc 100755 --- a/encode.py +++ b/encode.py @@ -40,44 +40,16 @@ def encode_episode(podcast, episode, format): "COMMENT": episode["summary"], } - chapters = list(common.get_chapters(episode["file_base"])) - - duration = float( - common.get_episode_info(episode["file_base"], "original")["duration"] - ) - - ffmpeg_chapters = b";FFMETADATA1\n\n" - for idx, chapter in enumerate(chapters): - ffmpeg_chapters += b"[CHAPTER]\nTIMEBASE=1/1000\n" - ffmpeg_chapters += f"START={int(chapter['start'] * 1000)}\n".encode("utf-8") - try: - ffmpeg_chapters += f"END={int(chapters[idx+1]['start'] * 1000)}\n".encode( - "utf-8" - ) - except: - ffmpeg_chapters += f"END={int(duration * 1000)}\n".encode("utf-8") - escaped_title = ( - chapter["title"] - .replace("=", "\=") - .replace(";", "\;") - .replace("#", "\#") - .replace("\\", "\\\\") - .replace("\n", "\\\n") - ) - ffmpeg_chapters += f"title={escaped_title}\n\n".encode("utf-8") - command = ["ffmpeg", "-y", "-loglevel", "error"] command.extend(["-i", infile]) if not format in ["oga", "opus"]: command.extend(["-i", episode["poster"]]) - command.extend(["-i", "-"]) command.extend(["-c:v", "copy"]) - command.extend(["-map_metadata", "1"]) command.extend(options) for k, v in tags.items(): command.extend(["-metadata", f"{k}={v}"]) command.append(outfile) - run(command, input=ffmpeg_chapters, check=True) + run(command, check=True) if format in ["oga", "opus"]: if format == "oga": @@ -99,12 +71,6 @@ def encode_episode(podcast, episode, format): base64.b64encode(picture.write()).decode("ascii") ] - # chapters for vorbis - if format == "oga": - for idx, chapter in enumerate(chapters): - audio[f"CHAPTER{idx:03}"] = common.sexagesimal(chapter["start"]) - audio[f"CHAPTER{idx:03}NAME"] = chapter["title"] - audio.save() print(f" {format}", end="", flush=True) diff --git a/metadata.py b/metadata.py index dd81eff..884cf49 100755 --- a/metadata.py +++ b/metadata.py @@ -33,11 +33,6 @@ class EpisodeHtmlParser(HTMLParser): self.data = json.loads(data) -def chapter_fix_timestamp(chapter): - chapter["start"] = common.sexagesimal(chapter["start"]) - return chapter - - metadata = {} for file in sorted(glob(f"content/{common.ACRONYM}*.md")): @@ -57,10 +52,6 @@ for file in sorted(glob(f"content/{common.ACRONYM}*.md")): size = 0 metadata[episode]["formats"][format] = {"size": size} - metadata[episode]["chapters"] = list( - map(chapter_fix_timestamp, common.get_chapters(episode)) - ) - with open("static/episodes.json", "w") as f: f.write(json.dumps(metadata)) diff --git a/templates/podlove-player.html b/templates/podlove-player.html index ede09db..758e7f0 100644 --- a/templates/podlove-player.html +++ b/templates/podlove-player.html @@ -12,12 +12,6 @@
  • {{ format.name }} ({{ episodes[page.slug].formats[format.ext].size | filesizeformat }})
  • {%- endfor %} -

    Kapitel

    -

    - {%- for chapter in episodes[page.slug].chapters %} - {{ chapter.start }}: {{ chapter.title }}
    - {%- endfor %} -

    Mitwirkende