erkexzcx / stalkerhek

Stalker portal proxy server that allows sharing account on multiple STB boxes and play on VLC.
GNU General Public License v3.0
82 stars 52 forks source link

Failed to update channel #6

Closed Onemars closed 3 years ago

Onemars commented 3 years ago

request_iptv.go:25: Failed to update channel: invalid character 'A' looking for beginning of value

erkexzcx commented 3 years ago

It means "Unauthorized". Seems this error message is consistent across all different versions/portals of Stalker. I might implement a proper error message sometime in the future.

erkexzcx commented 3 years ago

Looks like this happens when you don't provide credentials and this application does not perform authorization against Stalker portal.

With latest commits it always attempts to authorize against Stalker portal, therefore producing more appropriate response message, even if username and password is empty. Test latest code and let me know what output you get.

If it still doesn't work - feel free to send me details to erikmnkl@gmail.com so I can debug it. Wireshark dump containing those URLs would be appreciated.

aplayerv1 commented 3 years ago

Edit channels.go file

go to line 45 and comment out return "", errors.New("Stalker portal returned invalid link to TV Channel: " + tmp.Js.Cmd)

and replace it with

return tmp.Js.Cmd, nil

thats how i fixed it

zalim1 commented 3 years ago

Thanks, I will try that and let you know

erkexzcx commented 3 years ago

So you are telling me that this part:

    strs := strings.Split(tmp.Js.Cmd, " ")
    if len(strs) == 2 {
        return strs[1], nil
    }
    return "", errors.New("Stalker portal returned invalid link to TV Channel: " + tmp.Js.Cmd)

should be this?

    strs := strings.Split(tmp.Js.Cmd, " ")
    if len(strs) == 2 {
        return strs[1], nil
    }
    return tmp.Js.Cmd, nil

I am fairly sure there was a reason for this logic. Can you share the example of what response Stalker provides?

I am thinking whether this should be more appropriate then (return last "word"). 🤔

strs := strings.Split(tmp.Js.Cmd, " ")
return strs[len(strs)-1], nil
Onemars commented 3 years ago

The error appears when streaming in hls

erkexzcx commented 3 years ago

Below fix is submitted with the latest commits:

strs := strings.Split(tmp.Js.Cmd, " ")
return strs[len(strs)-1], nil

Please check and if it doesn't work - open a new issue. Thanks!