Create strm file that starts the corresponding streaming app
#1
Hey guys,

I'd like to know if it's possible to create a strm file, scrape it and then use it to start the corresponding streaming app. For example I want to have Rules Of Engagement in my KODI library - I'd create a file named "Rules Of Engagement S01E01.strm" that would launch the Netflix app. I know it's possible to create such strm files for KODI addons, but I haven't found anything concerning Android apps. I reckon it should be possible since it is possible to start the apps right ouf of Kodi, but I don't know how to use that in strm files.
Reply
#2
Possibly via external player (wiki) rules, as a way to fling the app-specific URL to the right place. I couldn't get it to work, though, so I think some other things in Kodi are needed.
Reply
#3
I'll give it a try once my shield arrives. Thx for the link!
Reply
#4
I've created this file
Code:
StartAndroidActivity("com.netflix.ninja")

and named it "Person Of Interest S01E01.strm". Kodi scraped it correctly, but gives me the "Playlist - can't find a next item to play" error upon trying to load the episode. The log says this:

Quote:21:43:10 T:1116903680 NOTICE: DVDPlayer: Opening: /storage/emulated/0/Serien/Person Of Interest/StartAndroidActivity("com.netflix.ninja")
21:43:10 T:1116903680 WARNING: CDVDMessageQueue(player):Tongueut MSGQ_NOT_INITIALIZED
21:43:10 T:2091599232 NOTICE: Thread DVDPlayer start, auto delete: false
21:43:10 T:2091599232 NOTICE: Creating InputStream
21:43:10 T:2091599232 ERROR: CDVDPlayer::OpenInputStream - error opening [/storage/emulated/0/Serien/Person Of Interest/StartAndroidActivity("com.netflix.ninja")]
21:43:10 T:2091599232 NOTICE: CDVDPlayer::OnExit()
21:43:10 T:1116903680 ERROR: Playlist Player: skipping unplayable item: 0, path [/storage/emulated/0/Serien/Person Of Interest/StartAndroidActivity("com.netflix.ninja")]
21:43:10 T:1116903680 NOTICE: CDVDPlayer::CloseFile()
21:43:10 T:1116903680 NOTICE: DVDPlayer: waiting for threads to exit
21:43:10 T:1116903680 NOTICE: DVDPlayer: finished waiting
21:43:10 T:1116903680 NOTICE: CDVDPlayer::CloseFile()
21:43:10 T:1116903680 NOTICE: DVDPlayer: waiting for threads to exit
21:43:10 T:1116903680 NOTICE: DVDPlayer: finished waiting

So I guess the log tells me Kodi doesn't understand how to open that stream. I guess that's where your external player comes in.

EDIT: I think all we need is a way for us to tell Kodi to start that android app. This is the file for the episode created by the NetfliXBMC addon:

Code:
plugin://plugin.video.netflix/?mode=play_video&url=70296223

So I think we would need something like

Code:
Androidapp://com.netflix.ninja

How can we get a developer to take a look at this?
Reply
#5
It doesnt work like that. Read http://kodi.wiki/view/Internet_video_and_audio_streams

and maybe use it with http://kodi.wiki/view/External_player

I dunno if they will help, but from a strm file it doesnt look like you can say launch this app

Cheers!
Reply
#6
Yeah, you need to make an external player rule to make it open another app, and then the STRM file will have a URL that the other app will hopefully understand. However, I haven't gotten this to work either.
Reply
#7
If would be enough for now if I could get Kodi to start the app. Getting the apps to start the corresponding episode/movie right out of Kodi would only be the next step. Have you at least been able to get the app running as an external player, Ned?
Reply
#8
Any updates to this?
Reply
#9
Here is my hilariously hacky solution until I switch to Kodi 18 (which has Netflix and Amazon addons that work).

I made short dummy video files of a particular length and put them into appropriate folders with appropriate naming.  Then when they are played back, I check for the first part of the length (they are really short, so no real file will ever match) and if it matches, I launch the app.

Yes, this is really dumb.  It works though  - only launches the app of course but that is fine for me until Kodi 18 hits RC - I only use it for 'shows' so they are right there in continue watching.

service.py:

python:
import xbmc
class XBMCPlayer( xbmc.Player ):
    def __init__( self, *args ):
        pass

    def onPlayBackStarted( self ):
        # Will be called when xbmc starts playing a file
        xbmc.log( "Testing duration for Netflix/Amazon dummy match: " + str(self.getTotalTime(self)) )
        if str(self.getTotalTime(self)).startswith("5.504"):
            self.seekTime(float(5)) # This seeking stuff plus delay makes sure it gets marked watched
            self.seekTime(float(0))
            self.seekTime(float(5))
            xbmc.sleep(1000)
            xbmc.executebuiltin('StartAndroidActivity("com.netflix.ninja")')
        elif str(self.getTotalTime(self)).startswith("4.424"):
            self.seekTime(float(5))
            self.seekTime(float(0))
            self.seekTime(float(5)) 
            xbmc.sleep(1000)
            xbmc.executebuiltin('StartAndroidActivity("com.amazon.amazonvideo.livingroom.nvidia")')

player = XBMCPlayer()

while not xbmc.abortRequested:
    xbmc.sleep(1000)
Reply
#10
Has anyone been able to get this to work with "deep linking"?  I tried to add a playercorefactory.xml in Android to handle .strm files but this approach does not work.  It doesn't even try to launch Netflix.  Would a plugin have to be created for this purpose?
Reply

Logout Mark Read Team Forum Stats Members Help
Create strm file that starts the corresponding streaming app0