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 unmarshalling JSON #114

Open
olobley opened this issue Mar 1, 2022 · 18 comments
Open

error unmarshalling JSON #114

olobley opened this issue Mar 1, 2022 · 18 comments
Labels
bug Something isn't working

Comments

@olobley
Copy link

olobley commented Mar 1, 2022

Seeing this in the Feb 7th Docker build:

2022/03/01 16:51:47 [iptv-proxy] 2022/03/01 - 16:51:47 | 10.0.5.55 | xtream cache API m3u file
[GIN] 2022/03/01 - 16:51:48 | 500 | 568.289666ms | 10.0.5.55 | GET "/get.php?username=test&password=test&type=m3u_plus&output=ts"
Error #1: error unmarshaling json: json: invalid use of ,string struct tag, trying to unmarshal unquoted value into xtreamcodes.FlexInt
[GIN] 2022/03/01 - 16:53:26 | 500 | 538.754145ms | 10.0.5.55 | GET "/xmltv.php?username=test&password=test"
Error #1: error unmarshaling json: json: invalid use of ,string struct tag, trying to unmarshal unquoted value into xtreamcodes.FlexInt

Happens with both the XMLTV and the get.php calls from clients - anything I can do / look at?
99% sure the authentication/endpoint details are correct

@pierre-emmanuelJ
Copy link
Owner

Hello, I need to investigate again the go.xtream-code package again..etc

@pierre-emmanuelJ pierre-emmanuelJ added the bug Something isn't working label Mar 2, 2022
@pierre-emmanuelJ
Copy link
Owner

do you think you can try to get some JSON data from your API provider?

We should write unit tests on the xtream package to try to cover all the test...etc

@olobley
Copy link
Author

olobley commented Mar 2, 2022

So this provider uses HTTPS for it's XC endpoints...Assuming that the XC back end is the same across providers, I can wireshark a non-https set of calls and then try them against this provider. What's the best way to get the logs to you?

@pierre-emmanuelJ
Copy link
Owner

pierre-emmanuelJ commented Mar 2, 2022

The best way, it's to add a debug mode here:
https://github.com/tellytv/go.xtream-codes

to trace easily the JSON payload...etc (TLS or not)

I'll make a docker image with dev tag to try it on your side...etc

@olobley
Copy link
Author

olobley commented Mar 3, 2022

Thank you!
For the idiots out there (me included), would that mean using a different image in the docker create statement?
I currently use:

docker.pkg.github.com/pierre-emmanuelj/iptv-proxy/iptv-proxy:latest-amd64

What would be the dev one, as all of ones listed here:

https://github.com/pierre-emmanuelJ/iptv-proxy/releases

Seem to be production ones?

@MrBamse
Copy link

MrBamse commented Mar 6, 2022

Could this be of help?
Similar error:
iptv-proxy | Error #1: json: cannot unmarshal array into Go struct field SeriesEpisode.episodes.info of type struct { Audio xtreamcodes.FFMPEGStreamInfo "json:"audio""; Bitrate xtreamcodes.FlexInt "json:"bitrate""; Duration string "json:"duration""; DurationSecs xtreamcodes.FlexInt "json:"duration_secs""; MovieImage string "json:"movie_image""; Name string "json:"name""; Plot string "json:"plot""; Rating xtreamcodes.FlexFloat "json:"rating""; ReleaseDate string "json:"releasedate""; Video xtreamcodes.FFMPEGStreamInfo "json:"video"" }

Just started using iptv-proxy today for xtream so I can't say if it was working before but mainly the client gives a very generic error when trying to view TV shows/series while live seems to work.

@olobley
Copy link
Author

olobley commented Mar 6, 2022

So in an attempt to give you a little more to go on, I pulled the JSON from the player_api.php from some of the services I use. 'interestingly' the two that fail are HTTPS, but I think that could just be coincidence at this point. I've removed the URLs, username/password and subscription dates (they're just unixtime integers):

Works:`

{"user_info":{"username":"<snip>","password":"<snip>","message":"Welcome To Best IPTV Service Provider","auth":1,"status":"Active","exp_date":"<snip>","is_trial":"0","active_cons":"0","created_at":"<snip>","max_connections":"1","allowed_output_formats":["m3u8","ts","rtmp"]},"server_info":{"url":"<snip>","port":"900","https_port":"8080","server_protocol":"http","rtmp_port":"8081","timezone":"UTC","timestamp_now":1646575372,"time_now":"2022-03-06 14:02:52","process":true}}
{"user_info":{"username":"<snip>","password":"<snip>","message":"Enjoy.!!","auth":1,"status":"Active","exp_date":"<snip>","is_trial":"0","active_cons":"0","created_at":"<snip>","max_connections":"4","allowed_output_formats":["m3u8","ts","rtmp"]},"server_info":{"xui":true,"version":"1.5.12","revision":2,"url":"<snip>","port":"80","https_port":"443","server_protocol":"http","rtmp_port":"2092","timestamp_now":1646575379,"time_now":"2022-03-06 14:02:59","timezone":"UTC"}}

Does not work:

{"user_info":{"username":"<snip>","password":"<snip>","message":"Welcome to MytvDigital","auth":1,"status":"Active","exp_date":"<snip>","is_trial":"0","active_cons":0,"created_at":"<snip>","max_connections":"1","allowed_output_formats":["m3u8","ts","rtmp"]},"server_info":{"xui":true,"version":"1.4.16","revision":3,"url":"<snip>","port":"80","https_port":"443","server_protocol":"https","rtmp_port":"8880","timestamp_now":1646575363,"time_now":"2022-03-06 14:02:43","timezone":"Europe\/London"}}
{"user_info":{"username":"<snip>","password":"<snip>","message":"Welcome to Future of Streaming","auth":1,"status":"Active","exp_date":"<snip>","is_trial":"0","active_cons":0,"created_at":"<snip>","max_connections":"2","allowed_output_formats":["m3u8","ts","rtmp"]},"server_info":{"xui":true,"version":"1.5.12","revision":2,"url":"<snip>","port":"80","https_port":"443","server_protocol":"https","rtmp_port":"8880","timestamp_now":1646575351,"time_now":"2022-03-06 14:02:31","timezone":"UTC"}}

@MrBamse
Copy link

MrBamse commented Mar 19, 2022

Any news on this? Any way I can help? :)

@pierre-emmanuelJ
Copy link
Owner

Some xtreamcodes.FlexInt (integer OR string representing an integer) are missing here then, I can fix it then

@pierre-emmanuelJ
Copy link
Owner

BTW: I think I'll fork the repo go.xtream-codes to be more reactive on bugfix...etc

@gothamtommy
Copy link

Also getting this in a different spot:

Error #01: json: cannot unmarshal object into Go value of type []xtreamcodes.Category

@kbnhvn
Copy link

kbnhvn commented Jun 9, 2022

Hi!
Got similar error too:
Error #1: error unmarshaling json: unexpected end of JSON input

@jimmy-1990
Copy link

I'm having the same issue.

Error #1: error unmarshaling json: json: invalid use of ,string struct tag, trying to unmarshal unquoted value into xtreamcodes.FlexInt

Is there any update on the fix for this?

@r3dbU1L
Copy link

r3dbU1L commented Oct 27, 2022

I've got the same issue know.

I thought it was coming from my attempts with nginx and 3 backends, but even in the original variant without nginx it doesn't work now.

@ninjaasok
Copy link

Seems like its a handful issues that's all related to this, like #111, 114 & 137.

@thebatfink
Copy link

I’m getting this error now.

Error #1: error unmarshaling json: json: invalid use of ,string struct tag, trying to unmarshal unquoted value into xtreamcodes.FlexInt

Did the debug docker image get created? What does anyone need, happy to provide data.

@kbnhvn
Copy link

kbnhvn commented Jan 14, 2023 via email

@jonathan-bloodworth
Copy link

jonathan-bloodworth commented Jan 18, 2023

Hi all,

Same issue here, been happening for a few weeks now.

"Error #01: error unmarshaling json: json: invalid use of ,string struct tag, trying to unmarshal unquoted value into xtreamcodes.FlexInt"

Seems to be throwing this when getting categories (live/movie/tv).

Happy to provide any further logs or try a new version of the proxy, already tried rolling back to a previous version but no joy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants