Coder Social home page Coder Social logo

yogiliu / podmaker Goto Github PK

View Code? Open in Web Editor NEW
12.0 1.0 2.0 272 KB

Convert online media into podcast feeds.

Home Page: https://pypi.org/project/podmaker

License: The Unlicense

Python 100.00%
podcast rss youtube playlist podcast-feed podcast-fetcher podcast-generator podcast-manager podcast- podmaker

podmaker's Introduction

Podmaker

Read this document in other languages: English, 简体中文

Convert online media into podcast feeds.

PyPI - Version PyPI - Status PyPI - Python Version PyPI - Implementation PyPI - License

Features

  • Extract audio from online videos.
  • No need to deploy web services.
  • Generate podcast feeds.
  • Deploy with watch mode to keep feeds up-to-date.

Dependencies

This tool uses ffmpeg to extract audio from videos. Ensure it's installed within $PATH before using this tool.

Additionally, you should install extra dependencies according to your requirements:

  • podmaker[all]: Install all extra dependencies.
  • podmaker[s3]: Install dependencies for S3 storage.
  • podmaker[youtube]: Install dependencies for YouTube.

Install multiple extra dependencies simultaneously using podmaker[extra1,extra2,...].

Configuration

Before diving into this tool, craft a configuration file, a TOML file to be precise. By default, the file resides at ${WORK_DIR}/config.toml. Customize the path using the -c or --config option. An example configuration file can be found at config.example.toml.

Usage

Systemd

Deploy this tool in the background with systemd (requires root privileges):

# create virtual environment
apt install python3 python3-venv
mkdir -p /opt/podmaker && cd /opt/podmaker
python3 -m venv venv

# install podmaker
./venv/bin/pip install "podmaker[all]"

# create and edit config file
curl -o config.toml https://raw.githubusercontent.com/YogiLiu/podmaker/main/config.example.toml
vim config.toml

# create systemd service
curl -o /etc/systemd/system/podmaker.service https://raw.githubusercontent.com/YogiLiu/podmaker/main/systemd/podmaker.service
systemctl daemon-reload

# enable and start service
systemctl enable podmaker
systemctl start podmaker

Manual

Using pip

For the optimal experience, we recommend installing this tool within a virtual environment.

pip install "podmaker[all]"

Using pipx

pipx install "podmaker[all]"

Run

podmaker -c path/to/config.toml

or

python -m podmaker -c path/to/config.toml

Roadmap

Platforms

  • YouTube
    • Playlist
    • Channel
  • BiliBili

Resource Hosting

  • S3
  • Local

Contributing

Your contributions are invaluable. Feel free to submit pull requests. Before committing, ensure your changes pass unit tests and autohooks.

To activate autohooks, use the following command:

poetry run autohooks activate --mode poetry

This process will automatically lint, format, and sort code imports.

When introducing new features, remember to provide corresponding tests.

License

For licensing details, refer to LICENSE.

podmaker's People

Contributors

yogiliu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

rajdeep7 coffiner

podmaker's Issues

Move execution to Task class, and support task hook

def _execute(self, source: SourceConfig) -> None:
logger.info(f'execute: {source.id}')
try:
key = source.get_storage_key('feed.rss')
task = self._get_task(source)
with ThreadPoolExecutor() as executor:
original_f = executor.submit(self._fetch_original, key)
new_f = executor.submit(task.start)
original = original_f.result() # type: Podcast | None
new = new_f.result()
if original:
has_changed = original.merge(new)
else:
has_changed = True
original = new
if has_changed:
buf = BytesIO(original.bytes)
self._storage.put(buf, key, content_type='application/rss+xml')
except Exception as e:
logger.error(f'{source.id}: {e}')

Meanwhile, implement before_hook and after_hook for task object.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.