Giter VIP home page Giter VIP logo

podcast-playlist's Introduction

podcast-playlist

This project exists to help me transition podcast listening from PodcastAddict to a Tangara. Ultimately it will tie into whatever process the companion app uses to transfer media and playlists to the device and scrobbling back off.

podcast-playlist currently supports fetching feeds, downloading episodes, building playlists and tracking listen history. It's probably 'good enough' to use, but I've not fully used it in anger yet, so there's likely quirks and bugs yet to be discovered!

Install

This assumes you have node/npm installed.

  1. Clone the repo
  2. npm i
  3. npm run build
  4. node .\dist\index.js

Usage

Invoke podcast-playlist with node .\dist\index.js. The documentation below just shows the subsequent commands (i.e. feed list means node .\dist\index.js feed list).

To get stuck in you can use --help for any (sub)command to get help.

Data

Data is by default stored in ./data. To change this set the environment variable PODCASTPLAYLISTDIR.

All the data is plain JSON files in a (hopefully!) sensible folder structure, with audio files in cache/podcastname directories.

Ingestion

Subscriptions

Unless you're starting completely from scratch, you probably have some existing subscriptions to import. OPML files are supported for this, or you can just use RSS fees URLs:

For ingestion, create a configuration file listing any OPML files or RSS feeds you want to add:

Configuration file:

{
    "opml": [
        "A:/Path/To/File.opml"
    ],
    "rss": [
        "https://example.com/rss"
    ]
}

Then

ingest --path "./config.json"

History

Items in the history are skipped when creating playlists.

If you have a previous listen history from Podcast Addict, you can import the sqlite database (App settings > Backup / Restore) to add your listen history:

history import --podcastAddict "<path/to/export.db>"

Otherwise, you can add entire feeds to the history with history feed --name "feedname" or mark all episodes in a playlist as played - history import --playlist "path/to/playlist.m3u"

Feed updates and the cache

You can refresh feeds using cache refresh. This will re-download all the RSS feeds.

To have episodes added to the cache, run cache update. Note that this will download all uncached episodes. To avoid this you can run update cache skip to mark episodes you don't want downloaded:

# Don't cache any episodes that are in the history
node .\dist\index.js cache skip --history
# Don't cache any episodes in the feed "EXAMPLE"
node .\dist\index.js cache skip --feed "EXAMPLE"
# Don't cache any episodes present in the feeds currently
node .\dist\index.js cache skip --all

You can also manually curate a history JSON and replace the one in the root data directory if you need more control:

{
    "_items": [
        {
            "_episodeName": "Episode title as it appears in the feed",
            "_episodeURL": "https://example.com/this/can/also/be/null.rss",
            "_listenDate": "2016-03-22T08:51:47.453Z",
            "_podcastName": "Name of the podcast as it appears in the feed",
            "_podcastId": null
        }
    ],
    ...
}

Audio

Importing existing audio files is being tracked in issue #15.

Playlist creation

To create a playlist, create a configuration file like below:

Configuration file:

{
    "playlist": {
        "include": [
            {
                "name": "Hello From The Magic Tavern",
                "exclude": [
                    "^Introducing"
                ],
                "ordered": true
            },
            {
                "name": "Pitch, Please",
                "ordered": false
            }
        ],
        "episodeTitleFilters": [
            "^BONUS.*"
        ],
        "count": 4
    }
}

Then invoke the creation:

playlist create --title playlist_name --configPath .\playlist_config.json --local

If you don't want the files downloaded, and just want the playlist to point to the URL of the episodes, drop the --local.

podcast-playlist's People

Contributors

slord6 avatar

Watchers

 avatar

podcast-playlist's Issues

Verbosity setting

The applicaion is pretty chatty at the moment and so verbosity flags are probably worthwhile

Import existing audio to cache

If existing files are either named correctly, or have metadata set (see #14), we should be able to process+import them into the cache.

As long as the episode title is accurate to the current rss feed item title (not always true) then we can just copy & rename as if it was just downloaded.

Add playlist to history incorrectly treats playlist as an sqlite db

PS D:\...\podcast-playlist>node .\dist\index.js history import --playlist .\data\playlists\test_playlist_4\test_playlist_4.m3u
Importing history from .\data\playlists\test_playlist_4\test_playlist_4.m3u
(PodcastAddictImporter)Database loading from .\data\playlists\test_playlist_4\test_playlist_4.m3u
(PodcastAddictImporter)Extracting history from DB...
(PodcastAddictImporter)DB query failed: Error: SQLITE_NOTADB: file is not a database
Import failed. Error: SQLITE_NOTADB: file is not a database
--> in Database#each('SELECT episodes.name as episodeName,episodes.url as episodeUrl,podcasts.name as podcastName,playbackDate,podcast_id from episodes INNER JOIN podcasts on podcast_id = podcasts._id WHERE playbackDate > 0', [Function (anonymous)], [Function (anonymous)])
    at Database.<anonymous> (D:\samlo\Documents\Repos\podcast-playlist\dist\ingestion\podcastAddictHistoryImporter.js:51:29)
    at D:\samlo\Documents\Repos\podcast-playlist\dist\ingestion\podcastAddictHistoryImporter.js:50:25
    at new Promise (<anonymous>)
    at PodcastAddictHistoryImporter.<anonymous> (D:\samlo\Documents\Repos\podcast-playlist\dist\ingestion\podcastAddictHistoryImporter.js:48:20)
    at Generator.next (<anonymous>)
    at D:\samlo\Documents\Repos\podcast-playlist\dist\ingestion\podcastAddictHistoryImporter.js:31:71
    at new Promise (<anonymous>)
    at __awaiter (D:\samlo\Documents\Repos\podcast-playlist\dist\ingestion\podcastAddictHistoryImporter.js:27:12)
    at PodcastAddictHistoryImporter.extract (D:\samlo\Documents\Repos\podcast-playlist\dist\ingestion\podcastAddictHistoryImporter.js:46:16) {
  errno: 26,
  code: 'SQLITE_NOTADB',
  __augmented: true
}

Additional cache skip controls

  • Skip feed episodes matching/prior to regex
  • Skip feed episodes prior to latest history

Use case being episode in a feed, eg preview episodes for a premium feed, that someone isn't interested in or an incomplete history import or ability to skip a season

Good test podcasts for this:
Hey Riddle Riddle (patron previews)
Triforce (old yogpod episodes)
F-Face (weird seasons)

Add metadata to downloaded audio files

We should be able to add metadata to the downloaded audio.

For node, it looks like the main way is to call out to ffmpeg, which isn't ideal, but would be good enough for a first pass.

There's a wrapper for this which looks promising - discussion of alternatives.

For ensuring ffmpeg is installed, there's ffmpeg-static

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.