bobrippling / podsync

4 stars 1 forks source link

Feature Request: Support Kast #1

Closed luctius closed 1 year ago

luctius commented 1 year ago

Please add support for the Kast Podcast Client: https://apps.kde.org/kasts/

When it tries to connect to your server, it bails on an error. The server's log is (RUST_LOG=trace):

TRACE tracing::span::active > -> Server::run; TRACE mio::poll > registering event source with poller: token=Token(1), interests=READABLE | WRITABLE TRACE tracing::span::active > <- Server::run; TRACE hyper::proto::h1::conn > Conn::read_head TRACE hyper::proto::h1::io > received 217 bytes TRACE tracing::span > parse_headers; TRACE tracing::span::active > -> parse_headers; TRACE hyper::proto::h1::role > Request.parse bytes=217 TRACE hyper::proto::h1::role > Request.parse Complete(217) TRACE tracing::span::active > <- parse_headers; TRACE tracing::span > -- parse_headers; DEBUG hyper::proto::h1::io > parsed 6 headers DEBUG hyper::proto::h1::conn > incoming body is empty TRACE warp::filters::method > method::POST?: GET TRACE warp::filters::method > method::POST?: GET TRACE warp::filters::path > "api"?: "api" TRACE warp::filters::path > "2"?: "2" TRACE warp::filters::path > "devices"?: "devices" TRACE warp::filters::path > param?: "blaat.json" TRACE warp::filters::method > method::GET?: GET TRACE warp::filters::header > header2("cookie") TRACE warp::filters::path > "api"?: "api" TRACE warp::filters::path > "2"?: "2" TRACE warp::filters::path > "devices"?: "devices" TRACE warp::filters::path > param?: "blaat.json" TRACE warp::filters::path > param?: "" TRACE warp::filters::path > "api"?: "api" TRACE warp::filters::path > "2"?: "2" TRACE warp::filters::path > "subscriptions"?: "devices" TRACE warp::filters::path > "api"?: "api" TRACE warp::filters::path > "2"?: "2" TRACE warp::filters::path > "subscriptions"?: "devices" TRACE warp::filters::path > "api"?: "api" TRACE warp::filters::path > "2"?: "2" TRACE warp::filters::path > "episodes"?: "devices" TRACE warp::filters::path > "api"?: "api" TRACE warp::filters::path > "2"?: "2" TRACE warp::filters::path > "episodes"?: "devices" INFO podsync::warp > 127.0.0.1:34126 2023-03-28T21:27:59Z "GET /api/2/devices/blaat.json HTTP/1.1" 400 "-" "Kasts/23.01; Syndication" 623.023µs DEBUG warp::filter::service > rejected: Rejection([InvalidHeader { name: "cookie" }, MethodNotAllowed, MethodNotAllowed]) TRACE tracing::span > encode_headers; TRACE tracing::span::active > -> encode_headers; TRACE hyper::proto::h1::role > Server::encode status=400, body=Some(Known(31)), req_method=Some(GET) TRACE tracing::span::active > <- encode_headers; TRACE tracing::span > -- encode_headers; TRACE hyper::proto::h1::io > buffer.queue self.len=126 buf.len=31 DEBUG hyper::proto::h1::io > flushed 157 bytes TRACE hyper::proto::h1::conn > flushed({role=server}): State { reading: Init, writing: Init, keep_alive: Idle }

I'm mainly trying to sync between antennapod and a good pc podcast client. Ideally Kast, but if you have another good linux supported client suggestion; I'm all ears.

bobrippling commented 1 year ago

Sounds like a plan - this issue appears to be that Kasts uses basic auth on each request, rather than remembeing cookies given back by the server for non-login endpoints.

To fix it would require altering the existing auth structure of the code to handle either a cookie or basic-auth, is this something you'd feel comfortable in discussing and changing?

Kasts also appears to require support for:

Although we might be able to get an initial proof-of-concept working without this sync-devices endpoint, depending on whether Kasts needs it for a full sync.

(as for other podcast clients, I haven't any other recommendations for a desktop one)

luctius commented 1 year ago

To fix it would require altering the existing auth structure of the code to handle either a cookie or basic-auth, is this something you'd feel comfortable in discussing and changing?

I'm working on something; though I don't have much experience in either warp nor http, so it will require some percussive encouragement ;-).

When that is done, I'll submit a PR and we can discus the rest.

bobrippling commented 1 year ago

Sounds like a plan! Let me know if you want to talk over anything in the meanwhile - I find warp can be a bit opaque sometimes