# KartinaTV plugin

**URL:** <https://forums.plex.tv/t/kartinatv-plugin/39882>\
**Category:** Dev/API Corner\
**Tags:** plugin-dev\
**Created:** [August 6, 2013, 12:33pm UTC](https://forums.plex.tv/t/kartinatv-plugin/39882 "2013-08-06T12:33:24Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Evgheny](https://avatars.discourse-cdn.com/v4/letter/e/4da419/32.png) [@Evgheny](https://forums.plex.tv/u/Evgheny)\
**Post date:** [August 6, 2013, 12:33pm UTC](https://forums.plex.tv/t/kartinatv-plugin/39882/1 "2013-08-06T12:33:24Z")

</div>

Hi all.

I began to rewrite the plugin Kartinatv which stopped supporting Alex Titoff.

&nbsp;

&nbsp;made ​​sure that the output channel list, library, video library list. But there is a problem with playing a direct stream that quietly played VLC player.

When I insert a link in VLC, the player play a channel with no problems. When playing the stream&nbsp; on ATV3, in the PlexConnect-in logs i see:

&nbsp;

```
07:51:55 ATVLogger: Player state: Loading at this time: 0
07:51:56 ATVLogger: Player state: Stopped at this time: 0
```

function that returns the video to the container returns it as:

&nbsp;

```
Redirect(VideoItem(url, 'Title'))
 
```

Tell me please, what am I doing wrong? How do I play VLC stream?

---

<div class="post-metadata">

**Author:** ![Evgheny](https://avatars.discourse-cdn.com/v4/letter/e/4da419/32.png) [@Evgheny](https://forums.plex.tv/u/Evgheny)\
**Post date:** [August 16, 2013, 10:54pm UTC](https://forums.plex.tv/t/kartinatv-plugin/39882/2 "2013-08-16T22:54:44Z")

</div>

Hi all.

I need help for channel plugin.

I try to play stream in Plex/web 2 different types of links

Plugin:

```
url_vlc_1 = 'http://50.7.240.106/rtr-planeta_800_00/rtr-planeta_800_00.m3u8?user=zixi_06_1372420_378d003cd717358ea94d5cf074d91598&session=null&hlsid=HLS_14432178'
url_vlc_2 = 'http://91.224.187.151/001/1376691219?ticket=CiHJYkjtyeEGyUtOrIISfgO1nn6KeqoAHHr%2FO9svZV%2FteoaMeIvxn%2Fw8Q1v0CiBs2oZC0SMBUwD3jbVMuPTs8WLaivjUpKrmsnfss6XInqBb4yCk1UJskKFkY%2Fvum1JVIyk4fPXDFNdghIgaBBeCb1dbQ6D8cVKWUjp5lGDWvTs%3D'

@handler(’/video/vlc’, TEXT\_TITLE, thumb=ICON, art=ART)  
def MainMenu():  
dir = ObjectContainer()  
dir.add(LiveStream(url=url\_vlc))  
return dir

####################################################################################################   
def LiveStream(url):

```
vco = VideoClipObject(
	key = Callback(LiveStream, url=url),
	rating_key = 'Justin',
	title = 'Watch VLC Live',
	thumb = R(ICON),
	items = [
		MediaObject(
			parts = [
				PartObject(key=HTTPLiveStreamURL(url))
			],
			container = Container.MP4,
			video_codec = VideoCodec.H264,
			audio_codec = AudioCodec.AAC,
			audio_channels = 2,
			optimized_for_streaming = True
		)
	]
)

return vco

```
```

url\_vlc\_1 plays without problems.

url\_vlc\_2 - Plex/Web write Error loading player: No playable sources found

VLC player plays both links are equally.

Both streams are video codec (from VLC media info) H264 - MPEG4 - AVC (part 10) (h264), and audio codec MPEG AAC Audio (mp4a)

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![meo](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/meo/32/4534_2.png) [@meo](https://forums.plex.tv/u/meo)\
**Post date:** [August 17, 2013, 1:44pm UTC](https://forums.plex.tv/t/kartinatv-plugin/39882/3 "2013-08-17T13:44:59Z")

</div>

Hi!

I tried both of those URLs in VLC and only the first one plays?

Besides that I think another problem is the declaration of&nbsp;

```
container = Container.MP4
```

for a HTTP Live Stream(HLS). That should be:

```
container = 'mpegts'
```

If the second URL points to a MP4 file(instead of a HLS m3u8 list in the first one), you need to return different VideoClipObjects depending on type, i.e. different MediaObjects

---

<div class="post-metadata">

**Author:** ![Evgheny](https://avatars.discourse-cdn.com/v4/letter/e/4da419/32.png) [@Evgheny](https://forums.plex.tv/u/Evgheny)\
**Post date:** [August 17, 2013, 3:04pm UTC](https://forums.plex.tv/t/kartinatv-plugin/39882/4 "2013-08-17T15:04:35Z")

</div>

Hi, meo!

Thank you for help.

Second link not openopen because the service require login/password, and generate every time a new link.

I changed container to 'mpegts', error changed to "Error loading skin: Skin formatting error"

I understand that the error is related to jwplayer?

---

<div class="post-metadata">

**Author:** ![meo](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/meo/32/4534_2.png) [@meo](https://forums.plex.tv/u/meo)\
**Post date:** [August 17, 2013, 3:12pm UTC](https://forums.plex.tv/t/kartinatv-plugin/39882/5 "2013-08-17T15:12:08Z")

</div>

Oh, I didn't see it first, the VideoClipObject must be added to an ObjectContainer to start with. I'm not very familiar with plugins that returns video objects in \_\_init\_\_.py(basically I've forgotten, I only use URL services).

Maybe this example can help you:

[https://github.com/plexinc-plugins/JerrySeinfeld.bundle/blob/master/Contents/Code/\_\_init\_\_.py](https://github.com/plexinc-plugins/JerrySeinfeld.bundle/blob/master/Contents/Code/ __init__.py)

---

<div class="post-metadata">

**Author:** ![Evgheny](https://avatars.discourse-cdn.com/v4/letter/e/4da419/32.png) [@Evgheny](https://forums.plex.tv/u/Evgheny)\
**Post date:** [August 17, 2013, 11:44pm UTC](https://forums.plex.tv/t/kartinatv-plugin/39882/6 "2013-08-17T23:44:31Z")

</div>

Okay, I'll look into the plugin. Thank you.

Tell me please, how to specify the object VideoItem, he has to play MPEG4 format (similar to container = 'mpegts', in MediaObject)

---

<div class="post-metadata">

**Author:** ![Evgheny](https://avatars.discourse-cdn.com/v4/letter/e/4da419/32.png) [@Evgheny](https://forums.plex.tv/u/Evgheny)\
**Post date:** [August 18, 2013, 2:28am UTC](https://forums.plex.tv/t/kartinatv-plugin/39882/7 "2013-08-18T02:28:49Z")

</div>

Hi. I looked JerrySeinfeld plugin and changed my code.

```
url_vlc_1 = 'http://91.224.187.86:8000/11069_normal_st_s2e41.m4v?ticket=fNiKGX65TMGsgEf2GjSm5uhILwvr%2BhZU3jtARoDVhpsLTbfGZiq3zJTOPjd90Odvqpq5y316dxMmlgMFFi%2F%2FxigMiPED49RSr7JExWUk4255nTms0N1hc07cVYrKYGZsj%2BDDmeIvj2ylrRiDx789UzOEWPZMgHYT%2Ffso2pdpqLE%3D'
url_vlc_2 = 'http://91.224.187.41/001/1376789237?ticket=bni7a2PXWRSuN7A9YOHQ0yj4xx9BRdWpMJqblK5JZRDl4JgyVc3wy%2F38nQz%2Fe%2FC3IFKtSvDvT4Av3SHq3v4EpX3FJ%2BgTd9rGH7OVGgo0dDDIwEnpPAGkCSjVgvfUrKhKbDAXmpBvJ6UbJVt1fqBuIYlGt4brK2OyBFafTuQzp9M%3D'

@handler(’/video/vlc’, TEXT\_TITLE, thumb=ICON, art=ART)

def MainMenu():  
oc = ObjectContainer()

```
oc.add(VideoClipObject(
	key = Callback(Lookup, video_url = url_vlc, title = "test"),
	rating_key = "Justin",
	title = "test",
	items = [
	MediaObject(
	  container = Container.AVI,
	  video_codec = VideoCodec.H264,
	  audio_codec = AudioCodec.AAC,
	  audio_channels = 2,
	  parts = [PartObject(key = url_vlc)]
	)
	]
))

return oc

```

###################################################################################################  
@route(’/video/vlc/livestream’)  
def Lookup(video\_url, title):  
oc = ObjectContainer()  
oc.add(VideoClipObject(  
key = Callback(Lookup, video\_url = video\_url, title = title),  
rating\_key = video\_url,  
title = title,  
items = [  
MediaObject(  
container = Container.AVI,  
video\_codec = VideoCodec.H264,  
audio\_codec = AudioCodec.AAC,  
audio\_channels = 2,  
parts = [PartObject(key = video\_url)]  
)  
]  
))  
return oc
```

url\_vlc\_1 playing without problems in Plex/Web and in ATV3

url\_vlc\_2 get the error "Cannot load M3U8: 404 not found"

I think the error is due to the fact that URL is not specified file extension. Maybe it?

---

<div class="post-metadata">

**Author:** ![meo](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/meo/32/4534_2.png) [@meo](https://forums.plex.tv/u/meo)\
**Post date:** [August 19, 2013, 8:03pm UTC](https://forums.plex.tv/t/kartinatv-plugin/39882/8 "2013-08-19T20:03:38Z")

</div>

> Hi. I looked JerrySeinfeld plugin and changed my code.
> 
> ```
> url_vlc_1 = 'http://91.224.187.86:8000/11069_normal_st_s2e41.m4v?ticket=fNiKGX65TMGsgEf2GjSm5uhILwvr%2BhZU3jtARoDVhpsLTbfGZiq3zJTOPjd90Odvqpq5y316dxMmlgMFFi%2F%2FxigMiPED49RSr7JExWUk4255nTms0N1hc07cVYrKYGZsj%2BDDmeIvj2ylrRiDx789UzOEWPZMgHYT%2Ffso2pdpqLE%3D'
> url_vlc_2 = 'http://91.224.187.41/001/1376789237?ticket=bni7a2PXWRSuN7A9YOHQ0yj4xx9BRdWpMJqblK5JZRDl4JgyVc3wy%2F38nQz%2Fe%2FC3IFKtSvDvT4Av3SHq3v4EpX3FJ%2BgTd9rGH7OVGgo0dDDIwEnpPAGkCSjVgvfUrKhKbDAXmpBvJ6UbJVt1fqBuIYlGt4brK2OyBFafTuQzp9M%3D'
> ```
> 
> I think the error is due to the fact that URL is not specified file extension. Maybe it?

If you are certain that both those videos are AVI files, I suppose it should work without the extension. Clients usually perform a HEAD to get the MIME-TYPE, which would reveal that it is an AVI file, or perhaps doing a range GET to look at the first range of bytes(which also would reveal the container type).

---

<div class="post-metadata">

**Author:** ![Evgheny](https://avatars.discourse-cdn.com/v4/letter/e/4da419/32.png) [@Evgheny](https://forums.plex.tv/u/Evgheny)\
**Post date:** [August 22, 2013, 7:55am UTC](https://forums.plex.tv/t/kartinatv-plugin/39882/9 "2013-08-22T07:55:33Z")

</div>

> If you are certain that both those videos are AVI files, I suppose it should work without the extension. Clients usually perform a HEAD to get the MIME-TYPE, which would reveal that it is an AVI file, or perhaps doing a range GET to look at the first range of bytes(which also would reveal the container type).

meo, I spent a lot of different experiments.  
What do you think about that urls well only be played via a plugin VLC, or via VLC player. The other players fail to play the stream.

Developers of the KartinaTV claim that the broadcast is via HTTP/TS, HTTP transport and codec H264 - MPEG-4 AVC (part 10) (h264)

I tried to play URLs through a html5 tag video, as a result, the tag "does not play an unknown MIME TYPE"

What are your thoughts?

---

<div class="post-metadata">

**Author:** ![meo](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/meo/32/4534_2.png) [@meo](https://forums.plex.tv/u/meo)\
**Post date:** [August 23, 2013, 6:49pm UTC](https://forums.plex.tv/t/kartinatv-plugin/39882/10 "2013-08-23T18:49:29Z")

</div>

> meo, I spent a lot of different experiments.  
> What do you think about that urls well only be played via a plugin VLC, or via VLC player. The other players fail to play the stream.
> 
> Developers of the KartinaTV claim that the broadcast is via HTTP/TS, HTTP transport and codec H264 - MPEG-4 AVC (part 10) (h264)
> 
> I tried to play URLs through a html5 tag video, as a result, the tag "does not play an unknown MIME TYPE"
> 
> What are your thoughts?

That sounds like HLS(HTTP Live Streaming). Which clients have you been trying this on? I'd say stick to PMC first(since it will play almost all formats) and try removing some details:

```
@handler('/video/vlc', TEXT_TITLE, thumb=ICON, art=ART)

def MainMenu():
	oc = ObjectContainer()

	oc.add(VideoClipObject(
		key = Callback(Lookup, video_url = url_vlc, title = "test"),
		rating_key = "Justin",
		title = "test",
		items = [
		MediaObject(
		  audio_channels = 2,
		  parts = [PartObject(key = HTTPLiveStreamURL(url = url_vlc))]
		)
		]
	))

	return oc

###################################################################################################
@route('/video/vlc/livestream')
def Lookup(video_url, title):
  oc = ObjectContainer()
  oc.add(VideoClipObject(
    key = Callback(Lookup, video_url = video_url, title = title),
    rating_key = video_url,
    title = title,
    items = [
      MediaObject(
        audio_channels = 2,
        parts = [PartObject(key = HTTPLiveStreamURL(url = video_url))]
      )
    ]
  ))
  return oc
```

---

<div class="post-metadata">

**Author:** ![Evgheny](https://avatars.discourse-cdn.com/v4/letter/e/4da419/32.png) [@Evgheny](https://forums.plex.tv/u/Evgheny)\
**Post date:** [August 29, 2013, 4:24am UTC](https://forums.plex.tv/t/kartinatv-plugin/39882/11 "2013-08-29T04:24:55Z")

</div>

Hi, meo.

I tried the code.

Player say

> Error loading player:  
> No playable sources found

Log of the plugin:

> 2013-08-29 07:22:31,299 (2a8) :&nbsp; DEBUG (runtime:714) - Handling request GET /video/vlc/livestream?video\_url=http%3A%2F%2Fapi.rodina.tv%2Flist%2Fm3u%2F9%2FSEwc0EvRbWCrS6eXWv&title=test  
> 2013-08-29 07:22:31,302 (2a8) :&nbsp; DEBUG (runtime:811) - Found route matching /video/vlc/livestream  
> 2013-08-29 07:22:31,306 (2a8) :&nbsp; WARNING (objectkit:199) - Media part has no streams - attempting to synthesize  
> 2013-08-29 07:22:31,309 (1a7c) :&nbsp; DEBUG (runtime:714) - Handling request GET /video/vlc  
> 2013-08-29 07:22:31,313 (1a7c) :&nbsp; DEBUG (runtime:811) - Found route matching /video/vlc  
> 2013-08-29 07:22:31,318 (2a8) :&nbsp; DEBUG (runtime:911) - Response: [200] MediaContainer, 954 bytes  
> 2013-08-29 07:22:31,319 (1a7c) :&nbsp; DEBUG (base:123) - Checking if com.plexapp.plugins.vlc is broken  
> 2013-08-29 07:22:31,323 (1a7c) :&nbsp; DEBUG (networking:172) - Requesting '[http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X1N0b3JlU2VydmljZTpJc0NoYW5uZWxCcm9rZW4\_/Y2VyZWFsMQoxCmxpc3QKMApyMAo\_/Y2VyZWFsMQoxCmRpY3QKMQpzMjMKY29tLnBsZXhhcHAucGx1Z2lucy52bGNzMTAKaWRlbnRpZmllcnIwCg\_\_](http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X1N0b3JlU2VydmljZTpJc0NoYW5uZWxCcm9rZW4_/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKMQpzMjMKY29tLnBsZXhhcHAucGx1Z2lucy52bGNzMTAKaWRlbnRpZmllcnIwCg__)'  
> 2013-08-29 07:22:31,342 (1a7c) :&nbsp; DEBUG (runtime:911) - Response: [200] MediaContainer, 910 bytes  
> 2013-08-29 07:22:35,262 (10bc) :&nbsp; DEBUG (runtime:714) - Handling request GET /video/vlc  
> 2013-08-29 07:22:35,263 (10bc) :&nbsp; DEBUG (runtime:811) - Found route matching /video/vlc  
> 2013-08-29 07:22:35,266 (10d8) :&nbsp; DEBUG (runtime:714) - Handling request GET /video/vlc/livestream?video\_url=http%3A%2F%2Fapi.rodina.tv%2Flist%2Fm3u%2F9%2FSEwc0EvRbWCrS6eXWv&title=test  
> 2013-08-29 07:22:35,267 (10bc) :&nbsp; DEBUG (base:123) - Checking if com.plexapp.plugins.vlc is broken  
> 2013-08-29 07:22:35,273 (10d8) :&nbsp; DEBUG (runtime:811) - Found route matching /video/vlc/livestream  
> 2013-08-29 07:22:35,273 (10bc) :&nbsp; DEBUG (networking:172) - Requesting '[http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X1N0b3JlU2VydmljZTpJc0NoYW5uZWxCcm9rZW4\_/Y2VyZWFsMQoxCmxpc3QKMApyMAo\_/Y2VyZWFsMQoxCmRpY3QKMQpzMjMKY29tLnBsZXhhcHAucGx1Z2lucy52bGNzMTAKaWRlbnRpZmllcnIwCg\_\_](http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X1N0b3JlU2VydmljZTpJc0NoYW5uZWxCcm9rZW4_/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKMQpzMjMKY29tLnBsZXhhcHAucGx1Z2lucy52bGNzMTAKaWRlbnRpZmllcnIwCg__)'  
> 2013-08-29 07:22:35,280 (10d8) :&nbsp; DEBUG (runtime:911) - Response: [200] MediaContainer, 954 bytes  
> 2013-08-29 07:22:35,302 (10bc) :&nbsp; DEBUG (runtime:911) - Response: [200] MediaContainer, 910 bytes

---

<div class="post-metadata">

**Author:** ![Serge.Stre](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@Serge.Stre](https://forums.plex.tv/u/Serge.Stre)\
**Post date:** [August 31, 2013, 4:03am UTC](https://forums.plex.tv/t/kartinatv-plugin/39882/12 "2013-08-31T04:03:40Z")

</div>

Hi, Evgheny!  
  
You are doing a great job! I was going to ask you to do this plugin early, cuz you are the guy who made it for xbmc! Right?  
  
But you started this yourself.  
  
Но у меня есть подозрения, что ты делаешь это для РодинаТВ! Он будет работать для КартиныТВ?

---

<div class="post-metadata">

**Author:** ![meo](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/meo/32/4534_2.png) [@meo](https://forums.plex.tv/u/meo)\
**Post date:** [August 31, 2013, 12:15pm UTC](https://forums.plex.tv/t/kartinatv-plugin/39882/13 "2013-08-31T12:15:21Z")

</div>

Evgheny,

Can you please give a couple of sample URL:s, then I can try to see if all those uses the same streaming method/codec etc. If they are not, we have to preload a couple of bytes in the plugin for probing purposes before we can return a VideoClipObject.

---

<div class="post-metadata">

**Author:** ![Evgheny](https://avatars.discourse-cdn.com/v4/letter/e/4da419/32.png) [@Evgheny](https://forums.plex.tv/u/Evgheny)\
**Post date:** [September 1, 2013, 1:35am UTC](https://forums.plex.tv/t/kartinatv-plugin/39882/14 "2013-09-01T01:35:32Z")

</div>

Serge.Stre,

Нет, я не тот парень :) Ты меня перепутал с кем то. :)

По поводу подозрений - Это был плагин именно для КартиныТВ. Начатый Alex Titoff, который я хотел восстановить.

Очень долго возился. Пробовал и так и сяк. На контакт они идут неохотно, у них действительно потом плексом не хочет определяться.

Поэтому я прекратил доработку этого плагина, и сел писать плагин именно для РодиныТВ.

**meo,**

Thank you very much for your participation. But I, unfortunately, I stop working on this plugin since moved on to another operator.  
I can go for help if we need it?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 20, 2019, 11:53pm UTC](https://forums.plex.tv/t/kartinatv-plugin/39882/15 "2019-12-20T23:53:43Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
