Closed rlaphoenix closed 8 years ago
I've cleaned up the code, rte is working right now, I would like to add in aertv, but don't you need a paid account to get the token???
No not at all, You simply need to find a way to get the stream from the HTML/Headers - You can signup for free and use Fiddler to find the base url + token.
But I think the website gives free users only 10 minutes per day (at least that's what they say) and oddly when I navigate away from the page and go back, the feed is lost. Can you get it for more than 10 minutes on the free account?
No that Time Remaining thing is like a HD Preview Before you buy thing I believe
Oh nvm your right, Its only 10 mins/day D: I do have a Plus account doe Cant exactly share it around or anything, But ill try find a way to get the tokens and get back to you.
Yeah, that's what I thought :) I think the current version of the addon is as good as it gets
Anyway, feel free to fork, fix and pull anything you like :)
http://i.imgur.com/p3bpSHS.png Managed to find that it pops up in "Network" tab on Chrome in Dev Tools, See the &mu=rtmp%3A%2F%2Fd-deg-mcdn.magnet.ie%3A1935%2Frtplive%2Frte-one-v1500.stream%3Fstreamtoken%3D{{{{{...........}}}}}
bit? Thats the stream just HTML encoded. Is there any way to record it in python and grab the first link that pops up in console under "ping.gif" and then just use Regex to extract what we need?
Im telling you if you get this working your plugins gonna be a massive hit and will fully replace the official kodi repos Irish TV plugin
Hmmm, there is no chance that this token is anywhere on the login page or store in a cookie? I'm able to log in and grab information.
PS: I'm not seeing this network activity you speak of, I can get session id and user_token, but no streamtoken. But this might be because I'm not getting any streams :) lol
I've been looking into AerTV, I feel it would need it's own addon, but I'm finding it too hard to get the token after I log in with Python. I'm not sure if it can be done, I'm seeking someone else's opinion.
I'm very close, I can get the streamtoken but only if I know the user_token, any ideas?
The new version now uses AER TV.
Closing
Sorry for no reply! Had no internet for ages! Got it back but its only 5gb of data, So gotta be careful! Great that you got it working! Wont be able to test but if it works thats awesome!
Also, I see you use https://twitter.com/ljcrkbgxro to grab the Token and Time from, But may I ask how you are getting them in the first place just incase issues occur I could make a backup server (I myself have a VPS)
Oh! And I dont think those tokens even work - They HAVE to be generated on your own IP address or they wont work - I tested this myself.
I check and the worked at work :) but they expire sooo... so I need to generate them often but I think my IP address was blocked. gr :(
The token is generated when one signs up to AER TV
Can you send me the files you were using to generate the tokens? Ill hop it onto my VPS and ill start it to throw crap onto a twitter too.
Grand, now before you do, I added in a tv3() and three_e() function. What you may not know is that for some reason on some devices the links don't work for those stations, so I think it is important for people to have a stream choice for those two stations. Do you have selenium on your server?
I have no idea what you mean abou Selenium, All I know is that I have an VPS server, (I can make it windows, ubuntu, linux etc)
Is there no way to just make a setting for login and password and just use that with some python to generate the token themselves?
Also - Im not sure if its because of my Update or anything but AerTV channels still dont work.
It's AER TV blocking :( sadly the script requires a lot of other stuff too, it;s not just a pure python code. But I have an idea to generate more tokens
rtmp://d-deg-mcdn.magnet.ie:1935/rtplive/rte-one-v1500.stream?streamtoken={{{{{...........}}}}}
Thats the StreamLink that is in that API link. Maybe if we just skip the whole API bit and just add the code() bit to the end of this and simply return
it, Then that should work right?
obviously we need to change the rte-one but after /rtplive/ to the "station"
It will work, As ive tested it with my own stream token before, But all we need to do, Is find out how to get a streamtoken using just kodi. Get the token whenever someone wants to play an aertv channel and get it themselves from there own account instead of a Twitter account because what if the twitter gets closed for spam, Or your Server stops working etc? There wont be a backup.
If we add streamtoken grabbing code directly to the plugin we will PERMANENTLY have AerTV streams :P
Your Twitter bot just posted a new stream token, I tested it on My IP and it didnt work D: This means we need to have it generated on demand on the plugin itself using the user's IP address. The StreamTokens seem to be IPLocked :/
Stream with your token: rtmp://d-deg-mcdn.magnet.ie:1935/rtplive/rte-one-v1500.stream?streamtoken=c98b5a7f225218b94d6d68ecce53580632856cf6de074e107aeedda5b33d7531_1473375970
but a stream link with a Token I got myself works fine :/
And how did you get the token though? This is the key, the only way I can get a token is to scape it full an actually firefox browser running. This is the tricky part.
That's what my script does, it opens firefox, runs it, logs in and gets the token. This can't be done in kodi, there is no firefox.
Well can you send me your script? How im getting the token is through actual network logs. It can be found in Chromes F12
network tab and also using Fiddler4
Does github have private message feature?
Nope, But if you have discord: Add my username: Shiny#2141
lol :) I don't, here I'll paste it here:
Just Right Click > Zip and drag and drop into the Text Box :P
Oh I see, Hmm... Would any of these work: http://stackoverflow.com/questions/2910221/how-can-i-login-to-a-website-with-python
We need to find a way to do this xD
Or maybe this: http://forum.kodi.tv/showthread.php?tid=99082 This is tailored specifically to kodi so maybe it would work?
This seems very promising it says next to it "gethtml with cookies support"
This seems like it would work if we use it against the API, I fiddled with the API before for an unrelated use, Ill see if I can get the login_data for it.
Sure, however I've looked into this, it doesn't seem to work because I think it is some kind of java script that is setting the token or something, that, it's not stored in a cookie until some java thingey runs, maybe, I dunno
Hmm I see, Well atm im working on the login script - Im working with a friend on Discord to get it to work - We are setting up the Post Data and Success Keys
Fantastic! I hope you guys get it working :) the AerTV function that makes the stream token requires the user token which you get when you log in, that's what I can't get.
yh working on it :P
The API gives this: {"statusCode":200,"statusMessage":"OK","data":{"user_token":"e70971b38dddce13ddd769ce3865e8dab0619221aeafd98bef16a56b6289301e_1473379310"
:P Working on the login now, Its going VERY well.
Oohh exciting :)
Im not great with response parsing, Maybe you can help:
#do the login and get the response
response = opener.open(req)
source = response.read()
response.close()
#if login suceeded, save the user_token
if re.search('user_token',source,re.IGNORECASE):
#Some kind of parsing here to get the user token?
could you paste an example of the source please
{"statusCode":200,"statusMessage":"OK","data":{"user_token":"e70971b38dddce13ddd769ce3865e8dab0619221aeafd98bef16a56b6289301e_1473379310","id":"58567","firstName":"{hidden}","lastName":"{hidden}","email":"{hidden}","isPremium":true,"channelDefault":"rte-one","packages":{"free":{"name":"Free Channel Pack","code":"WEB_STD","price":"0.00"},"plus":{"name":"Aertv Plus","code":"AERTV_PLUS","price":"5.99"}},"dialog":[],"upsell":{"title":"Upgrade","body":"Get more channels with Aertv Platinum, available with Magnet Broadband. Visit www.magnet.ie or call 1890 809 000","label":"Upgrade","link":"http:\/\/www.magnet.ie"},"clientInfo":{"ip":"{hidden}","userAgent":"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)","platform":"browser","platformVersion":"","country":"uk","connectionType":"cable"},"statusMessage":"fb"}}
It's ugly but will get things going:
for s in source.split(","): if "user_token" in s: token = s.replace('"data":{"user_token":"','').replace('"','') break
print token
Could you PLEASE add support for TV Guides? As in make a
router()
mode like:(Note: Code above is just an example, I tried to make it work but it wouldn't work for some reason.)
Just please set something up like that so we can do something like:
plugin://plugin.video.live.irish.tv/?action=upd&channel=UTV
Which would generate a new token and play the stream so that we can use TV Guide applications nice and smooth.Great work was looking for something to play Irish streams since Irish TV was dead. This deserves much more <3
Also plz remove the pointless "Category".
And RTE 1+2 never seem to work. (The official streams are DRM protected, But not aertv.ie's ones. I can only manage to get the stream url from using Fiddler to sniff the url: http://pastebin.com/raw/6wUV4V98 But the token NEEDS to be one tied to YOUR ip. So somehow try and find a way to get the token and replace it on that url base. (If you need the base urls for the other aertv channels let me know, I can sniff em)
Great work was looking for something to play Irish streams since Irish TV was dead. This deserves much more <3