Generates an RSS 2.0 podcast feed for RTP Play shows.
It scrapes the episodes list, retrieves the mp3 for new episodes,
and updates a p<program_id>_feed.xml file.
This repository uses uv as the package manager and dependency resolver. You can install uv by following their official instructions.
To setup the virtual environment and install all dependencies (including dev tools like pytest and ruff):
uv syncTo install the pre-commit git hooks to auto-format your code automatically:
uv run pre-commit installTo run tests and lint checks manually:
uv run pytest
uv run ruff check .To execute the script with default settings:
uv run rtp-podcasterYou can override the default behavior using command-line arguments:
--output: Define the filename for the generated feed (default:p<program_id>_feed.xml). All feeds are saved within thepublic/rtp-podcaster/directory.--show-url: Full URL of the RTP Play show page (default:https://www.rtp.pt/play/p254/alta-tensao). The program ID is extracted from this URL.--max-episodes: Set the maximum number of episodes to index in the feed (default:128).--force-refresh: Disregard the historical feed metadata and rebuild the entire feed from scratch.
Example:
uv run rtp-podcaster --output custom_feed.xml --max-episodes 5