talklib 2.0.6__tar.gz → 2.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {talklib-2.0.6/src/talklib.egg-info → talklib-2.1.0}/PKG-INFO +1 -1
- {talklib-2.0.6 → talklib-2.1.0}/pyproject.toml +1 -1
- {talklib-2.0.6 → talklib-2.1.0}/src/talklib/pod.py +9 -12
- {talklib-2.0.6 → talklib-2.1.0/src/talklib.egg-info}/PKG-INFO +1 -1
- {talklib-2.0.6 → talklib-2.1.0}/LICENSE.txt +0 -0
- {talklib-2.0.6 → talklib-2.1.0}/README.md +0 -0
- {talklib-2.0.6 → talklib-2.1.0}/requirements.txt +0 -0
- {talklib-2.0.6 → talklib-2.1.0}/setup.cfg +0 -0
- {talklib-2.0.6 → talklib-2.1.0}/src/talklib/__init__.py +0 -0
- {talklib-2.0.6 → talklib-2.1.0}/src/talklib/ev.py +0 -0
- {talklib-2.0.6 → talklib-2.1.0}/src/talklib/ffmpeg.py +0 -0
- {talklib-2.0.6 → talklib-2.1.0}/src/talklib/notify.py +0 -0
- {talklib-2.0.6 → talklib-2.1.0}/src/talklib/show.py +0 -0
- {talklib-2.0.6 → talklib-2.1.0}/src/talklib/utils.py +0 -0
- {talklib-2.0.6 → talklib-2.1.0}/src/talklib.egg-info/SOURCES.txt +0 -0
- {talklib-2.0.6 → talklib-2.1.0}/src/talklib.egg-info/dependency_links.txt +0 -0
- {talklib-2.0.6 → talklib-2.1.0}/src/talklib.egg-info/requires.txt +0 -0
- {talklib-2.0.6 → talklib-2.1.0}/src/talklib.egg-info/top_level.txt +0 -0
|
@@ -134,7 +134,6 @@ class Episode(BaseModel):
|
|
|
134
134
|
episode_title: str = Field(min_length=1, default=None)
|
|
135
135
|
notifications: Notifications = Notifications()
|
|
136
136
|
max_episodes: int = Field(default=None)
|
|
137
|
-
categories: list = Field(default=None)
|
|
138
137
|
|
|
139
138
|
def pub_date(self) -> str:
|
|
140
139
|
timezone = time.timezone/60/60 # 60 seconds per minute, 60 minutes per hour
|
|
@@ -179,6 +178,7 @@ class Episode(BaseModel):
|
|
|
179
178
|
root = feed.getroot()
|
|
180
179
|
root = root.find('channel')
|
|
181
180
|
|
|
181
|
+
self.notifications.prep_syslog(message="Building the new <item> element")
|
|
182
182
|
item = ET.Element('item')
|
|
183
183
|
|
|
184
184
|
title = ET.Element('title')
|
|
@@ -209,19 +209,13 @@ class Episode(BaseModel):
|
|
|
209
209
|
itunes_duration_element.text = self.itunes_duration()
|
|
210
210
|
item.append(itunes_duration_element)
|
|
211
211
|
|
|
212
|
-
for category in self.categories:
|
|
213
|
-
category_element = ET.Element("category")
|
|
214
|
-
category_element.text = category
|
|
215
|
-
self.notifications.prep_syslog(message=f"adding category: {category}")
|
|
216
|
-
item.append(category_element)
|
|
217
|
-
|
|
218
212
|
# insert the new 'item' element as the first item, but below all the other channel elements
|
|
219
213
|
items = root.findall('item')
|
|
220
214
|
if items:
|
|
221
215
|
# If there are existing items (there usually will be), add the new item before to the top
|
|
222
216
|
first_item = items[0]
|
|
223
217
|
index = list(root).index(first_item)
|
|
224
|
-
self.notifications.prep_syslog(message=f"adding {item} to feed at {index}")
|
|
218
|
+
self.notifications.prep_syslog(message=f"adding {item} to feed at channel index: {index}")
|
|
225
219
|
root.insert(index, item)
|
|
226
220
|
else:
|
|
227
221
|
# If no items exist, add the new item to the bottom (after the other channel elements)
|
|
@@ -276,7 +270,6 @@ class TLPod(BaseModel):
|
|
|
276
270
|
'''
|
|
277
271
|
display_name: str = Field(min_length=1)
|
|
278
272
|
filename_to_match: str = Field(min_length=1)
|
|
279
|
-
categories: list = Field(default=[])
|
|
280
273
|
bucket_folder: str = Field(default=None)
|
|
281
274
|
max_episodes_in_feed: int = Field(ge=1, default=5)
|
|
282
275
|
override_filename: bool = False
|
|
@@ -324,13 +317,17 @@ class TLPod(BaseModel):
|
|
|
324
317
|
to_send = f"There was a problem podcasting {self.display_name}. Cannot find matched file {to_match} in {self.audio_folders}"
|
|
325
318
|
self.notifications.send_notifications(message=to_send, subject='Error')
|
|
326
319
|
raise FileNotFoundError
|
|
327
|
-
|
|
328
|
-
def
|
|
320
|
+
|
|
321
|
+
def create_converted_filename(self, file: str):
|
|
329
322
|
output_filename = file.split('.')
|
|
330
323
|
output_filename = output_filename[0]
|
|
331
324
|
output_filename = os.path.basename(output_filename).lower()
|
|
332
325
|
output_filename = output_filename + '.mp3'
|
|
333
326
|
self.notifications.prep_syslog(message=f"Converted audio file will be {output_filename}")
|
|
327
|
+
return output_filename
|
|
328
|
+
|
|
329
|
+
def convert(self, file:str):
|
|
330
|
+
output_filename = self.create_converted_filename(file=file)
|
|
334
331
|
|
|
335
332
|
self.ffmpeg.input_file = file
|
|
336
333
|
self.ffmpeg.output_file = output_filename
|
|
@@ -359,6 +356,7 @@ class TLPod(BaseModel):
|
|
|
359
356
|
|
|
360
357
|
def run(self):
|
|
361
358
|
self.notifications.prep_syslog(message="Starting up...")
|
|
359
|
+
self.notifications.prep_syslog(message=f"Attributes: {self.__repr__()}")
|
|
362
360
|
|
|
363
361
|
self.ssh.check_folder_exists(folder=self.bucket_folder)
|
|
364
362
|
|
|
@@ -370,7 +368,6 @@ class TLPod(BaseModel):
|
|
|
370
368
|
self.episode.feed_file = feed_file
|
|
371
369
|
self.episode.audio_filename = converted_file
|
|
372
370
|
self.episode.bucket_folder = self.bucket_folder
|
|
373
|
-
self.episode.categories = self.categories
|
|
374
371
|
self.episode.episode_title = f"{self.display_name} ({datetime.now().strftime('%a, %d %B')})"
|
|
375
372
|
self.episode.max_episodes = self.max_episodes_in_feed
|
|
376
373
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|