home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
Popular Plugins
OnlineVideos
Plugin develop problem
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="sax" data-source="post: 617392" data-attributes="member: 103375"><p>I want to make a plugin for Nova TV (<a href="http://videoteka.novatv.hr" target="_blank">Naslovnica - NOVA TV</a>).</p><p>I added the following items in OnlineVideoSites.xml .</p><p></p><p>[CODE] <Site name="Videoteka NOVA" util="NovaTV" agecheck="false" enabled="true" lang="hr"></p><p> <Configuration></p><p> <item key="dynamicCategoriesRegEx"><![CDATA[]]></item></p><p> <item key="dynamicCategoryUrlDecoding"><![CDATA[False]]></item></p><p> <item key="dynamicSubCategoryUrlDecoding"><![CDATA[False]]></item></p><p> <item key="videoListRegEx"><![CDATA[\<div\sclass="thumb"\>.*?\<div\sclass="img"\>.*?\<img\ssrc="(?<imageUrl>[^"]+).*?\<h2\>\<a\shref="(?<VideoUrl>[^"]+)"\>(?<Title>[^<]+)]]></item></p><p> <item key="videoUrlDecoding"><![CDATA[False]]></item></p><p> <item key="nextPageRegEx"><![CDATA[\<span\sclass='next'\>\<a\shref='(?<NextUrl>[^']+)]]></item></p><p> <item key="nextPageRegExUrlDecoding"><![CDATA[False]]></item></p><p> <item key="prevPageRegEx"><![CDATA[\<span\sclass='previous'\>\<a\shref='(?<PreviousUrl>[^']+)]]></item></p><p> <item key="prevPageRegExUrlDecoding"><![CDATA[False]]></item></p><p> <item key="baseUrl"><![CDATA[http://videoteka.novatv.hr]]></item></p><p> <item key="forceUTF8Encoding"><![CDATA[True]]></item></p><p> </Configuration></p><p> <Categories></p><p> <Category xsi:type="RssLink" name="Informativne emisije ">http://videoteka.novatv.hr/pretraga?group=false&amp;go=Search&amp;keyword=&amp;date=&amp;parent_id=4&amp;channel=&amp;sbmt=Pretraga</Category></p><p> <Category xsi:type="RssLink" name="Serije ">http://videoteka.novatv.hr/pretraga?group=false&amp;go=Search&amp;keyword=&amp;date=&amp;parent_id=6&amp;channel=&amp;sbmt=Pretraga</Category></p><p> <Category xsi:type="RssLink" name="Mini TV ">http://videoteka.novatv.hr/pretraga?group=false&amp;go=Search&amp;keyword=&amp;date=&amp;parent_id=485&amp;channel=&amp;sbmt=Pretraga</Category></p><p> <Category xsi:type="RssLink" name="Sport.dnevnik.hr">http://videoteka.novatv.hr/pretraga?type_id=27274&amp;parent_id=27274&amp;group=true&amp;order=date</Category></p><p> <Category xsi:type="RssLink" name="Dnevnik.hr">http://videoteka.novatv.hr/pretraga?type_id=27263&amp;parent_id=27263&amp;group=true&amp;order=date</Category></p><p> <Category xsi:type="RssLink" name="Zadovoljna.com.hr">http://videoteka.novatv.hr/pretraga?type_id=27270&amp;parent_id=27270&amp;group=true&amp;order=date</Category></p><p> <Category xsi:type="RssLink" name="Showbizz">http://videoteka.novatv.hr/pretraga?type_id=30924&amp;parent_id=30924&amp;group=true&amp;order=date</Category></p><p> <Category xsi:type="RssLink" name="Emisije i magazini ">http://videoteka.novatv.hr/pretraga?group=false&amp;go=Search&amp;keyword=&amp;date=&amp;parent_id=40878&amp;channel=&amp;sbmt=Pretraga</Category></p><p> <Category xsi:type="RssLink" name="Svi videi ">http://videoteka.novatv.hr/pretraga?group=false&amp;go=Search&amp;keyword=&amp;date=&amp;parent_id=&amp;channel=&amp;sbmt=Pretraga</Category></p><p> </Categories></p><p> </Site>[/CODE]</p><p></p><p>I create NovaTVUtil.cs class and added to the OnlineVideos\SiteUtilProjects\OnlineVideos.Sites.hioctane and build project.</p><p></p><p>Class NovaTVUtil.cs:</p><p></p><p>[CODE]using System;</p><p>using System.Collections.Generic;</p><p>using System.Text;</p><p>using System.Text.RegularExpressions;</p><p></p><p>namespace OnlineVideos.Sites</p><p>{</p><p> </p><p> public class NovaTVUtil : GenericSiteUtil</p><p> {</p><p> private string URL_regEx = @"//user\strack\svariables.*?var\sut_section_id\s=\s""(?<ut_section_id>[^""]+).*?var\smedia_id\s=\s""(?<media_id>[^""]+).*?var\ssite_id\s=\s""(?<site_id>[^""]+).*?var\ssection_id\s=\s'(?<section_id>[^']+)";</p><p> private string URLFile_regEx = @"\<item\stype="".*?src=""(?<FileUrl>[^""]+).*?server=""(?<FileServer>[^""]+)";</p><p> private Regex regEx_URL;</p><p> private Regex regEx_URLFile;</p><p></p><p> private string ut_section_id;</p><p> private string media_id;</p><p> private string site_id;</p><p> private string section_id;</p><p></p><p> private string FileUrl;</p><p> private string FileServer;</p><p></p><p> }</p><p> }</p><p></p><p> public override String getUrl(VideoInfo video)</p><p> {</p><p> string data = GetWebData(video.VideoUrl);</p><p> regEx_URL = new Regex(URL_regEx, RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.Multiline | RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline);</p><p> Match m = regEx_URL.Match(data);</p><p></p><p> if (m.Success)</p><p> {</p><p> ut_section_id = m.Groups["ut_section_id"].Value;</p><p> media_id = m.Groups["media_id"].Value;</p><p> site_id = m.Groups["site_id"].Value;</p><p> section_id = m.Groups["section_id"].Value;</p><p> }</p><p></p><p> data = GetWebData("http://dnevnik.hr/bin/player/?mod=serve&site_id=" + site_id + "&media_id=" + media_id +</p><p> "&userad_id=&section_id=" + section_id);</p><p> regEx_URLFile = new Regex(URLFile_regEx, RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.Multiline | RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline);</p><p> m = regEx_URLFile.Match(data);</p><p></p><p> if (m.Success)</p><p> {</p><p> FileUrl = m.Groups["FileUrl"].Value;</p><p> FileServer = m.Groups["FileServer"].Value;</p><p> data = "http://vid" + FileServer + ".dnevnik.hr/" + FileUrl + "-" + FileServer + ".flv";</p><p> }</p><p> return data;</p><p> }</p><p> }</p><p>}[/CODE]</p><p></p><p>When I run plugin, and select a video, function GetWebData (video.VideoUrl) returns me an error "The operation has timed out" and a popup message box: Error getting video playback from urls!</p><p>In function getUrl (VideoInfo video) I get a regula video parameter (eg "http://videoteka.novatv.hr/multimedia/vijesti-nove-tv-459.html")</p><p>Plugin sometimes works normally and display video, but mostly returns an error</p><p></p><p>The error occurs in the class OnlineVideos\Plugin\Gui2UtilConnector.cs, in function Internal bool ExecuteInBackgroundAndWait (ThreadStart task, string taskdescription).</p><p></p><p>Can anyone help me?</p><p></p><p>THX SaX</p></blockquote><p></p>
[QUOTE="sax, post: 617392, member: 103375"] I want to make a plugin for Nova TV ([url=http://videoteka.novatv.hr]Naslovnica - NOVA TV[/url]). I added the following items in OnlineVideoSites.xml . [CODE] <Site name="Videoteka NOVA" util="NovaTV" agecheck="false" enabled="true" lang="hr"> <Configuration> <item key="dynamicCategoriesRegEx"><![CDATA[]]></item> <item key="dynamicCategoryUrlDecoding"><![CDATA[False]]></item> <item key="dynamicSubCategoryUrlDecoding"><![CDATA[False]]></item> <item key="videoListRegEx"><![CDATA[\<div\sclass="thumb"\>.*?\<div\sclass="img"\>.*?\<img\ssrc="(?<imageUrl>[^"]+).*?\<h2\>\<a\shref="(?<VideoUrl>[^"]+)"\>(?<Title>[^<]+)]]></item> <item key="videoUrlDecoding"><![CDATA[False]]></item> <item key="nextPageRegEx"><![CDATA[\<span\sclass='next'\>\<a\shref='(?<NextUrl>[^']+)]]></item> <item key="nextPageRegExUrlDecoding"><![CDATA[False]]></item> <item key="prevPageRegEx"><![CDATA[\<span\sclass='previous'\>\<a\shref='(?<PreviousUrl>[^']+)]]></item> <item key="prevPageRegExUrlDecoding"><![CDATA[False]]></item> <item key="baseUrl"><![CDATA[http://videoteka.novatv.hr]]></item> <item key="forceUTF8Encoding"><![CDATA[True]]></item> </Configuration> <Categories> <Category xsi:type="RssLink" name="Informativne emisije ">http://videoteka.novatv.hr/pretraga?group=false&go=Search&keyword=&date=&parent_id=4&channel=&sbmt=Pretraga</Category> <Category xsi:type="RssLink" name="Serije ">http://videoteka.novatv.hr/pretraga?group=false&go=Search&keyword=&date=&parent_id=6&channel=&sbmt=Pretraga</Category> <Category xsi:type="RssLink" name="Mini TV ">http://videoteka.novatv.hr/pretraga?group=false&go=Search&keyword=&date=&parent_id=485&channel=&sbmt=Pretraga</Category> <Category xsi:type="RssLink" name="Sport.dnevnik.hr">http://videoteka.novatv.hr/pretraga?type_id=27274&parent_id=27274&group=true&order=date</Category> <Category xsi:type="RssLink" name="Dnevnik.hr">http://videoteka.novatv.hr/pretraga?type_id=27263&parent_id=27263&group=true&order=date</Category> <Category xsi:type="RssLink" name="Zadovoljna.com.hr">http://videoteka.novatv.hr/pretraga?type_id=27270&parent_id=27270&group=true&order=date</Category> <Category xsi:type="RssLink" name="Showbizz">http://videoteka.novatv.hr/pretraga?type_id=30924&parent_id=30924&group=true&order=date</Category> <Category xsi:type="RssLink" name="Emisije i magazini ">http://videoteka.novatv.hr/pretraga?group=false&go=Search&keyword=&date=&parent_id=40878&channel=&sbmt=Pretraga</Category> <Category xsi:type="RssLink" name="Svi videi ">http://videoteka.novatv.hr/pretraga?group=false&go=Search&keyword=&date=&parent_id=&channel=&sbmt=Pretraga</Category> </Categories> </Site>[/CODE] I create NovaTVUtil.cs class and added to the OnlineVideos\SiteUtilProjects\OnlineVideos.Sites.hioctane and build project. Class NovaTVUtil.cs: [CODE]using System; using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions; namespace OnlineVideos.Sites { public class NovaTVUtil : GenericSiteUtil { private string URL_regEx = @"//user\strack\svariables.*?var\sut_section_id\s=\s""(?<ut_section_id>[^""]+).*?var\smedia_id\s=\s""(?<media_id>[^""]+).*?var\ssite_id\s=\s""(?<site_id>[^""]+).*?var\ssection_id\s=\s'(?<section_id>[^']+)"; private string URLFile_regEx = @"\<item\stype="".*?src=""(?<FileUrl>[^""]+).*?server=""(?<FileServer>[^""]+)"; private Regex regEx_URL; private Regex regEx_URLFile; private string ut_section_id; private string media_id; private string site_id; private string section_id; private string FileUrl; private string FileServer; } } public override String getUrl(VideoInfo video) { string data = GetWebData(video.VideoUrl); regEx_URL = new Regex(URL_regEx, RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.Multiline | RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline); Match m = regEx_URL.Match(data); if (m.Success) { ut_section_id = m.Groups["ut_section_id"].Value; media_id = m.Groups["media_id"].Value; site_id = m.Groups["site_id"].Value; section_id = m.Groups["section_id"].Value; } data = GetWebData("http://dnevnik.hr/bin/player/?mod=serve&site_id=" + site_id + "&media_id=" + media_id + "&userad_id=§ion_id=" + section_id); regEx_URLFile = new Regex(URLFile_regEx, RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.Multiline | RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline); m = regEx_URLFile.Match(data); if (m.Success) { FileUrl = m.Groups["FileUrl"].Value; FileServer = m.Groups["FileServer"].Value; data = "http://vid" + FileServer + ".dnevnik.hr/" + FileUrl + "-" + FileServer + ".flv"; } return data; } } }[/CODE] When I run plugin, and select a video, function GetWebData (video.VideoUrl) returns me an error "The operation has timed out" and a popup message box: Error getting video playback from urls! In function getUrl (VideoInfo video) I get a regula video parameter (eg "http://videoteka.novatv.hr/multimedia/vijesti-nove-tv-459.html") Plugin sometimes works normally and display video, but mostly returns an error The error occurs in the class OnlineVideos\Plugin\Gui2UtilConnector.cs, in function Internal bool ExecuteInBackgroundAndWait (ThreadStart task, string taskdescription). Can anyone help me? THX SaX [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Popular Plugins
OnlineVideos
Plugin develop problem
Contact us
RSS
Top
Bottom