erkexzcx / stalkerhek Goto Github PK
View Code? Open in Web Editor NEWStalker portal proxy server that allows sharing account on multiple STB boxes and play on VLC.
License: GNU General Public License v3.0
Stalker portal proxy server that allows sharing account on multiple STB boxes and play on VLC.
License: GNU General Public License v3.0
hi!
can you post a little more how to about install and setup? missing stalkerhek.yml. thanks :)
Hello. is it possible to use this with accounts that are URL and MAC address only?
Thanks,
Chris
Simple question - does it work for you?
I wrote this application so I can see IPTV on PS3 and VLC, and it did work for me at some extent. I tried to make it as perfect as I could, but I only had a single box to test it. I have no clue if it works for anyone else.
Let me know in the comments if this app does work for you. I did not expect any stars or forks for this project, but seems there is a demand for this app :D
Hi
I am using stbemu on firetv stick. I don't see any login/passwd being passed to the server in the GET request from the stbemu.
I do see it in the response to get_profile GET request in form of json. The login name is in clear text but the passwd is in hexadecimal. Any idea how its getting decoded? I tried using the hex string as passwd but I get "User not exist or login-password mismatch".
Thanks
Mudit
Hi.
I see that you have ARMV6 and ARMV8. Can any of the two be used on an ARMV7?
Stalker client (e.g. Kodi Stalker PVR addon) in certain scenarios is sending a special HTTP request that tells Stalker middleware to disconnect other devices that are using the same credentials.
I have no STB box with me right now and cannot find it by myself, therefore looking for testers who can try to find what sort of request it is. Expect some action=logoff
in URL or something.
Scenario would be like this:
If device stopped working, it means such request has been sent. Find it in Wireshark logs and share with me.
For more information, see https://github.com/erkexzcx/stalkerhek/blob/master/proxy/proxy.go#L76-L81
need help please, dont know why i am getting this error msg
device_id=4427E82C0C0ECD9B451F5F6FBBBFBF853363D21975808A97AC55EA6FA69D6ED2&device_id2=A211D5558B5F4B378E78310AA12D7502BF38CE49B5ACC25AE9FD013AAA501048&signature=vsYtYYLrAuylw3IqOoEIb5XbrujdsQdAR/AxyO1ZRiQ=&auth_second_step=1&hw_version=1.7-BD-00¬_valid_token=0&JsHttpRequest=1-xml HTTP/1.1
Cookie: __cfduid=ddca3b6d4ceee39e20e5c20de1bb01fca1616242567
model: MAG250
serial_number: yes13 numbers
device_id: 4427E82C0C0ECD9B451F5F6FBBBFBF853363D21975808A97AC55EA6FA69D6ED2
device_id2: A211D5558B5F4B378E78310AA12D7502BF38CE49B5ACC25AE9FD013AAA501048
signature: vsYtYYLrAuylw3IqOoEIb5XbrujdsQdAR/AxyO1ZRiQ=
mac: yes valid mac
username: yes login
password: yes pass
portal_url: http://info.com/stalker_portal/server/load.php
time_zone: America/Toronto
token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
stalkerhek-master# go build -ldflags="-s -w" -o "stalkerhek" ./cmd/stalkerhek/main.go
cmd/stalkerhek/main.go:7:2: cannot find package "github.com/erkexzcx/stalkerhek/proxy" in any of:
/usr/lib/go-1.10/src/github.com/erkexzcx/stalkerhek/proxy (from $GOROOT)
/root/go/src/github.com/erkexzcx/stalkerhek/proxy (from $GOPATH)
cmd/stalkerhek/main.go:8:2: cannot find package "github.com/erkexzcx/stalkerhek/stalker" in any of:
/usr/lib/go-1.10/src/github.com/erkexzcx/stalkerhek/stalker (from $GOROOT)
/root/go/src/github.com/erkexzcx/stalkerhek/stalker (from $GOPATH)
Thanks for creating this. I was able to make it work after a couple of workarounds that I would like to highlight
https://github.com/erkexzcx/stalkerhek/blob/master/stalker/authentication.go#L44
Unfortunately my provider was using token
instead of Token
, so even though new Token was being returned it was not being used as it didn't match the field.
https://github.com/erkexzcx/stalkerhek/blob/master/hls/request_handlers.go#L20
I think links should be made absolute rather than relative. I found no app on IOS that would respect relative links except VLC. Once I changed this to absolute it started working with all of those apps.
I might have more suggestion as I start rolling back the changes I made to make it work. I will keep you updated.
hello,
thank you for this cool tool, but i have a problem
it seams that i got the right authentication details, because the tool fetches the channellist, but then i always got error 404
can you please help me
ps: why do we have to sniff the authentication details, and don't do it like the stalker pvr kodi plugin?
request_iptv.go:25: Failed to update channel: Stalker portal returned invalid link to TV Channel: stalker portal returned invalid link to tv channel: http///xxxxxxxxxxxxx ............... although the link works
when installing go i got this error after this the script exited how do i solve this issue
After log into multiple iptv service provider hosts (thorough this script) what I have observed is,
only 3 things matter for successfully login : host, mac and token (Bearer). You can put whatever in sn, device_ids, signature.
For token, we have to rely on 'stalker portal mac' based apps like stbemu and ott navigator. First we need to authenticate through one of these apps and obtain (only) the token (and mac and host as usual) then put it in 'stalker.yml' config file and voila HLS service starts.
If I change one character from the token, the service fails to login. Generated token does not work.
Problem is, if someone uses the same portal host and mac to log into portal through stbemu or ott navigator or whatever 3rd party apps, the token changes and then we need to re-authenticate and obtain the token once again. Otherwise it shows an error while trying to stream a channel : invalid character 'A' found in .....
Straight to the point, So, mac based stb doesn't require username password and I did sniff http packet from my mac based iptv, Can someone please give and idea to modify the script and make it work for my iptv portal? (This would help many cause most of them use this type iptv)
GET /stalker_portal/server/load.php?type=stb&action=handshake&token=&prehash=9c42ac937c6bc42ba21b45b853bfc020b013f8f6&JsHttpRequest=1-xml HTTP/1.1
Cookie: mac=00%3A1A%3A79%3A22%3A00%3A12; stb_lang=en; timezone=Europe%2FLondon; adid=7be88d36cf378912b9216ba1373ec958
Referer: http://123.123.123.123/stalker_portal/c/
Accept: /
User-Agent: Mozilla/5.0 (QtEmbedded; U; Linux; C) AppleWebKit/533.3 (KHTML, like Gecko) MAG200 stbapp ver: 2 rev: 250 Safari/533.3
X-User-Agent: Model: MAG250; Link: WiFi
Cache-Control: no-cache
Host: 123.123.123.123
Connection: Keep-Alive
Accept-Encoding: gzip
There is no GET named "do_auth" as seen in "authetication.go" file. After handshake direct channel list showing
Kindly help me to make a proper stalkerhek.yml configuration.
Hi I have a problem when loading the channel list:
2021/09/09 11:23:45 main.go:34: Retrieving channels list from Stalker middleware...
panic: runtime error: index out of range [0] with length 0
goroutine 1 [running]:
github.com/erkexzcx/stalkerhek/stalker.(*Portal).RetrieveChannels(0xc0000d82c0)
/home/username/stalkerhek/stalker/channels.go:121 +0x4c5
main.main()
/home/username/stalkerhek/cmd/stalkerhek/main.go:35 +0x15c
I added an extra debug line in loop:
log.Println("parsing channel", v)
2021/09/09 11:23:45 channels.go:113: parsing channel {CHANNELNAME ffmpeg http:///ch/1111/1/ http://logo4tv.com/logos/channel.png 1 []}
So my understanding is that is crashing because the CMDs
struct is empty [] and cannot get v.CMDs[0].ID
is it expecting a different structure for channels list ?
All channels appear like this in my case "cmds": [],
I can see the fields populated on the channel level
"id": "1"
"ch_id": "1111",
So changed
type tmpStruct struct {
Js struct {
Data []struct {
Name string `json:"name"` // Title of channel
Cmd string `json:"cmd"` // Some sort of URL used to request channel real URL
Logo string `json:"logo"` // Link to logo
GenreID string `json:"tv_genre_id"` // Genre ID
ID string `json:"id"` // Used for Proxy service to generate fake response to new URL request
CH_ID string `json:"ch_id"` // Used for Proxy service to generate fake response to new URL request
} `json:"data"`
} `json:"js"`
}
And
// Build channels list and return
channels := make(map[string]*Channel, len(tmp.Js.Data))
for _, v := range tmp.Js.Data {
log.Println("parsing channel", v)
channels[v.Name] = &Channel{
Title: v.Name,
CMD: v.Cmd,
LogoLink: v.Logo,
Portal: p,
GenreID: v.GenreID,
Genres: &genres,
CMD_CH_ID: v.ID,
CMD_ID: v.CH_ID,
}
It seems to be working but I am not sure what the expected structure is.
var regexTimezone = regexp.MustCompile(^[a-zA-Z]+/[a-zA-Z_]+$
)
Thanks
Mudit
Hi man, the streams are stopping on still image every 15 sec for 5 sec, and then starts playing. Is this somthing i can do to fix in the config or Go file :) ?
Hello
I am running stbemu on firetv stick. Using the macbook as access point and running wireshark, I found the way in which the stbemu authenticates. Here is the python code, the following needs to be filled in though, base_url, serial number and the mac address. All can be found on the Settings menu. The base_url is the location referred by 301 status code. Do modify your timezone if needed.
Now, I am not a golang programmer or even a python programmer but I will try to give it a go (pun intended) if/when time permits. I am attaching code here if anyone who knows the goland can have a crack at it. This python code is not optimized or anything. Just a crude way to login and dump the stb profile info. Its supposed to be a starter point for modifying stalkerhex code.
import requests
import json
import sys
import urllib.parse
import time
debug = False
nl = "\n"
base_url = "XXXXXX"
stb_sn = "XXXXXXXXXXXXX"
stb_type = "MAG250"
stb_mac = "XX:XX:XX:XX:XX:XX"
stb_timezone = "America/Los_Angeles"
stb_prehash = ""
stb_adid = ""
headers = {
'User-Agent': 'Mozilla/5.0 (QtEmbedded; U; Linux; C; Emulator/1.2.12) AppleWebKit/533.3 (KHTML, like Gecko) MAG200 stbapp ver: 2 rev: 250 Safari/533.3',
}
def dump_url_response(r):
if debug:
print ("\n")
print ("===Status Code", r.url, r.status_code)
print ("===Headers", r.url, nl, r.headers)
print ("===Cookies", r.url, nl, r.cookies.get_dict())
print ("===Text", r.url, nl, r.text)
print (nl)
r=requests.get(base_url, headers=headers, allow_redirects=False)
dump_url_response(r)
location = ""
if (r.status_code == 301):
location = r.headers['location']
base_url = location
print ("New base_url ", base_url)
r=requests.get(location, headers=headers, allow_redirects=False, cookies=r.cookies)
dump_url_response(r)
#remove /c/
if "/c/" in base_url:
base_url = base_url.replace("/c/","")
print ("Modded New base_url ", base_url)
stb_cookies = { "mac" : urllib.parse.quote_plus(stb_mac), "stb_lang" : "en", "timezone" : urllib.parse.quote_plus(stb_timezone), "adid" : stb_adid}
token = ""
load_php_url = base_url + "/server/load.php?type=stb&action=handshake&token=" + token + "&prehash=" + stb_prehash + "&JsHttpRequest=1-xml"
this_url = load_php_url
r=requests.get(this_url, headers=headers, allow_redirects=False, cookies=stb_cookies)
dump_url_response(r)
load_php_dict = json.loads(r.text)
if debug:
print ("load_php_dict ", load_php_dict)
if ('token' not in load_php_dict['js']):
print ("load_php_dict failed, key not found", nl, r.text)
sys.exit(-1);
token = load_php_dict['js']['token']
stb_random = load_php_dict['js']['random']
if debug:
print ("token ", token)
print ("stb_random ", stb_random)
if 'not_valid' in load_php_dict['js']:
not_valid = load_php_dict['js']['not_valid']
if not_valid == 1:
print ("not_valid is 1")
sys.exit(-1);
stb_timestamp = str(int(time.time()))
get_profile_url = base_url + "/server/load.php?type=stb&action=get_profile&sn=" + stb_sn + "×tamp= " + stb_timestamp
this_url = get_profile_url
r=requests.get(this_url, headers=headers, allow_redirects=False, cookies=stb_cookies)
dump_url_response(r)
stb_profile = json.loads(r.text)
print("stb_profile", nl, json.dumps(stb_profile, indent=4, sort_keys=True))
~/stalkerhek# ./stalkerhek
2021/03/25 13:46:36 main.go:28: Connecting to Stalker middleware...
2021/03/25 13:46:36 main.go:30: Get "?type=stb&action=handshake&prehash=0&token=0DEF849B0E17E8D8D9060F879BBEC665&JsHttpRequest=1-xml": unsupported protocol scheme ""
Tried everything, any help
Hey,
I know 'go' programming language must be installed. i am receiving the following error when I try to build:
env: 'go': No such file or directory
I then install the golang using apt-get install golang , once I try rebuilding with ./build.sh I receive the following error:
I get several errors like below:
$GOPATH not set
cmd/stalkerhek/main.go:11:2 cannot find package "github.com/erkexzcx/stalkerhek/pkg/stalker/" in any of /usr/lib/go-1.6/src/github.com/erkexzcx/stalkerhek/pkg/stalker/" (from $GOROOT).
Can you please advise?
Happy Christmas.
how to use this. please help.
request_iptv.go:25: Failed to update channel: invalid character 'A' looking for beginning of value
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.