Skip to main content

A simple tool to generate Podcast-like RSS feeds from youtube (or other youtube-dl supported services) channels, using youtube-dl/yt-dlp

Project description

Pypi Version Shield Pypi License Shield

ydl-podcast

A simple tool to generate Podcast-like RSS feeds from youtube (or other youtube-dl supported services) channels, using youtube-dl.

Setup

Install package with requirements:

Youtube-dl:

pip install ydl-podcast[youtube-dl]

yt-dlp:

pip install ydl-podcast[yt-dlp]

Configuration

Edit the config.yaml file to list your podcast sources and configure them, as well as edit general configuration.

Example config file

The available settings are the following.

General settings

  • output_dir: local directory where the downloaded media will be stored, and the podcast xml files generated.
  • url_root: root url for the static files (used in the generation of the XML to point to the media files.
  • subscriptions: a list of feeds to subscribe to.
  • youtube-dl-module: Alternative youtube-dl python module. By default, this uses youtube-dl, but can leverage forks such as yt-dlp.

Feed settings

Mandatory

  • name NAME: Name of the podcast source. Used as the podcast title, and media directory name.
  • url URL: source url for the youtube (or other) channel.

Optional

  • audio_only True/False: if True, audio will be extracted from downloaded videos to create an audio podcast.
  • retention_days N: only download elements newer than N days, and automatically delete elements older.
  • download_last N: only download the latest N videos.
  • initialize True/False: if True, then downloads everything on the first run, no matter the download_last or retention_days specified.
  • output_dir: local directory where the downloaded media will be stored, and the podcast xml files generated.
  • url_root: root url for the static files (used in the generation of the XML to point to the media files.
  • format: file format to force youtube-dl to use (eg mp4, webm, mp3 for audio only…)
  • best: force best quality (only useful when specifying a format).
  • ydl_options: list of raw youtube-dl options to use. For experienced users, since this will likely yield issues if not understood.
  • nfo_files: generates nfo files for subscriptions and downloaded episodes (simulates a "tvshow" nfo for the subscription and "tvshow episode" for each video). This helps plex, kodi, jellyfin import correct metadata. Does NOT support audio_only feeds at this point.
  • skip_download: Don't perform download, just generate the Atom feed from the existing files. Mandatory url parameter can be skipped if skip_download is set to true
  • download_as_playlist: Pass the url to the downloader directly, without processing the metadata of each item in the playlist. This is helpful with generic urls, and a few specific extractors.

Usage

Using cron or your favorite scheduler, run:

ydl-podcast [-c configfile.yaml]

You can then use your favorite web server to serve the files (a good idea is to exclude the *.json and *.part files from being served as the first might leak information, and the second is unnecessary.

eg with nginx:

root /var/www/static/podcasts/;
location ~ (\.json$|\.part$) {
  return 403;
}

Command line arguments

usage: ydl-podcast [-h] [-v] [-c CONFIG] [-j JSON_CONFIG] [-f FILTER] [-e EXCLUDE]

options:
  -h, --help            show this help message and exit
  -v, --version         Show version and exit
  -c CONFIG, --config CONFIG
                        Configuration file
  -j JSON_CONFIG, --json-config JSON_CONFIG
                        Configuration string in JSON format
  -f FILTER, --filter FILTER
                        Filter subscriptions
  -e EXCLUDE, --exclude EXCLUDE
                        Exclude subscriptions

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

ydl_podcast-1.4.2.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

ydl_podcast-1.4.2-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file ydl_podcast-1.4.2.tar.gz.

File metadata

  • Download URL: ydl_podcast-1.4.2.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.4 Linux/5.4.0-174-generic

File hashes

Hashes for ydl_podcast-1.4.2.tar.gz
Algorithm Hash digest
SHA256 84928ebff5616c3fcc33c6e4a96ca9e9d8b9b65dc6aa966ad637773a5738d962
MD5 317f9c585af9bfddb46a7dd8566a80da
BLAKE2b-256 f48c8682eac6d0c57e2627b02b9ecfe2f436eeb45709fddc8b131dce79a721ae

See more details on using hashes here.

File details

Details for the file ydl_podcast-1.4.2-py3-none-any.whl.

File metadata

  • Download URL: ydl_podcast-1.4.2-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.4 Linux/5.4.0-174-generic

File hashes

Hashes for ydl_podcast-1.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 582c29fb6bf0a42a5c221a8d2ce89946221a8c6b7553d9e871f01a58a9ac833d
MD5 5a357d35237f52f38fa6df078634743d
BLAKE2b-256 84b18dc108f78f3d26e7d02ec17d0ba6a41863cf7425fc8f874fdba54fcee9d6

See more details on using hashes here.

Supported by

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