reanimating Kartina.TV plugin. Just started with Plex.

I got 2 year old KartinaTv bundle  from here http://forums.plexapp.com/index.php/topic/22745-Плагины-для-просмотра-русских-каналов/?p=227797 

 

It seems to be installable, but click on it results in "

The media server responded with an error.

"

 

I opened the code... Found the places where I can put my login and password to get access to Kartina.TV

 

via ethernet packet capture I can see the login to Kartina tv is OK....

 

logs on PMS and plugin itself don't offer too much help:

2013-10-06 13:18:38,717 (2004) :  INFO (core:336) - Starting framework core - Version: 2.3.11, Build: 9dc7356 (Thu Aug 29 21:52:02 UTC 2013)
2013-10-06 13:18:38,720 (2004) :  DEBUG (core:348) - Using the standard policy
2013-10-06 13:18:38,720 (2004) :  DEBUG (core:437) - Starting runtime component.
2013-10-06 13:18:38,723 (2004) :  DEBUG (core:437) - Starting caching component.
2013-10-06 13:18:38,723 (2004) :  DEBUG (core:437) - Starting data component.
2013-10-06 13:18:38,724 (2004) :  DEBUG (core:437) - Starting networking component.
2013-10-06 13:18:38,726 (2004) :  DEBUG (networking:318) - Loaded HTTP cookies
2013-10-06 13:18:38,726 (2004) :  DEBUG (networking:504) - Setting the default network timeout to 20.0
2013-10-06 13:18:38,726 (2004) :  DEBUG (core:437) - Starting localization component.
2013-10-06 13:18:38,727 (2004) :  INFO (localization:408) - Setting the default locale to en-us
2013-10-06 13:18:38,727 (2004) :  WARNING (data:186) - Error decoding with simplejson, using demjson instead (this will cause a performance hit) - Expecting property name: line 2 column 5 (char 6)
2013-10-06 13:18:38,733 (2004) :  DEBUG (localization:426) - Loaded en strings
2013-10-06 13:18:38,733 (2004) :  DEBUG (core:437) - Starting messaging component.
2013-10-06 13:18:38,733 (2004) :  DEBUG (core:437) - Starting debugging component.
2013-10-06 13:18:38,734 (2004) :  DEBUG (core:437) - Starting services component.
2013-10-06 13:18:38,734 (2df4) :  DEBUG (networking:172) - Requesting 'http://127.0.0.1:32400/system/messaging/clear_events/com.plexapp.plugins.kartinatv2'
2013-10-06 13:18:38,736 (2004) :  DEBUG (core:437) - Starting myplex component.
2013-10-06 13:18:38,736 (2004) :  DEBUG (core:437) - Starting notifications component.
2013-10-06 13:18:38,845 (2004) :  DEBUG (accessor:68) - Creating a new model access point for provider com.plexapp.plugins.kartinatv2 in namespace 'metadata'
2013-10-06 13:18:38,848 (2004) :  DEBUG (networking:172) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/resourceHashes'
2013-10-06 13:18:39,088 (2758) :  DEBUG (services:265) - Plug-in is not daemonized - loading services from system
2013-10-06 13:18:39,088 (2004) :  DEBUG (runtime:1107) - Created a thread named 'load_all_services'
2013-10-06 13:18:39,092 (2004) :  DEBUG (runtime:1107) - Created a thread named 'get_server_info'
2013-10-06 13:18:39,092 (2758) :  DEBUG (networking:172) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X0J1bmRsZVNlcnZpY2U6QWxsU2VydmljZXM_/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKMApyMAo_'
2013-10-06 13:18:39,092 (29a0) :  DEBUG (networking:172) - Requesting 'http://127.0.0.1:32400'
2013-10-06 13:18:39,094 (2004) :  DEBUG (core:149) - Finished starting framework core
2013-10-06 13:18:39,095 (2004) :  DEBUG (core:547) - Loading plug-in code
2013-10-06 13:18:39,108 (29a0) :  DEBUG (core:525) - Machine identifier is 6994b2f89d11c20ae8bb6db02331012f78ab876c
2013-10-06 13:18:39,108 (29a0) :  DEBUG (core:526) - Server version is 0.9.8.6.175-88ffbb2
2013-10-06 13:18:39,421 (2758) :  DEBUG (services:362) - Loaded services
2013-10-06 13:18:39,430 (1b6c) :  DEBUG (services:438) - No shared code to load
2013-10-06 13:18:39,460 (2004) :  DEBUG (core:553) - Finished loading plug-in code
2013-10-06 13:18:39,460 (2004) :  DEBUG (runtime:640) - Adding a prefix handler for 'KartinaTV2' ('/video/kartinatv2')
2013-10-06 13:18:39,463 (2004) :  DEBUG (preferences:256) - Loaded preferences from DefaultPrefs.json
2013-10-06 13:18:39,464 (2004) :  DEBUG (preferences:178) - Loaded the user preferences for com.plexapp.plugins.kartinatv2
2013-10-06 13:18:39,470 (2004) :  DEBUG (networking:172) - Requesting 'http://iptv.kartina.tv/api/json/login?login=MYLOGIN&pass=MYPASSWORD&device=all&settings=all'
2013-10-06 13:18:39,599 (2004) :  INFO (logkit:16) -  --> OBJ='{"account": {"packet_name": "Kartina.TV EU", "login": login, "packet_expire": "1391095778", "packet_id": "13"}, "settings": {"timeshift": {"list": ["0", "1", "2", "3", "4", "7", "8", "9", "10", "11", "12"], "value": 0}, "timezone": {"value": 0}, "stream_server": {"list": [{"ip": "91.224.187.34", "descr": "Europe South"}, {"ip": "185.28.44.2", "descr": "Europe East"}, {"ip": "91.224.186.2", "descr": "Europe North"}, {"ip": "217.19.223.2", "descr": "USA East Coast"}, {"ip": "217.19.219.34", "descr": "USA West Coast"}, {"ip": "78.31.208.2", "descr": "Middle East"}, {"ip": "103.246.216.34", "descr": "Asia"}], "value": "91.224.186.2"}, "bitrate": {"list": ["2500", "1500", "900", "320"], "names": [{"val": "2500", "title": "Premium"}, {"val": "1500", "title": "Standart"}, {"val": "900", "title": "Eco"}, {"val": "320", "title": "Mobile"}], "value": 1500}, "http_caching": {"list": [1500, 3000, 5000, 8000, 15000], "value": 3000}}, "servertime": 1381058321, "sid": "mj8kce6tbfvlbv5embncrrvs26", "services": {"vod": 1, "archive": 1}, "sid_name": "MWARE_SSID"}'
2013-10-06 13:18:39,601 (2004) :  INFO (logkit:16) -  --> Login successful! True SSID='mj8kce6tbfvlbv5embncrrvs26'
2013-10-06 13:18:39,604 (2004) :  INFO (datakit:93) - Loaded the dictionary file
2013-10-06 13:18:39,605 (2004) :  INFO (core:598) - Started plug-in
2013-10-06 13:18:39,607 (2004) :  DEBUG (socketinterface:144) - Starting socket server
2013-10-06 13:18:39,608 (2004) :  DEBUG (runtime:1107) - Created a thread named 'start'
2013-10-06 13:18:39,611 (2004) :  INFO (socketinterface:168) - Socket server started on port 53440
2013-10-06 13:18:39,611 (2004) :  INFO (pipeinterface:25) - Entering run loop
2013-10-06 13:18:39,612 (2004) :  DEBUG (runtime:717) - Handling request GET /:/prefixes
2013-10-06 13:18:39,615 (2004) :  DEBUG (runtime:814) - Found route matching /:/prefixes
2013-10-06 13:18:39,617 (2004) :  DEBUG (runtime:914) - Response: [200] MediaContainer, 460 bytes
2013-10-06 13:18:44,609 (e08) :  INFO (datakit:131) - Saved the dictionary file
 

 

any help? :) where to dig further?

 

why after successful login I get nothign, but error message from PMS?

ok. one step down :)

first of all seems the cache in my  Chrome did no really helped to see the chanes that I've tried to do.

while holding shift and click - I am able to navagate through menus and EPG.

only playback does not work... But this is Kartina.TV issue. not plex...

actually I back with Plex questions :)

the problem:

Here is a piece of logging from the plugin:

2013-10-06 13:47:15,213 (2cf8) :  DEBUG (runtime:143) - Calling function 'PlayMovie'
2013-10-06 13:47:15,214 (2cf8) :  INFO (logkit:16) - ------> ID='12475'
2013-10-06 13:47:15,220 (2cf8) :  DEBUG (networking:172) - Requesting 'http://iptv.kartina.tv/api/json/vod_geturl?fileid=12475&MWARE_SSID=b4s67rdisfbhj6la8geg89u7b0'
2013-10-06 13:47:15,351 (2cf8) :  INFO (logkit:16) - ------> OBJ='{"url": "http://91.224.186.12:8000/10058_1080_st.m4v?ticket=eHc97jIHtMczaqsYdE8eBWRkGyJpFYEhbhRG4T4D9%2Fk8H57n%2FCWrST4MHX9AvMnkItaPiTsbDd5fN5Sz3nH9G7XclT0uRTU0bBaSA0JZyzRv6%2B2OGEQJjeOae5MpUSG%2F%2BQM7LVZh9DUoc08vTVKbeCprs6XNBVur7oRZUVNZrxI%3D :http-caching=3000 :no-http-reconnect", "servertime": 1381060037}'
2013-10-06 13:47:15,352 (2cf8) :  INFO (logkit:16) - ------> Orig STREAM URL 'http://91.224.186.12:8000/10058_1080_st.m4v?ticket=eHc97jIHtMczaqsYdE8eBWRkGyJpFYEhbhRG4T4D9%2Fk8H57n%2FCWrST4MHX9AvMnkItaPiTsbDd5fN5Sz3nH9G7XclT0uRTU0bBaSA0JZyzRv6%2B2OGEQJjeOae5MpUSG%2F%2BQM7LVZh9DUoc08vTVKbeCprs6XNBVur7oRZUVNZrxI%3D :http-caching=3000 :no-http-reconnect'
2013-10-06 13:47:15,354 (2cf8) :  INFO (logkit:16) - ------> Clean STREAM URL 'http://91.224.186.12:8000/10058_1080_st.m4v?ticket=eHc97jIHtMczaqsYdE8eBWRkGyJpFYEhbhRG4T4D9%2Fk8H57n%2FCWrST4MHX9AvMnkItaPiTsbDd5fN5Sz3nH9G7XclT0uRTU0bBaSA0JZyzRv6%2B2OGEQJjeOae5MpUSG%2F%2BQM7LVZh9DUoc08vTVKbeCprs6XNBVur7oRZUVNZrxI%3D'
2013-10-06 13:47:15,355 (2cf8) :  WARNING (networkkit:125) - The HTTP.SetHeader() function is deprecated. Use HTTP.Headers[] to get and set headers instead.
2013-10-06 13:47:15,357 (2cf8) :  WARNING (networkkit:125) - The HTTP.SetHeader() function is deprecated. Use HTTP.Headers[] to get and set headers instead.
2013-10-06 13:47:15,358 (2cf8) :  DEBUG (runtime:914) - Response: [302] Redirect, 0 bytes
 
If I take the "Clean STREAM URL"  in put it in VLC - I get video! No problem...
 
 
What could be the reason the PMS does not show it?

here is the piece of code that suppose to invoke video playback:

def PlayMovie(sender, id):
	Log("------> ID='%s'" % (id))
	xp='//url'
	url=API_URL+'vod_geturl?fileid='+id+'&MWARE_SSID='+Dict['sessionid']
	obj = JSON.ObjectFromURL(url)
	st=JSON.StringFromObject(obj)
	Log("------> OBJ='%s'" % (st))
	if obj.has_key('error'):
		msg=obj["error"]["message"]
		Dict['sessionid']=""
		Log("------> ERROR='%s'" % (msg))
		return MessageContainer("Ошибка", msg)
	else:
		msg=""
		murl=obj["url"]		
		#strn=JSON.StringFromObject(obj)
		Log("------> Orig STREAM URL '%s'" % (murl))
		murl=murl[0:murl.find(" :")]
		murl=murl.replace('http/ts://','http://')
		Log("------> Clean STREAM URL '%s'" % (murl))
		HTTP.SetHeader('User-Agent', 'vlc/1.1.0 LibVLC/1.1.0')
		HTTP.SetHeader('Icy-MetaData', '1')
		return Redirect(VideoItem( murl, title='' ))

is Redirect(VideoItem( murl, title='' )) still a correct way to play a video?

is Redirect(VideoItem( murl, title='' )) still a correct way to play a video?

The plugin is using old code. It likely still "works" but, most Plex clients don't understand it. The web client definitely won't handle it properly. The only client that will likely handle it properly is the desktop client PMC. So, if you're serious about updating the plugin, you should probably read up on the newer plugin framework. Start with the dev docs, dev.plexapp.com/docs, and feel free to ask more questions along the way. Looking into the code for some of the more up-to-date channels can provide some insight too, github.com/plexinc-plugins.

The plugin is using old code. It likely still "works" but, most Plex clients don't understand it. The web client definitely won't handle it properly. The only client that will likely handle it properly is the desktop client PMC. So, if you're serious about updating the plugin, you should probably read up on the newer plugin framework. Start with the dev docs, dev.plexapp.com/docs, and feel free to ask more questions along the way. Looking into the code for some of the more up-to-date channels can provide some insight too, github.com/plexinc-plugins.

Thank you for confirming that the code is old :)

My goal now is not to become certified plugin developer, but just start up the old thing

to me it look like it 90% complete.

The plugin gets the proper URL that is playable via VLC

So what I'm looking for: quick help from an expert how to rewrite one line : Redirect(VideoItem( murl, title='' )).   murl inside- is valid VLC/mp4 stream

Could you pls help, Plex Ninja? :)

Thank you for confirming that the code is old :)

My goal now is not to become certified plugin developer, but just start up the old thing

to me it look like it 90% complete.

The plugin gets the proper URL that is playable via VLC

So what I'm looking for: quick help from an expert how to rewrite one line : Redirect(VideoItem( murl, title='' )).   murl inside- is valid VLC/mp4 stream

Could you pls help, Plex Ninja? :)

How functional do you want it to be? Are you content with it only working on the desktop client? If so, then stop using Plex/Web to test it. Try it in PMC. It will probably work.

If not, then there is no one-line fix.

How functional do you want it to be? Are you content with it only working on the desktop client? If so, then stop using Plex/Web to test it. Try it in PMC. It will probably work.

If not, then there is no one-line fix.

only one purpose: playback via Apple Tv 3

PlexConnect already running. I am able to browse channels and movies on Kartina TV. 

but playback does not work. neither in plex/web nor on ATV3

just play back needed, not rewind or jump or what ever

Try it in PMC. It will probably work.

Just tried :)

original code works in PMC on Windows

But how to make it ATV3 complient?

For it to work on more recent clients (PlexConnect, Plex/Web, iOS), the entire plugin will need to be brought up to the latest version of the plugin framework. As a side note, if you're accessing live streams through the plugin, that is likely to cause problems, since PMS does not transcode live content. If the streams are in format that the client can play natively without transcoding, that may be a non-issue.

For it to work on more recent clients (PlexConnect, Plex/Web, iOS), the entire plugin will need to be brought up to the latest version of the plugin framework. As a side note, if you're accessing live streams through the plugin, that is likely to cause problems, since PMS does not transcode live content. If the streams are in format that the client can play natively without transcoding, that may be a non-issue.

Thank you for trying to help! 

PlexConnect - work already. I can browse through channels and archive on Kartina tv

My PMS - latest version.

Live stream - is not a hard requirement. I can get URLs with old plugin code to the archive...

What is the absolutely minimum piece of new framework code that will allow trascoding of VLC/mp4 stream to format that ATV3 would play?

I've already told you. The issue is that most clients don't understand the way media is returned from the old-style code. There is no quick-fix. Update the code or don't.

I've already told you. The issue is that most clients don't understand the way media is returned from the old-style code. There is no quick-fix. Update the code or don't.

The question: is it possible to trascode VLC stream to Apple Tv3?

Or you don't know how to work with transcoding on PMS ? 

Have you seen this thread?

http://forums.plexapp.com/index.php/topic/76897-kartinatv-plugin/

The question: is it possible to trascode VLC stream to Apple Tv3?

Or you don't know how to work with transcoding on PMS ?

I believe it is possible to transcode streams from VLC to AppleTV. I also believe that it is a huge side-topic to what the actual problem is. The client (whether it be aTV3 using PlexConnect, Roku, Plex for Android, Plex for iOS, etc.) will request that content be transcoded by PMS. The caveat is that the information about the video stream must be presented in a way that the client can understand. That is not possible using the old-style plugin code. I'm not surprised that navigation works using the old code since navigation and playback are two entirely different aspects of channel implementation.

That being said, the only thing I use VLC for is quick testing of video streams. If you have questions about using VLC to act as a middle-man for you, perhaps someone else can be of assistance. If you want help getting the channel working using the current framework, I'll help where I can.

 I'm not surprised that navigation works using the old code since navigation and playback are two entirely different aspects of channel implementation.

 

Well.... That iptv provider (kartina tv) also gives access to video library, Funny enough that part works on ATV3, but no sound :) So also on provider side there are obviously different formats broadcasted...


. If you want help getting the channel working using the current framework, I'll help where I can.

Thank you very much.  Let's define task as little as possible:

a) We have URL that proides us with following stream :

Transport: HTTP/TS, HTTP
Video:
Codec: H264 ‐ MPEG‐4 AVC (part 10) (h264)
Resolution: 576x472, 720х576, 1280х720, 1920х1080
FPS: 25
Audio:
Codec: MPEG AAC Audio (mp4a)
Channels: 1.0; 2.0; 2.1; 5.1
Frequency: 24000Hz, 44100Hz, 48000Hz
 
b ) Plex plugin is needed that could transcode this stream to a format that ATV3 would recognize. (connection to ATV3 already works via Plex Connect)

 a

Have you seen this thread?

http://forums.plexapp.com/index.php/topic/76897-kartinatv-plugin/

Thank you!

But I see at the end it did not work....

But I have my hopes up :)

reasons:

1) official API suggests that Apple devices get different stream, not VLC. I've tried it, but API documentation only described the login part with Apple, not the playback. Attempt to play a channel results in "badly forrmatted URL" error from the provider side. I am checking now on techical support forum of KArtina.tv how to solve it

2) Video library of kartina tv is playable on ATV3 (so VLC stream), but without sound... I wonder what could that be. 

I ran into the same thing with a plugin I'm working on.

The problem was, as soon as I changed one of my functions to return 'Redirect...' it broke in Plex/Web and iOS.

While doing it this way did work;

def StreamM3U8(id, title, url, thumb, art, summary, include_container=False):

    vco = VideoClipObject(
        key=Callback(StreamM3U8, id=id, title=title, url=url, thumb=thumb, art=art, summary=summary, include_container=True),
        rating_key=id,
        title=title,
        art=art,
        thumb=thumb,
        summary=summary,
        items=[
            MediaObject(
                optimized_for_streaming=True,
                parts=[
                    PartObject(key=HTTPLiveStreamURL(url=url))
                ]
            )
        ]
    )

    if include_container:
        return ObjectContainer(objects=[vco])
    else:
        return vco
 

So, you might want to try modifying your PlayMovie function to return a VideoClipObject, like the one above, and see what happens.

I'm no expert, this is all new to me too... but I'm sure one of the Ninjas could chime in here to help too.