{"id":15862832,"url":"https://github.com/cidrblock/podcastd","last_synced_at":"2025-04-01T20:45:19.912Z","repository":{"id":48119595,"uuid":"121755830","full_name":"cidrblock/podcastd","owner":"cidrblock","description":"podcast grabber written in python w/ REST API","archived":false,"fork":false,"pushed_at":"2021-08-06T11:50:59.000Z","size":63,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-07T13:38:53.549Z","etag":null,"topics":["podcasts","python","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cidrblock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-16T13:48:39.000Z","updated_at":"2021-08-06T11:51:02.000Z","dependencies_parsed_at":"2022-08-12T19:00:53.830Z","dependency_job_id":null,"html_url":"https://github.com/cidrblock/podcastd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cidrblock%2Fpodcastd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cidrblock%2Fpodcastd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cidrblock%2Fpodcastd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cidrblock%2Fpodcastd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cidrblock","download_url":"https://codeload.github.com/cidrblock/podcastd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246709918,"owners_count":20821298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["podcasts","python","rest-api"],"created_at":"2024-10-05T23:00:22.522Z","updated_at":"2025-04-01T20:45:19.880Z","avatar_url":"https://github.com/cidrblock.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Overview:\n  podcastd is a simple podcast downloader written in python. I needed something to run on a pi-zero plugged into the USB port of my i3.\n\n## Features\n\n1) REST API.  The addition of subscriptions and triggering of updates is done using the REST API.\n2) Each subscription can have a unique maximum count and maximum age for episodes configured.\n3) All ID3 tags are replaced from the downloaded episodes.\n4) Images are added to each episodes ID3 tag in the following order of preference:\n    * From a URL configured in the DB\n    * From the image URL in the episode from the RSS feed\n    * From an existing ID3 image\n5) Image sizes are set to 400x400px.\n6) Post-update summaries can be posted to a slack channel if configured.\n7) Episode are renamed to their title in the podcast and stored in directories based on the subscription name.\n7) Note: The genre for each episode is set to `255, Podcast`.  This was done so the BMW i-drive system can recognize the episode as podcasts instead of music.\n\n\n## Installation:\n\n1) Clone this repo\n2) Set-up a virtual environment and install the requirements.\n```\npython3 -m venv venv\nsource venv/bin/activate\npip install -r requirements.txt\n```\n3) Copy the `settings.sample` file to `settings.py` and update the slack URL if desired\n\n4) Update the `settings.py` file as needed to set the base directory for either development or production.\n\n## Starting the server and adding subscriptions\n\n1) Set an environemnt variable to run in development mode.\n```\nexport ENV=dev\n```\n2) Start the server\n```\npython app.py\n```\n3) Add some subscriptions, some helper scripts to convert OMPL files to yaml can be found in the `init` directory. Update the `podcasts.yml` to suit your tastes.\n\n```\npip install pyyaml\npython load_podcasts.py\n```\nThis reads podcasts from the `podcasts.yml` file and POSTs them to the API.\n\n## API endpoints\n\n- GET `/podcasts`: Get all podcasts.\n\n```\ncurl localhost:5000/podcasts | python -m json.tool\n```\n\n\n- GET `/podcast/id`: Get a podcast using it's id.\n```\ncurl localhost:5000/podcast/1 | python -m json.tool\n```\n\n- GET `/episodes/id`: Get all episode for a podcast using the podcast id.\n\n```\ncurl localhost:5000/episodes/1 | python -m json.tool\n```\n\n- GET `/episode/id`: Get a episode using it's id.\n\n```\ncurl localhost:5000/episode/1285 | python -m json.tool\n```\n\n- PUT `/podcast/id`: Update a podcast.\n\n```\ncurl -X PUT localhost:5000/podcast/1 -H \"Content-Type: application/json\" -d '{\n    \"id\": 1,\n    \"name\": \"A Prairie Home Companion: News from Lake Wobegon\",\n    \"image\": null,\n    \"max_age\": \"7d\",\n    \"max_episodes\": 3,\n    \"url\": \"https://feeds.publicradio.org/public_feeds/news-from-lake-wobegon/itunes/rss\"\n}'\n```\n\n- POST `/update`: Trigger a update for subscriptions and removal of expired episodes. The update process will run in the background\n\n```\ncurl -X POST http://localhost:5000/update\n```\n\n## Scheduling\n\nUse cron to schedule hourly updates. Add the following to the crontab.\n\n```\n10 * * * * curl -X POST localhost:5000/update\n```\n\n## Sync to mp3 player\n\n```\nrsync -rvu --modify-window=1  \"/home/bthornto/github/podcastd/Podcasts\" \"/run/media/bthornto/MIBAO-M200\"\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcidrblock%2Fpodcastd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcidrblock%2Fpodcastd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcidrblock%2Fpodcastd/lists"}