Is it possible to make this with an addon?
#1
Hi everyone.

Sorry for my english. I hope I can explain myself clear.

I would like to know if I can do the following writting an addon for Xbmc. I have no experience programming in Python but I don't mind working on this the time I need to achieve it, but I need to know if it is possible or if there are better ways to do it.

The thing is that now I have a batch file which uses plink to make a ssh connection to my router and execute a script, that makes a ssh connection to a computer that is behind the router firewall and it is not visible from the outside and executes a command to start streaming through vlc. Then, I run Xbmc and play a strm file that has the http address for the streaming. This works, but I would like to do it inside Xbmc and easy for my family.

What do you think?

Thanks in advance
Reply
#2
I am not sure what plink is, but this is certainly doable.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#3
Plink is a command-line connection tool, and normally use for automated ssh connections. I suppose Python will has its own modules to manage ssh connections.
Knowing that it is possible to do what I want, I'll start reading documentation.

Thank you very much for your help.
Reply
#4
Plink is a PuTTY utility for connecting to ssh and other PuTTY "backends" (telnet etc.).

@billbill: One option would be to bind your vlc startup batch file to a button, no Python required. You could even get xbmc to start playback at the end of the batch file using a JSON call, or let the user select the strm file from a list, favourites etc.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#5
(2014-09-06, 08:49)Milhouse Wrote: @billbill: One option would be to bind your vlc startup batch file to a button, no Python required. You could even get xbmc to start playback at the end of the batch file using a JSON call, or let the user select the strm file from a list, favourites etc.

Wow, that sounds awesome, but I have no idea how to even start... could you point me in the right direction please?... what kind of info should I look for?

Thanks
Reply
#6
http://wiki.xbmc.org/index.php?title=Built-in_scripting
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#7
Thanks man, I will look into it.
Reply
#8
Posting the script for others to use would be nice.
Reply
#9
(2014-09-06, 12:19)Karnagious Wrote: Posting the script for others to use would be nice.

Sure, of course... when I have all working I'll post how I did it. Right now I'm having some trouble. I managed to create a button in the home menu and run a batch using XBMC.System.exec(path to bat file). I run Xbmc, press the button in the home menu and an error pops up from the batch file saying that plink is not recognized as an internal or external command... Outside Xbmc it runs fine. I have followed the instructions from this post http://forum.xbmc.org/showthread.php?tid=138509 but no luck.

I'll let you know if I finally manage.

Regards
Reply
#10
Are you using full paths in the batch file?
Reply
#11
I have included plink in System32 folder. Isn't that enough?

The batch file is like:

Code:
SET SSH_SRV=my shh server
SET SSH_USR=my ssh user
SET SSH_PORT=ssh server port
SET SSH_RSA=key to login in server
SET SSH_COMMAND=command to execute in remote server


plink %SSH_USR%@%SSH_SRV% -ssh -P %SSH_PORT% -i %SSH_RSA% %SSH_COMMAND%
Reply
#12
The error you're getting suggests it isn't.
Reply
#13
Give the full path to plink. Also try some quotes around the SSH_COMMAND if it has spaces or special characters.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#14
I finally managed to get it working. I don't know why because my account user is in the admin group but I couldn't run plink from windows/system32 folder. I moved it to another folder and now is working. So this is what I did:

Edit home.xml from the confluence customizable mod skin folder an add something like

Code:
<item id="20">
          <label>Stream</label>
          <onclick>XBMC.System.ExecWait(path to batch file)</onclick>
          <onclick>PlayMedia(path to strm file, which contains the url for the streaming)</onclick>
          <icon>-</icon>
          <thumb>-</thumb>
</item>

This add a button in the xbmc main menu.

And the content of the batch file is:

Code:
SET SSH_SRV=my shh server
SET SSH_USR=my ssh user
SET SSH_PORT=ssh server port
SET SSH_RSA=key to login in server
SET SSH_COMMAND=command to execute in remote server

path where plink tool is\plink %SSH_USR%@%SSH_SRV% -ssh -P %SSH_PORT% -i %SSH_RSA% %SSH_COMMAND%

TIMEOUT 5

The SSH_COMMAND is a script that is in the router and makes a ssh connection to my computer and it's pretty much the same as this one. It makes the connection to my computer and run another script which starts the streaming from vlc. I have had to add a timeout of 5 seconds to give time to run the rest, because if not xbmc tries to open an address which isn't operative yet.This is the final script:

Code:
#!/bin/bash

cvlc  http://x.x.x.x:8080/live --sout '#transcode{vcodec=mp4v,acodec=mpga,vb=700,ab=128}:standard{access=http,mux=ogg,dst=:7333}'

http://x.x.x.x:8080/live is the address where a satellite receiver I have makes streaming from the channel that it's being viewed, but I have to transcode because the stream has a high bitrate and works great in LAN, but over the Internet it continuously freezes. Doing the transcoding works flawless.

The strm file only contains http://x.x.x.x:7333, where the address is my public ip. 7333 is the port where the streaming is and it has to be open on the router.

What I want to do in future and with time is a phyton script that put it all together, so I can control the different phases of the proccess, because right now if something happens I don't know what's going on. But for now I'm very happy and I want to thank you all for your help.

Regards
Reply

Logout Mark Read Team Forum Stats Members Help
Is it possible to make this with an addon?0