talklib 2.1.4__tar.gz → 2.1.6__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: talklib
3
- Version: 2.1.4
3
+ Version: 2.1.6
4
4
  Summary: A package to automate processing of shows/segments airing on the TL
5
5
  Author-email: Ben Weddle <ben.weddle@gmail.com>
6
6
  Maintainer-email: Ben Weddle <ben.weddle@gmail.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "talklib"
3
- version = "2.1.4"
3
+ version = "2.1.6"
4
4
  description = "A package to automate processing of shows/segments airing on the TL"
5
5
  readme = "README.md"
6
6
  license = {file = "LICENSE.txt"}
@@ -8,6 +8,7 @@ import time
8
8
  from typing import ClassVar, Type
9
9
 
10
10
  from fabric import Connection, Result
11
+ from paramiko.ssh_exception import SSHException as paramiko_SSH_exception
11
12
  from pydantic import BaseModel, Field, model_validator
12
13
 
13
14
  from talklib.ev import EV
@@ -69,8 +70,13 @@ class SSH(BaseModel):
69
70
  self.connection.get(remote=f"shows/{folder}/{file}")
70
71
  self.notifications.prep_syslog(message=f"Successfully downloaded '{file}' to {os.getcwd()}")
71
72
  return file
72
- except Exception as e:
73
- to_send = f"unable to download '{file}': {e}"
73
+ except paramiko_SSH_exception as e:
74
+ to_send = f"unable to download '{file}' due to an authentication error. Are your SSH keys correctly configured?\n\
75
+ The error from the SSH library is: {e}"
76
+ self.notifications.send_notifications(message=to_send, subject='Error')
77
+ raise e
78
+ except FileNotFoundError as e:
79
+ to_send = f"Unable to download {file} from /{folder}. It seems the file does not exist: {e}"
74
80
  self.notifications.send_notifications(message=to_send, subject='Error')
75
81
  raise e
76
82
 
@@ -115,6 +121,9 @@ class SSH(BaseModel):
115
121
  ret_val.append(file.lower())
116
122
  return ret_val
117
123
 
124
+ def get_feed_from_folder(self, folder: str):
125
+ self.download_file(file="feed.xml", folder=folder)
126
+
118
127
  def check_folder_exists(self, folder: str) -> bool:
119
128
  self.notifications.prep_syslog(message=f"checking if {folder}/ exists on server...")
120
129
  folders = self.get_folders()
@@ -152,7 +161,7 @@ class Episode(BaseModel):
152
161
  return size_in_bytes
153
162
 
154
163
  def enclosure(self) -> str:
155
- enclosure = f"https://assets.library.nashville.org/talkinglibrary/shows/{self.bucket_folder}/{self.audio_filename}"
164
+ enclosure = f"https://dts.podtrac.com/redirect.mp3/assets.library.nashville.org/talkinglibrary/shows/{self.bucket_folder}/{self.audio_filename}"
156
165
  self.notifications.prep_syslog(message=f"enclosure will be {enclosure}")
157
166
  return enclosure
158
167
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: talklib
3
- Version: 2.1.4
3
+ Version: 2.1.6
4
4
  Summary: A package to automate processing of shows/segments airing on the TL
5
5
  Author-email: Ben Weddle <ben.weddle@gmail.com>
6
6
  Maintainer-email: Ben Weddle <ben.weddle@gmail.com>
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