Libpyn
A third-party API for libsyn.
Table of Contents
Installation
In order to install libpyn, run this command on the terminal
foo@bar:~$ pip install libpyn
Features
The Podcast class is the main feature of this package.
# Import statement
from libpyn.podcast import Podcast
In order to create an instance of the Podcast class, pass a link to a libsyn channel in with the instance declaration.
channel = 'https://therabbithole.libsyn.com/'
example = Podcast(channel)
Once initialized, the Podcast class contains useful information about the podcast.
example.name = # Name of the podcast channel
self.mp3list = # List of episodes, each episode saved as a dictionary
self.htmllink = # Link to the podcast's website
Each dictionary in self.mp3list contains these key/value pairs:
podcast = {} # Dictionary for storing podcast info
podcast['title'] = # Name of episode
podcast['date'] = # Publish date
podcast['mp3'] = # Link to mp3 file
podcast['image'] = # Channel logo
In order to download the mp3 files of a podcast channel, use the download() function.
# This will download the mp3 files in a directory named after the podcast channel
# in the Downloads directory
example.download()
A specific path can be specified, the name of the directory (foldername) in which the mp3 files will be stored can also be specified. If the foldername is not specified, it will be the name of the channel. (Spaces are replaced with underscores.)
path = 'path/to/store/mp3'
directory = '/files'
example.download(path=path, foldername=directory)
In order to get a list of HTML iframes of the latest episodes to embed on a webpage, use the iframes() function.
iframesList = example.iframes()
Changelog
== v1.0.1 ==
- Fix bugs involving download function
- Remove HTML tags from podcast.name attribute
- Fix logger, log always in same directory as podcast.py
== v1.0.0 ==
- Initial release