2021-07-06 19:01:27 +00:00
# nextcloud-gpodder
2021-12-18 14:18:43 +00:00
Nextcloud app that replicates basic gpodder.net api to sync podcast consumer apps (podcatchers) like AntennaPod.
2021-07-06 19:01:27 +00:00
2021-12-18 14:02:48 +00:00
### Clients supporting sync
| client | support status |
| :- | :- |
2022-04-22 17:55:54 +00:00
| [AntennaPod ](https://antennapod.org ) | Initial purpose for this project, as a synchronization endpoint for this client.< br > Support is available [as of version 2.5.1 ](https://github.com/AntennaPod/AntennaPod/pull/5243/ ). |
2021-12-18 14:02:48 +00:00
| [KDE Kasts ](https://apps.kde.org/de/kasts/ ) | Supported since version 21.12 |
2023-06-05 17:33:56 +00:00
| [Podcast Merlin ](https://github.com/yoyoooooooooo/Podcast-Merlin--Nextcloud-Gpodder-Client-For-Windows ) | Full sync support podcast client for Windows |
2024-01-31 14:01:09 +00:00
| [RePod ](https://apps.nextcloud.com/apps/repod ) | Nextcloud app for playing and managing podcasts with sync support |
2024-08-27 16:14:39 +00:00
| [Cardo ](https://n0vella.github.io/#/cardo ) | Podcast client with sync support, for Windows, Mac and Linux |
2023-11-14 19:06:09 +00:00
| ~~[Garmin Podcasts](https://lucasasselli.github.io/garmin-podcasts/)~~ | Repository archived, app is [no longer available ](https://apps.garmin.com/en-US/apps/b5b85600-0625-43b6-89e9-1245bd44532c ) |
2021-12-18 14:02:48 +00:00
### Installation
Either from the official Nextcloud app store ([link to app page](https://apps.nextcloud.com/apps/gpoddersync)) or by downloading the [latest release ](https://github.com/thrillfall/nextcloud-gpodder/releases/latest ) and extracting it into your Nextcloud apps/ directory.
## API
### subscription
2021-10-05 14:22:56 +00:00
* **get subscription changes**: `GET /index.php/apps/gpoddersync/subscriptions`
* *(optional)* GET parameter `since` (UNIX time)
* **upload subscription changes** : `POST /index.php/apps/gpoddersync/subscription_change/create`
2022-05-23 20:24:51 +00:00
* returns JSON with current timestamp
2021-09-28 09:10:22 +00:00
The API replicates this: https://gpoddernet.readthedocs.io/en/latest/api/reference/subscriptions.html
2022-09-18 22:51:48 +00:00
#### Example requests:
```json
GET /index.php/apps/gpoddersync/subscriptions?since=1633240761
{
"add": [
"https://example.com/feed.xml",
"https://example.org/feed/"
],
"remove": [
"https://example.net/feed.rss"
],
"timestamp": 1663540502
}
```
```json
POST /index.php/apps/gpoddersync/subscription_change/create
{
"add": [
"https://example.com/feed.xml",
"https://example.org/feed/"
],
"remove": [
"https://example.net/feed.rss"
]
}
```
2021-12-18 14:02:48 +00:00
### episode action
2021-10-05 14:22:56 +00:00
* **get episode actions**: `GET /index.php/apps/gpoddersync/episode_action`
* *(optional)* GET parameter `since` (UNIX time)
2021-10-06 15:46:20 +00:00
* fields: *podcast* , *episode* , *guid* , *action* , *timestamp* , *position* , *started* , *total*
* **create episode actions**: `POST /index.php/apps/gpoddersync/episode_action/create`
* fields: *podcast* , *episode* , *guid* , *action* , *timestamp* , *position* , *started* , *total*
* *position*, *started* and *total* are optional, default value is -1
2022-09-18 22:51:48 +00:00
* *guid* is also optional, but should be sent if available
* identification is done by *guid* , or *episode* if *guid* is missing
2021-10-05 14:22:56 +00:00
* returns JSON with current timestamp
2021-09-28 09:10:22 +00:00
2022-09-18 22:51:48 +00:00
The API replicates this: https://gpoddernet.readthedocs.io/en/latest/api/reference/events.html
2021-09-28 09:10:22 +00:00
2021-10-05 14:22:56 +00:00
#### Example requests:
```json
GET /index.php/apps/gpoddersync/episode_action?since=1633240761
{
"actions": [
{
"podcast": "http://example.com/feed.rss",
"episode": "http://example.com/files/s01e20.mp3",
"guid": "s01e20-example-org",
"action": "PLAY",
"timestamp": "2009-12-12T09:00:00",
"started": 15,
"position": 120,
"total": 500
2021-10-06 15:46:20 +00:00
},
{
"podcast": "http://example.com/feed.rss",
"episode": "http://example.com/files/s01e20.mp3",
"guid": "s01e20-example-org",
"action": "DOWNLOAD",
"timestamp": "2009-12-12T09:00:00",
"started": -1,
"position": -1,
"total": -1
},
2021-10-05 14:22:56 +00:00
],
"timestamp": 12345
}
```
```json
POST /index.php/apps/gpoddersync/episode_action/create
[
{
"podcast": "http://example.com/feed.rss",
"episode": "http://example.com/files/s01e20.mp3",
"guid": "s01e20-example-org",
2021-10-06 15:46:20 +00:00
"action": "play",
2021-10-05 14:22:56 +00:00
"timestamp": "2009-12-12T09:00:00",
"started": 15,
"position": 120,
"total": 500
},
{
"podcast": "http://example.org/podcast.php",
"episode": "http://ftp.example.org/foo.ogg",
"guid": "foo-bar-123",
"action": "DOWNLOAD",
"timestamp": "2009-12-12T09:05:21",
}
]
2021-10-06 17:57:50 +00:00
```
2023-02-24 15:49:31 +00:00
## Development
### Testing
- mount project into apps-extra of nextcloud environment (https://github.com/juliushaertl/nextcloud-docker-dev)
- `docker-compose exec nextcloud occ app:enable gpoddersync` enable app so we have database tables
- `docker-compose exec nextcloud phpunit9 -c apps-extra/nextcloud-gpodder/tests/phpunit.xml`