Commits

Artyom Smirnov committed 67d1bdc

Simple tvrain plugin for Plex

Supports only live streaming

Comments (0)

Files changed (7)

+#!/bin/sh
+
+DEST="/Users/$USER/Library/Application Support/Plex Media Server/Plug-ins/"
+
+echo Cleaning old plugin version
+rm -rf "$DEST/tvrain.bundle"
+
+echo Installing new plugin version
+cp -r tvrain.bundle "$DEST"

tvrain.bundle/Contents/Code/__init__.py

+VIDEO_PREFIX = "/video/tvrain"
+
+NAME = L('Title')
+
+ART  = 'art-default.jpg'
+ICON = 'icon.png'
+
+####################################################################################################
+
+def Start():
+    Plugin.AddPrefixHandler(VIDEO_PREFIX, VideoMainMenu, NAME, ICON, ART)
+
+    Plugin.AddViewGroup("InfoList", viewMode="InfoList", mediaType="items")
+    Plugin.AddViewGroup("List", viewMode="List", mediaType="items")
+
+    MediaContainer.title1 = NAME
+    MediaContainer.viewGroup = "List"
+    MediaContainer.art = R(ART)
+    DirectoryItem.thumb = R(ICON)
+    VideoItem.thumb = R(ICON)
+    
+    HTTP.CacheTime = CACHE_1HOUR
+
+
+def VideoMainMenu():
+    dir = MediaContainer(mediaType='video')
+
+    channels = (
+        '1m',
+        '640k',
+        '340k')
+
+    for c in channels:
+        title = 'Live (%s)' % c
+        clip='TVRain_%s.stream' % c
+        dir.Append(Function(WebVideoItem(Play, title, thumb=R(ICON)), clip=clip))
+    
+    return dir
+
+def Play(sender, clip):
+    u="rtmp://tvrain-video.ngenix.net/secure/"
+    w=640
+    h=360
+    return Redirect(RTMPVideoItem(url=u, clip=clip, live=True, width=w, height=h))

tvrain.bundle/Contents/DefaultPrefs.json

+[
+]

tvrain.bundle/Contents/Info.plist

+<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+    <key>CFBundleDevelopmentRegion</key>
+    <string>English</string>
+    <key>CFBundleExecutable</key>
+    <string></string>
+    <key>CFBundleIdentifier</key>
+    <string>com.plexapp.plugins.tvrain</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundlePackageType</key>
+	<string>AAPL</string>
+	<key>CFBundleSignature</key>
+	<string>hook</string>
+	<key>CFBundleVersion</key>
+	<string>1.0</string>
+	
+	<key>PlexClientPlatforms</key>
+	<string>MacOSX</string>
+	<!-- TO ENABLE IOS
+	<key>PlexClientPlatforms</key>
+	<string>MacOSX,iOS</string>-->
+	
+	<!--
+	<key>PlexMediaContainer</key>
+	<array>
+	### PICK THE APPROPRIATE ONES
+		<string>Flash</string>
+		<string>MP4</string>
+		<string>FLV</string>
+	</array>
+	<key>PlexVideoCodec</key>
+	<array>
+		<string>H.264</string>
+		<string>H.263</string>
+	</array>
+	<key>PlexAudioCodec</key>
+	<array>
+		<string>AAC</string>
+		<string>MP3</string>
+	</array>
+	-->
+	
+	<key>PlexFrameworkVersion</key>
+	<string>2</string>
+	<key>PlexPluginMode</key>
+	<string>AlwaysOn</string>
+	
+	<key>PlexPluginConsoleLogging</key>
+	<string>1</string>
+	<key>PlexPluginDevMode</key>
+	<string>0</string>
+</dict>
+</plist>

tvrain.bundle/Contents/Resources/art-default.jpg

Added
New image

tvrain.bundle/Contents/Resources/icon.png

Added
New image

tvrain.bundle/Contents/Strings/en.json

+{
+    "Title": "Дождь. Optimistic channel"
+}