DirtyRacer1337 / Jellyfin.Plugin.Stash

Pulls data from your Stash using the filename to query on
MIT License
38 stars 9 forks source link

Unable to Parse Path from Json #15

Closed PenDrag0n6989 closed 1 month ago

PenDrag0n6989 commented 9 months ago

Getting this error in Jellyfin logs when trying to pull the metadata from stashapp

Error Message

[00:49:51] [ERR] [105] Stash.Plugin: Error GetDataFromAPI "$Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
   at Newtonsoft.Json.JsonTextReader.ParseValue()
   at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)
   at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)
   at Stash.Providers.StashAPI.GetDataFromAPI(String query, CancellationToken cancellationToken)"

Path naming convention

{Site TitleSlug} - {Release-Date} - {Episode Title} [{Quality.Title}]/{Site.TitleSlug}.{Release-Date}.{PerformersFemale}.{Episode.Title}.{Quality.Title}

Example

 Site- 2022-09-18 - Title [WEBDL-2160p]\Site.2022-09-18.Firstname.Lastname.Title.WEBDL-2160p.mp4
fangly-fish commented 1 month ago

I'm seeing the same. Just installed the latest dev build (reports as 1.1.0.2 in the UI, with Emby 4.8 fix). My files are organized for use with Whisparr (v2). Here is a screenshot of my directory structure and file naming.

image

DirtyRacer1337 commented 1 month ago

your server return html instead json, problem on your side

fangly-fish commented 1 month ago

I'm using stashdb.org, using the endpoint and api key from https://stashdb.org/users/

2024-09-23 10:31:19.366 Debug App: Running Movies for /volume1/EmbyMedia/Scenes/Wicked/Wicked - 2024-02-02 - Phantasia Episode 1 - Phantasm [WEBDL-2160p].mp4
2024-09-23 10:31:19.366 Debug Stash: Requesting GET "https://stashdb.org/graphql/graphql?query=query%7BfindScenes%28filter%3A%7Bq%3A%22Wicked%22%7D%29%7Bscenes%7Bid%2Ctitle%2Cdate%2Cpaths%7Bscreenshot%7D%7D%7D%7D"
2024-09-23 10:31:19.510 Error Stash: Error GetDataFromAPI "$Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
   at Newtonsoft.Json.JsonTextReader.ParseValue()
   at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)
   at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)
   at Stash.Providers.StashAPI.GetDataFromAPI(String query, CancellationToken cancellationToken)"

When I try the call manually with CLI I get an error to enable javascript

$ curl -H "authorization: bearer ${token}" 'https://stashdb.org/graphql/graphql?query=query%7BfindScenes%28filter%3A%7Bq
%3A%22Wicked%22%7D%29%7Bscenes%7Bid%2Ctitle%2Cdate%2Cpaths%7Bscreenshot%7D%7D%7D%7D'
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1"
    />
    <meta name="theme-color" content="#000000" />
    <link rel="manifest" href="/manifest.json" />
    <title>StashDB</title>
    <script type="module" crossorigin src="/assets/index-9ad42494.js"></script>
    <link rel="stylesheet" href="/assets/index-0d163314.css">
  </head>
  <body>
    <noscript>You need to enable JavaScript to run this app.</noscript>
    <div id="root"></div>

  </body>
</html>

Actually I just noticed that graphql is there twice in the url. So I tried using just https://stashdb.org as the endpoint and that changes the error in the logs to this

2024-09-23 10:46:53.009 Debug App: Running Movies for /volume1/EmbyMedia/Scenes/Wicked/Wicked - 2024-02-02 - Phantasia Episode 1 - Phantasm [WEBDL-2160p].mp4
2024-09-23 10:46:53.009 Debug Stash: Requesting GET "https://stashdb.org/graphql?query=query%7BfindScenes%28filter%3A%7Bq%3A%22Wicked%22%7D%29%7Bscenes%7Bid%2Ctitle%2Cdate%2Cpaths%7Bscreenshot%7D%7D%7D%7D"
2024-09-23 10:46:53.152 Error Stash: Error GetDataFromAPI "$Cannot query field "findScenes" on type "Query". Did you mean "findScene", "findSite", "findStudio", "queryScenes", or "findEdit"?"

Returning to CLI and changing from findScenes to findScene returns this

$ curl -H "authorization: bearer ${token}" 'https://stashdb.org/graphql?query=query%7BfindScene%28filter%3A%7Bq%3A%22Wic
ked%22%7D%29%7Bscenes%7Bid%2Ctitle%2Cdate%2Cpaths%7Bscreenshot%7D%7D%7D%7D'
{"errors":[{"message":"Cannot query field \"scenes\" on type \"Scene\".","locations":[{"line":1,"column":38}],"extensions":{"code":"GRAPHQL_VALIDATION_FAILED"}},{"message":"Unknown argument \"filter\" on field \"Query.findScene\".","locations":[{"line":1,"column":7}],"extensions":{"code":"GRAPHQL_VALIDATION_FAILED"}},{"message":"Field \"findScene\" argument \"id\" of type \"ID!\" is required, but it was not provided.","locations":[{"line":1,"column":7}],"extensions":{"code":"GRAPHQL_VALIDATION_FAILED"}}],"data":null
DirtyRacer1337 commented 1 month ago

https://stashdb.org/graphql/graphql plus it's for stash not stashbox

fangly-fish commented 1 month ago

it's for stash not stashbox

Ah. Ok then.