iptv-proxy icon indicating copy to clipboard operation
iptv-proxy copied to clipboard

error unmarshalling JSON

Open olobley opened this issue 2 years ago • 18 comments

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 #01: 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 #01: 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

olobley avatar Mar 01 '22 16:03 olobley

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

pierre-emmanuelJ avatar Mar 02 '22 13:03 pierre-emmanuelJ

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

pierre-emmanuelJ avatar Mar 02 '22 13:03 pierre-emmanuelJ

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?

olobley avatar Mar 02 '22 14:03 olobley

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

pierre-emmanuelJ avatar Mar 02 '22 16:03 pierre-emmanuelJ

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?

olobley avatar Mar 03 '22 17:03 olobley

Could this be of help? Similar error: iptv-proxy | Error #01: 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.

MrBamse avatar Mar 06 '22 13:03 MrBamse

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"}}

olobley avatar Mar 06 '22 14:03 olobley

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

MrBamse avatar Mar 19 '22 14:03 MrBamse

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

pierre-emmanuelJ avatar Apr 08 '22 13:04 pierre-emmanuelJ

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

pierre-emmanuelJ avatar Apr 11 '22 17:04 pierre-emmanuelJ

Also getting this in a different spot:

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

gothamtommy avatar Apr 28 '22 01:04 gothamtommy

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

kbnhvn avatar Jun 09 '22 23:06 kbnhvn

I'm having the same issue.

Error #01: 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?

jimmy-1990 avatar Sep 16 '22 23:09 jimmy-1990

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.

r3dbU1L avatar Oct 27 '22 16:10 r3dbU1L

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

ninjaasok avatar Dec 08 '22 10:12 ninjaasok

I’m getting this error now.

Error #01: 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.

thebatfink avatar Jan 13 '23 19:01 thebatfink

Le jeu. 8 déc. 2022, 11:43, Conny Ankargren @.***> a écrit :

Seems like its a handful issues that's all related to this, like #111 https://github.com/pierre-emmanuelJ/iptv-proxy/issues/111, 114 & 137.

— Reply to this email directly, view it on GitHub https://github.com/pierre-emmanuelJ/iptv-proxy/issues/114#issuecomment-1342510474, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFKESUY2FWPHZUPFSGZKZXTWMG3WZANCNFSM5PUTI5CA . You are receiving this because you commented.Message ID: @.***>

kbnhvn avatar Jan 14 '23 02:01 kbnhvn

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.

jonathan-bloodworth avatar Jan 18 '23 10:01 jonathan-bloodworth