Hamuko / anifunnel

Update your Anilist watching list automatically using Plex webhooks.
Apache License 2.0
22 stars 0 forks source link

Unable to parse payload #5

Closed acffordyce973 closed 4 months ago

acffordyce973 commented 4 months ago

I haven't been able to get this working for two anifunnel versions now (having not used this before that). I'm using anifunnel-x86_64-unknown-linux-gnu-1.3.0.tar.gz, running ./anifunnel with my AniList token, and able to see my watching list on the web interface. I have tried with a webhook set to 127.0.0.1, the LAN IP, and even port forwarded from external. When I watch an episode in Plex that should track, I get the following warning, and it does not update:

2024-07-13T14:01:47.190Z INFO  [rocket::server] POST / multipart/form-data:
2024-07-13T14:01:47.190Z INFO  [rocket::server::_] Matched: (scrobble) POST /
2024-07-13T14:01:47.190Z WARN  [anifunnel] Unable to parse payload
2024-07-13T14:01:47.190Z INFO  [rocket::server::_] Outcome: Success(200 OK)
2024-07-13T14:01:47.190Z INFO  [rocket::server::_] Response succeeded.
Hamuko commented 4 months ago

Can you post what you get with RUST_LOG environment variable set to debug?

acffordyce973 commented 4 months ago
024-07-13T14:28:28.624Z DEBUG [rocket::server] Received request: Request {
    method: POST,
    uri: /,
    version: HTTP/1.1,
    headers: {
        "host": "127.0.0.1:8000",
        "user-agent": "PlexMediaServer/1.40.3.8555-fef15d30c",
        "accept": "*/*",
        "accept-encoding": "gzip",
        "content-length": "7257",
        "content-type": "multipart/form-data; boundary=------------------------YYeTZXFOP5FtrUvrdzuI1O",
    },
    body: Body(
        Streaming,
    ),
}
2024-07-13T14:28:28.624Z INFO  [rocket::server] POST / multipart/form-data:
2024-07-13T14:28:28.624Z INFO  [rocket::server::_] Matched: (scrobble) POST /
2024-07-13T14:28:28.624Z WARN  [anifunnel] Unable to parse payload
2024-07-13T14:28:28.624Z DEBUG [anifunnel] missing field `grandparentTitle` at line 1 column 1125
2024-07-13T14:28:28.624Z INFO  [rocket::server::_] Outcome: Success(200 OK)
2024-07-13T14:28:28.624Z DEBUG [rocket::server] sending response: Response {
    status: 200,
    version: HTTP/1.1,
    headers: {
        "content-type": "text/plain; charset=utf-8",
        "server": "Rocket",
        "x-frame-options": "SAMEORIGIN",
        "permissions-policy": "interest-cohort=()",
        "x-content-type-options": "nosniff",
        "content-length": "5",
    },
    body: Body(
        Streaming,
    ),
}
2024-07-13T14:28:28.624Z INFO  [rocket::server::_] Response succeeded.
2024-07-13T14:28:28.632Z DEBUG [rocket::server] Received request: Request {
    method: POST,
    uri: /,
    version: HTTP/1.1,
    headers: {
        "host": "192.168.94.204:8000",
        "user-agent": "PlexMediaServer/1.40.3.8555-fef15d30c",
        "accept": "*/*",
        "accept-encoding": "gzip",
        "content-length": "7257",
        "content-type": "multipart/form-data; boundary=------------------------LfJk7cPxn5cowktG29wdyP",
    },
    body: Body(
        Streaming,
    ),
}
2024-07-13T14:28:28.634Z INFO  [rocket::server] POST / multipart/form-data:
2024-07-13T14:28:28.634Z INFO  [rocket::server::_] Matched: (scrobble) POST /
2024-07-13T14:28:28.634Z WARN  [anifunnel] Unable to parse payload
2024-07-13T14:28:28.634Z DEBUG [anifunnel] missing field `grandparentTitle` at line 1 column 1125
2024-07-13T14:28:28.634Z INFO  [rocket::server::_] Outcome: Success(200 OK)
2024-07-13T14:28:28.634Z DEBUG [rocket::server] sending response: Response {
    status: 200,
    version: HTTP/1.1,
    headers: {
        "content-type": "text/plain; charset=utf-8",
        "server": "Rocket",
        "x-frame-options": "SAMEORIGIN",
        "permissions-policy": "interest-cohort=()",
        "x-content-type-options": "nosniff",
        "content-length": "5",
    },
    body: Body(
        Streaming,
    ),
}
2024-07-13T14:28:28.634Z INFO  [rocket::server::_] Response succeeded.
2024-07-13T14:28:32.272Z DEBUG [rocket::server] Received request: Request {
    method: POST,
    uri: /,
    version: HTTP/1.1,
    headers: {
        "host": "127.0.0.1:8000",
        "user-agent": "PlexMediaServer/1.40.3.8555-fef15d30c",
        "accept": "*/*",
        "accept-encoding": "gzip",
        "content-length": "1313",
        "content-type": "multipart/form-data; boundary=------------------------s0MsUl7xX5SUe5YAiX1Bv5",
    },
    body: Body(
        Streaming,
    ),
}
2024-07-13T14:28:32.272Z INFO  [rocket::server] POST / multipart/form-data:
2024-07-13T14:28:32.272Z INFO  [rocket::server::_] Matched: (scrobble) POST /
2024-07-13T14:28:32.272Z WARN  [anifunnel] Unable to parse payload
2024-07-13T14:28:32.272Z DEBUG [anifunnel] missing field `grandparentTitle` at line 1 column 1126
2024-07-13T14:28:32.272Z INFO  [rocket::server::_] Outcome: Success(200 OK)
2024-07-13T14:28:32.272Z DEBUG [rocket::server] sending response: Response {
    status: 200,
    version: HTTP/1.1,
    headers: {
        "content-type": "text/plain; charset=utf-8",
        "server": "Rocket",
        "x-frame-options": "SAMEORIGIN",
        "permissions-policy": "interest-cohort=()",
        "x-content-type-options": "nosniff",
        "content-length": "5",
    },
    body: Body(
        Streaming,
    ),
}
2024-07-13T14:28:32.272Z INFO  [rocket::server::_] Response succeeded.
2024-07-13T14:28:32.274Z DEBUG [rocket::server] Received request: Request {
    method: POST,
    uri: /,
    version: HTTP/1.1,
    headers: {
        "host": "192.168.94.204:8000",
        "user-agent": "PlexMediaServer/1.40.3.8555-fef15d30c",
        "accept": "*/*",
        "accept-encoding": "gzip",
        "content-length": "1313",
        "content-type": "multipart/form-data; boundary=------------------------DNcmGO2niCQj5c44R5v5ut",
    },
    body: Body(
        Streaming,
    ),
}
2024-07-13T14:28:32.274Z INFO  [rocket::server] POST / multipart/form-data:
2024-07-13T14:28:32.274Z INFO  [rocket::server::_] Matched: (scrobble) POST /
2024-07-13T14:28:32.274Z WARN  [anifunnel] Unable to parse payload
2024-07-13T14:28:32.274Z DEBUG [anifunnel] missing field `grandparentTitle` at line 1 column 1126
2024-07-13T14:28:32.274Z INFO  [rocket::server::_] Outcome: Success(200 OK)
2024-07-13T14:28:32.274Z DEBUG [rocket::server] sending response: Response {
    status: 200,
    version: HTTP/1.1,
    headers: {
        "content-type": "text/plain; charset=utf-8",
        "server": "Rocket",
        "x-frame-options": "SAMEORIGIN",
        "permissions-policy": "interest-cohort=()",
        "x-content-type-options": "nosniff",
        "content-length": "5",
    },
    body: Body(
        Streaming,
    ),
}
2024-07-13T14:28:32.274Z INFO  [rocket::server::_] Response succeeded.
acffordyce973 commented 4 months ago

The Library type in question is Other Videos and there's no proper folder structure or naming schemes. This is for airin anime that comes in and is watched same day. All Plex has to go on is the filename, and from seeing the debug log, I believe the Plex webhook does not send this?

Hamuko commented 4 months ago

Yeah, anifunnel is designed to work with actual Plex TV shows and grandparentTitle is the field that contains the show's name. There's no filename handling inside anifunnel.