DmitryBurnaev / podcast-service

Podcast's API service
MIT License
3 stars 2 forks source link

Add eposodes' chapters #249

Closed DmitryBurnaev closed 1 month ago

DmitryBurnaev commented 2 months ago

We need to have chapters in created (and exported to RSS) episodes.

In simple varuant we can:

  1. extract chapters from yt-dlp result (key chapters in result dictionary)
  2. save chapters in Episode's object
  3. provide chapters in RSS's item (description section)

yt-dlp result example

{
...,
"chapters": [
     {'start_time': 0.0, 'title': 'Intro', 'end_time': 49.0}, 
     {'start_time': 49.0, 'title': 'Review', 'end_time': 75.0}, 
]
}

RSS example:

    <item>
        <title>Episode 919</title>
        <description><![CDATA[<p><img src="https://test.com/images/test/919.jpg" alt="" /></p>

<p>
<em>Chapters</em>
<ul>
<li>Intro - <em>00:00:00</em>.</li>
<li><a href="https://www.theverge.com/2024/7/19/24201864/crowdstrike-outage-explained-microsoft-windows-bsod">CrowdStrike</a> - <em>00:00:39</em>.</li>
<li><a href="https://arstechnica.com/information-technology/2024/07/crowdstrike-fixes-start-at-reboot-up-to-15-times-and-get-more-complex-from-there/">15 reboots</a> - <em>00:24:34</em>.</li>
</ul>
</p>
...