RSS template now conforming to standards

main
Rob Canning 2024-01-15 22:04:34 +01:00
parent 0398c4c208
commit 4017a3e483
9 changed files with 794 additions and 771 deletions

View File

@ -18,6 +18,10 @@ https://moonleerecords.bandcamp.com/
https://sirom.bandcamp.com/music https://sirom.bandcamp.com/music
https://kikiriki.bandcamp.com https://kikiriki.bandcamp.com
##
unziping bandcamp
for i in *.zip; do b=`basename "$i" .zip`; echo unzip \"$i\" -d \"$b\" ; done
## install notes ## install notes
now using a venv so : now using a venv so :
@ -26,3 +30,12 @@ python3 -m venv .venv
source .venv/bin/activate source .venv/bin/activate
pip install tinytag scikit-image pip install tinytag scikit-image
## run the script
// fresh start
echo "" > playlists/track_playout_history.txt; rm show.db ; mk_master_playlist.sh; ./mk_show.py 2 2024-04-17;
// generate podcast episode 3 with a release date of 2024-02-23
/mk_show.py 3 2024-02-23

Binary file not shown.

View File

@ -142,18 +142,14 @@
<div class="col-md-6 col-lg-6"> <div class="col-md-6 col-lg-6">
<ul class="list-unstyled"> <ul class="list-unstyled">
<li><a href="#">Home</a></li> <li><a href="#">Home</a></li>
<li><a href="#">Matches</a></li>
<li><a href="#">News</a></li> <li><a href="#">News</a></li>
<li><a href="#">Team</a></li>
</ul> </ul>
</div> </div>
<div class="col-md-6 col-lg-6"> <div class="col-md-6 col-lg-6">
<ul class="list-unstyled"> <ul class="list-unstyled">
<li><a href="#">About Us</a></li> <li><a href="#">About Us</a></li>
<li><a href="#">Privacy Policy</a></li> <li><a href="#">Contact Us</a></li>
<li><a href="#">Contact Us</a></li> </ul>
<li><a href="#">Membership</a></li>
</ul>
</div> </div>
</div> </div>

View File

@ -16,7 +16,6 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/mediaelement@4.2.7/build/mediaelementplayer.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/mediaelement@4.2.7/build/mediaelementplayer.min.css">
<link rel="stylesheet" href="css/aos.css"> <link rel="stylesheet" href="css/aos.css">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css">
@ -95,6 +94,7 @@
<div class="col-md-8" data-aos="fade-up" data-aos-delay="400"> <div class="col-md-8" data-aos="fade-up" data-aos-delay="400">
<h2 class="text-white font-weight-light mb-2 display-4">Latest Episode: # {{episode_number}}</h2> <h2 class="text-white font-weight-light mb-2 display-4">Latest Episode: # {{episode_number}}</h2>
<div class="text-white mb-4"><span class="text-white">{{episode_artists}}</span></div>
<div class="text-white mb-4"><span class="text-white-opacity-05"><small>{{episode_author}} / Zavod Rizoma | 16 September 2017 | 1:30:20</small></span></div> <div class="text-white mb-4"><span class="text-white-opacity-05"><small>{{episode_author}} / Zavod Rizoma | 16 September 2017 | 1:30:20</small></span></div>
<p><a href="episode/{{episode_number}}/index.html" class="btn btn-primary btn-sm py-3 px-4 small">Episode Details and Player</a></p> <p><a href="episode/{{episode_number}}/index.html" class="btn btn-primary btn-sm py-3 px-4 small">Episode Details and Player</a></p>
@ -326,17 +326,14 @@
<div class="col-md-6 col-lg-6"> <div class="col-md-6 col-lg-6">
<ul class="list-unstyled"> <ul class="list-unstyled">
<li><a href="#">Home</a></li> <li><a href="#">Home</a></li>
<li><a href="#">Matches</a></li> <li><a href="#">News</a></li>
<li><a href="#">News</a></li>
<li><a href="#">Team</a></li>
</ul> </ul>
</div> </div>
<div class="col-md-6 col-lg-6"> <div class="col-md-6 col-lg-6">
<ul class="list-unstyled"> <ul class="list-unstyled">
<li><a href="#">About Us</a></li> <li><a href="#">About Us</a></li>
<li><a href="#">Privacy Policy</a></li>
<li><a href="#">Contact Us</a></li> <li><a href="#">Contact Us</a></li>
<li><a href="#">Membership</a></li>
</ul> </ul>
</div> </div>
</div> </div>

View File

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>Hiking Treks</title> <link>https://www.apple.com/itunes/podcasts/</link>
<language>en-us</language>
<copyright>© 2019 John Appleseed</copyright>
<itunes:author>The Sunset Explorers</itunes:author>
<description> {{short_description}} </description>
<itunes:type>serial</itunes:type>
<itunes:owner> <itunes:name>{{show_name}}</itunes:name>
<itunes:email>{{show_email}}</itunes:email>
</itunes:owner>
<itunes:image
href="{{show_image}}"
/>
<itunes:category text="Music">
<itunes:category text="Independent Music"/> </itunes:category>
<itunes:explicit>false</itunes:explicit>
{% for rss_item in range(episode_number) %}
<item>
<itunes:episodeType>podcast</itunes:episodeType>
<itunes:title>{{show_name}} Episode # {{episode_number}}</itunes:title>
<description>
<content:encoded>
<![CDATA[{{show_short_description}} Listen on
<a
href="{{show_url}}">Rizoma Podcasts Homepage</a>.]]>
</content:encoded>
</description>
<enclosure
length="{{episode_duration}}"
type="audio/mpeg"
url="{{episde_mp3_url}}"
/>
<guid>aae20190418</guid>
<pubDate>{{episode_pub_date}}</pubDate>
<!-- <pubDate>Tue, 8 Jan 2019 01:15:00 GMT</pubDate> -->
<itunes:duration>{{episode_duration}}</itunes:duration>
<itunes:explicit>false</itunes:explicit>
</item>
{% endfor %}
</channel>
</rss

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title>{{show_name}} RSS</title>
<link>http://{{show_name}}.rizoma.si</link>
<description>{{show_name}} Music Podcast</description>
{% for rss_item in range(episode_number) %}
<item>
<title>Episode # {{episode_number}} - The Slo Indie Show</title>
<link>http://{{showname}}.rizoma.si/episode/{{episode_number}}/show.mp3</link>
<description>Episode # {{episode_number}} of The Slovenian Indie Show</description>
</item>
{% endfor %}
</channel>
</rss>

View File

@ -6,6 +6,7 @@ from os.path import join
from tinytag import TinyTag from tinytag import TinyTag
from random import shuffle from random import shuffle
import sqlite3, json import sqlite3, json
import uuid
from mk_web import * from mk_web import *
@ -33,6 +34,7 @@ if os.path.exists(web_path):
else: os.makedirs(web_path) else: os.makedirs(web_path)
# ///////////////////////////////////////////////// # /////////////////////////////////////////////////
def set_episode_date(input_date): def set_episode_date(input_date):
global episode_date global episode_date
date_str = input_date date_str = input_date
@ -41,7 +43,6 @@ def set_episode_date(input_date):
#return episode_date #return episode_date
print(episode_date) print(episode_date)
conn = '' conn = ''
def database_create(): def database_create():
# the show database # the show database
@ -56,12 +57,12 @@ def database_create():
ID INTEGER PRIMARY KEY AUTOINCREMENT, ID INTEGER PRIMARY KEY AUTOINCREMENT,
EPISODE INT NOT NULL, EPISODE INT NOT NULL,
DATE TEXT NOT NULL, DATE TEXT NOT NULL,
DURATION INT NOT NULL,
ALBUM TEXT NOT NULL, ALBUM TEXT NOT NULL,
TRACK TEXT NOT NULL, TRACK TEXT NOT NULL,
ARTIST TEXT NOT NULL, ARTIST TEXT NOT NULL,
TRACKDUR INT NOT NULL, TRACKDUR INT NOT NULL,
YEAR TEXT NOT NULL YEAR TEXT NOT NULL,
PATH TEXT NOT NULL
);''') );''')
print("Table created successfully"); print("Table created successfully");
@ -72,7 +73,6 @@ def database_create():
#print("DB Record created successfully"); #print("DB Record created successfully");
#conn.close() #conn.close()
def create_intro(show_array): def create_intro(show_array):
intropath = path + "texts/clips/this_is" intropath = path + "texts/clips/this_is"
intro = random.choice(os.listdir(intropath)) intro = random.choice(os.listdir(intropath))
@ -114,13 +114,14 @@ def create_show_playlist(show_array: list, complete_playlist:list):
track_count = 0 track_count = 0
global artists_played global artists_played
max_track_dur = 10 max_track_dur = 10
min_track_dur = 1.8 min_track_dur = 2
while episode_duration < 60 * 60 and track_count < 12 : while episode_duration < 60 * 60 and track_count < 10 :
song = random.choice(random.sample(\ song = random.choice(random.sample(\
complete_playlist, len(complete_playlist) )).rstrip() # pick a song complete_playlist, len(complete_playlist) )).rstrip() # pick a song
track = TinyTag.get(song) # get its metadata track = TinyTag.get(song) # get its metadata
# check if the artist not in the played list and the song is less than 8mins # check if the artist not in the played list and the song is less than 8mins
track_path = '/'.join(song.split('/')[0:-1])
if track.artist not in artists_played: if track.artist not in artists_played:
if check_archive(track.title) is True: if check_archive(track.title) is True:
if int(track.duration) > min_track_dur * 60: if int(track.duration) > min_track_dur * 60:
@ -139,9 +140,10 @@ def create_show_playlist(show_array: list, complete_playlist:list):
cursor = conn.cursor() cursor = conn.cursor()
#long_string = json.dumps(["' SomeWord"]) #long_string = json.dumps(["' SomeWord"])
cursor.execute("INSERT INTO SHOW (\ cursor.execute("INSERT INTO SHOW (\
ID, EPISODE, DATE, DURATION, ALBUM, TRACK, ARTIST, TRACKDUR, YEAR) \ ID, EPISODE, DATE, ALBUM, TRACK, ARTIST, TRACKDUR, YEAR, PATH) \
VALUES (NULL, ?, ?, ?, ?, ?, ?,?,?)", [episode_number, episode_date, episode_duration, \ VALUES (NULL, ?, ?, ?, ?, ?,?,?,? )", [episode_number, episode_date, \
track.album, track.title, track.artist, track.duration, track.year]); track.album, track.title, track.artist, \
track.duration, track.year, track_path]);
conn.commit() conn.commit()
print("DB Record created successfully"); print("DB Record created successfully");
@ -243,13 +245,15 @@ def combine_images(columns, space, images, variants:int):
def create_show_coverart(show_array, variants): def create_show_coverart(show_array, variants):
show_cover_jpgs = [] show_cover_jpgs = []
# in the directory containing songs find jpg and pngs containing string "cover"
for dir in show_array: for dir in show_array:
path = pathlib.Path(dir).parent path = pathlib.Path(dir).parent
for file in os.listdir(path): for file in os.listdir(path):
for i in ["cover", "COVER"]: for p in [".png", ".jpg", ".jpeg"]:
if i in file: if p in file:
show_cover_jpgs.append(str(path) + "/" + file) for i in ["cover", "COVER"]:
if i in file:
show_cover_jpgs.append(str(path) + "/" + file)
print(''' print('''
------------------------ ------------------------
@ -354,10 +358,10 @@ def create_podcast(show_array: list):
playlist_length = len(playlist) / (1000*60) playlist_length = len(playlist) / (1000*60)
# save the entire poidcast # save the entire poidcast
with open("html/episode/{0}/show.flac".format(episode_number), 'wb') as out_f: # with open("html/episode/{0}/show.flac".format(episode_number), 'wb') as out_f:
print("FLAC output file opened...writing to file...") # print("FLAC output file opened...writing to file...")
playlist.export(out_f, format='flac') # playlist.export(out_f, format='flac')
print("FLAC audio file exported...") # print("FLAC audio file exported...")
with open("html/episode/{0}/show.mp3".format(episode_number), 'wb') as out_f: with open("html/episode/{0}/show.mp3".format(episode_number), 'wb') as out_f:
print("MP3 output file opened...writing to file...") print("MP3 output file opened...writing to file...")
@ -501,7 +505,7 @@ def create_html_episode_from_template():
def create_RSS_XML_from_template(): def create_RSS_XML_from_template():
from jinja2 import Template, Environment, FileSystemLoader from jinja2 import Template, Environment, FileSystemLoader
env = Environment(loader=FileSystemLoader('html/templates')) env = Environment(loader=FileSystemLoader('html/templates'))
rss_template = env.get_template('show_RSS_xml.jinja') rss_template = env.get_template('show_RSS.jinja.xml')
output_from_parsed_template = rss_template.render(\ output_from_parsed_template = rss_template.render(\
show_name=show_name, \ show_name=show_name, \
episode_number=int(episode_number), episode_author="Rob Canning",\ episode_number=int(episode_number), episode_author="Rob Canning",\

File diff suppressed because it is too large Load Diff

View File

@ -1,102 +1,12 @@
Chorus 1 (SC) perspektiva
Elephant in The Mush Rooms Sub Persona I
Transition (Excerpt) Domen Gnezda - Misnomer II - 04 Misnomer 26
Her Boat
Todestriebe
Extra space
Tone Pavček & Tomaž Grom - Sonce in sončice po vsem svetu - 04 Čenčačeva uspavanka
Tomaž Grom & Seijiro Murayama - Nepretrganost - 04 Štiri.
Slika 6
1 9 5 Ints (Edit)
Crisp Ursa Minor
Laszlo
Inchoate Crimes
Action I
Jean-Luc Guionnet & Samo Kutin - Kopaš - 05 05
Stabit
Sub Persona IX
decrepitation_var.1a-2
won't work for free anymore
Apropos
Weakest Parts of Society
death rattle_var.2-4
Tomaž Grom & Seijiro Murayama - Nepretrganost - 04 Štiri.
Small Tyrant
Scena Prologue
Pagan (KK Null remix)
Samo Kutin - Plovilo - 02 Bliže
voices
Jean-Luc Guionnet & Samo Kutin - Kopaš - 07 07
Sub Persona IX
Crisp Ursa Minor
Zlatko Kaučič, Tomaž Grom - The Ear Is The Shadow Of The Eye - 01 From Hands To Ears - Iz rok v ušesa
Whale Ft Outtake
Mono Scarves - Kaj pa tisti rizling
Parallax Division
Asphalt
Loveful
Vertex
Je Šel Brat S Sestro
a3
Jošt Drašler - The Balloon Catcher - 06 Green Balloon
Trojnik (Cene Resnik, Tomaž Grom, Vid Drašler) - Moje uho ima ostre robove - 03 03
BE CREEP - LIVE
RIP Girls Toys
Zlatko Kaučič, Tomaž Grom - Torn Memories Of Folklore - Raztrgana folklora spomina - 03 Scattered Out Of Context
Matej Bonin - Gymnastics of non-sense II - 02 Part II
Trojnik (Cene Resnik, Tomaž Grom, Vid Drašler) - Moje uho ima ostre robove - 11 11
Samo Kutin - Plovilo - 02 Bliže
Descent
Antichrist
Vid Drašler - Kramljanja - 07 7.
Ultrascan
stepbystep
Oscillopsia
Soft Orange
Offset V2
coupdotexe (mapalma remix)
Samo Kutin - Plovilo - 06 A
Nebulae Tree
Vid Drašler - Kramljanja - 07 7.
1 9 5 Ints (Edit)
Trojnik (Cene Resnik, Tomaž Grom, Vid Drašler) - Moje uho ima ostre robove - 11 11
Zlatko Kaučič, Tomaž Grom - Torn Memories Of Folklore - Raztrgana folklora spomina - 09 Sheep On The Right Bank
Explored
Spiritual Of Anger (Outtake)
Crushing Trauma
Vision Rising (Eraldo Bernocchi remix)
Sand Mantis
Apropos
things i decided against
Action XVI
Jošt Drašler - The Balloon Catcher - 06 Green Balloon
Crossing The Rubicon
Oholo! - Mnogobolje - 01 Blind man's buff Oholo! - Mnogobolje - 01 Blind man's buff
Samo Kutin - Plovilo - 04 Kdove My Sweet.Com
Typhaceae Vid Drašler - Kramljanja - 03 3.
Quiet Certainty Kolonija
Immediate
Passing
Vision Rising (Eraldo Bernocchi remix)
Trojnik (Cene Resnik, Tomaž Grom, Vid Drašler) - Moje uho ima ostre robove - 08 08
Irena Z. Tomažin - Cmok v grlu - Lump In The Throat - 14 Klic meduze
Strand Looper
Domen Gnezda - Misnomer II - 17 Misnomer 39
Antichrist
a3
Tone Pavček & Tomaž Grom - Sonce in sončice po vsem svetu - 10 Ninulla Çapkanёve (Čenčačeva uspavanka)
Strenuous Effort
blckend leftover_var.3a
The Oppressed 2 (SC) The Oppressed 2 (SC)
Ukwakha (Chris Wood remix) Blue Waters Turn Black (P.C.M. remix)
Ambinet Untold Truths
Samo Kutin and Martin Küchen - Stutter And Strike - 04 Orans Kampak
Krdelo
Tomaž Grom - Sam, za... - 08 P.Č.
5000000000 YRS
Vinko Globokar - Splitting - 07 Vinko Globokar- Dialogue about water, for acoustic and electric guitar (1994)
Lussid
Wicked Child
Harlequin
Action VIII