Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error parsing Jellyfin response. #11

Closed
jpuerto opened this issue Jan 6, 2023 · 5 comments
Closed

Error parsing Jellyfin response. #11

jpuerto opened this issue Jan 6, 2023 · 5 comments

Comments

@jpuerto
Copy link

jpuerto commented Jan 6, 2023

I/flutter (23107): ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (23107): │ #0   _MainMenuState.build.<anonymous closure> (package:jellybook/screens/MainScreens/mainMenu.dart:512:26)
I/flutter (23107): │ #1   _FutureBuilderState.build (package:flutter/src/widgets/async.dart:616:55)
I/flutter (23107): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
I/flutter (23107): │ ⛔ Error: FormatException: Unexpected character (at character 1)
I/flutter (23107): │ ⛔ <html>
I/flutter (23107): │ ⛔ ^
I/flutter (23107): │ ⛔ 
I/flutter (23107): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
@jpuerto
Copy link
Author

jpuerto commented Jan 6, 2023

Screenshot_20230106-184526_JellyBook

@jpuerto
Copy link
Author

jpuerto commented Jan 8, 2023

I got an error status 400 (bad request). So authentication works but somehow it the request is not being able to be processed by Jellyfin server. I did not found anything in Jellyfin logs.

As concept I have created an automatic Jellifin client generation with openapi_generator plugin based on the specs from version 10.8.8 from https://api.jellyfin.org/openapi/.

I had no time to test it, but if the automatic client works, the openapi.json file can be edited with a sub set of methods that are useful for Jellybook only.

The branch with the changes is here: https://github.com/jpuerto/JellyBook/tree/openapi-client

@Kara-Zor-El
Copy link
Member

I'll take a look into a openapi generated API. I think what might be better to do is to have all the modules there and as a package and then have it used as a dependency in this project. will have to explore further tho.

jpuerto pushed a commit to jpuerto/JellyBook that referenced this issue Jan 11, 2023
…ader on Jellyfin when URL contains a path.
@jpuerto
Copy link
Author

jpuerto commented Jan 11, 2023

I'll take a look into a openapi generated API. I think what might be better to do is to have all the modules there and as a package and then have it used as a dependency in this project. will have to explore further tho.

I think it could be a good help, I have used a similar approach in others projects with great results. I created it because I realized that the Jellifin REST API documentation is really bad. Even the openapi specs are invalid (I had to fix it locally).

Anyway, it seems to be working fine with the patch I created. Problem seems to be when populating the "Host" header if the URL contains a subpath, like it is my case. It should work fine for all cases now.

Kara-Zor-El added a commit that referenced this issue Jan 12, 2023
#11: Fix bad request status due to bad value of "Host" header on Jell…
@Kara-Zor-El
Copy link
Member

fixed in #15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants