Skip to main content

Generate RSS feeds from media files in a directory

Project description

genRSS

Build Status

genRSS is a tool for generating an RSS 2.0 feed from media files within a directory. It can search for files recursively in subdirectories and restrict the search to specific file extensions.

Installation

Note: Another package named genrss already exists on PyPI. To install genRSS, please use generss (with an e after the n):

pip install generss

Once installed, you can run genRSS directly from the command line.

Determining Media File Duration

To include the duration of media files in your feeds (via the <itunes:duration> tag), genRSS attempts to determine the duration using the following tools, in order of preference:

  1. mutagen: a python package (automatically installed if you install genRSS with pip) that supports both audio and video files.
  2. sox: command-line tool, handles only audio files but is faster than ffprobe.
  3. ffprobe: command-line tool, supports both audio and video files but is the slowest option.

If genRSS is unable to determine the media file duration using one tool, it will automatically fall back to the next one in the list. If none of these tools is available or if the file duration can't be retrieved, the <itunes:duration> tag will not be included in the feed.

Episode Descriptions

Text files with a .txt extension are automatically used to provide descriptions for media files that share the same name but have different extensions. As a result, files ending in .txt cannot be used as feed items.

Usage options

Type genRSS -h to show the usage options:

  -d DIRECTORY, --dirname DIRECTORY
                        Directory to look for media files in.
                        This directory name will be appended to the host name
                        to create absolute paths to your media files.
  -r, --recursive       Look for media files recursively in subdirectories
                        [Default:False]
  -e STRING, --extensions STRING
                        A comma separated list of extensions (e.g. mp3,mp4,avi,ogg)
                        [Default: all files]
  -o FILE, --out FILE   Output RSS file [default: stdout]
  -H URL, --host URL    Host name (or IP address), possibly with a protocol
                        (default: http) a port number and the path to the base
                        directory where your media directory is located.
                        Examples of host names:
                         - http://localhost:8080 [default]
                         - mywebsite.com/media/JapaneseLessons
                         - mywebsite
                         - 192.168.1.12:8080
                         - http://192.168.1.12/media/JapaneseLessons
  -i URL, --image URL   Absolute or relative URL for feed's image [default: None]
  -M, --metadata        Use media files' metadata to extract item title [default: False]
  -t STRING, --title STRING
                        Title of the podcast [Default: use directory name as title]
  -p STRING, --description STRING
                        Description of the podcast [Default:None]
  -C, --sort-creation   Sort files by date of creation instead of name (default)
  -v, --verbose         set verbose [default: False]

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

generss-0.3.3.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

generss-0.3.3-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file generss-0.3.3.tar.gz.

File metadata

  • Download URL: generss-0.3.3.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.5

File hashes

Hashes for generss-0.3.3.tar.gz
Algorithm Hash digest
SHA256 fc861202d586de39ae93a8ed3b70fa77f3dbc162ea4e25b1d9fc3088e9d8852b
MD5 2b21c5c393205645d3b35afc49a6dad7
BLAKE2b-256 7e1a3e8d992493b6b5662cf933d9e71f020a7f3bb1a68adc945d7de48fe9c94a

See more details on using hashes here.

File details

Details for the file generss-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: generss-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.5

File hashes

Hashes for generss-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 de3b1bacb2bc8330d45698a46529560cf03bbb494274049a1e6342984ca37d21
MD5 d748d73617ee84327e7fe41908528bcc
BLAKE2b-256 950eae080630804dbf9ef80a45542c79b2b214a7fa044af541fe5c5b5a190a7f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page