Hello guest, if you read this it means you are not registered. Click here to register in a few simple steps, you will enjoy all features of our Forum.
The following warnings occurred:
Warning [2] Undefined array key "isclosed" - Line: 203 - File: inc/plugins/guestwarn.php PHP 8.1.31 (Linux)
File Line Function
/inc/plugins/guestwarn.php 203 errorHandler->error
/inc/class_plugins.php 142 guestwarn
/global.php 99 pluginSystem->run_hooks
/showthread.php 28 require_once
Warning [2] Trying to access array offset on value of type null - Line: 14 - File: inc/plugins/cookielaw.php(272) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/plugins/cookielaw.php(272) : eval()'d code 14 errorHandler->error
/inc/plugins/cookielaw.php 272 eval
/inc/class_plugins.php 142 cookielaw_global_intermediate
/global.php 99 pluginSystem->run_hooks
/showthread.php 28 require_once
Warning [2] Trying to access array offset on value of type null - Line: 14 - File: inc/plugins/cookielaw.php(272) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/plugins/cookielaw.php(272) : eval()'d code 14 errorHandler->error
/inc/plugins/cookielaw.php 272 eval
/inc/class_plugins.php 142 cookielaw_global_intermediate
/global.php 99 pluginSystem->run_hooks
/showthread.php 28 require_once
Warning [2] Undefined array key "action" - Line: 1145 - File: inc/plugins/thx.php PHP 8.1.31 (Linux)
File Line Function
/inc/plugins/thx.php 1145 errorHandler->error
/inc/class_plugins.php 142 thx_global_start
/global.php 99 pluginSystem->run_hooks
/showthread.php 28 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined variable $awaitingusers - Line: 126 - File: global.php(844) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(844) : eval()'d code 126 errorHandler->error
/global.php 844 eval
/showthread.php 28 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5132 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5132 errorHandler->error
/global.php 909 build_theme_select
/showthread.php 28 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7288 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7288 errorHandler->error
/inc/functions.php 5152 is_member
/global.php 909 build_theme_select
/showthread.php 28 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7288 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7288 errorHandler->error
/inc/functions.php 5152 is_member
/global.php 909 build_theme_select
/showthread.php 28 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7288 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7288 errorHandler->error
/inc/functions.php 5152 is_member
/global.php 909 build_theme_select
/showthread.php 28 require_once
Warning [2] Undefined array key 1 - Line: 1440 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1440 errorHandler->error
/inc/functions.php 1405 fetch_forum_permissions
/inc/functions.php 2934 forum_permissions
/showthread.php 656 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1440 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1440 errorHandler->error
/inc/functions.php 1405 fetch_forum_permissions
/inc/functions.php 2934 forum_permissions
/showthread.php 656 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1440 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1440 errorHandler->error
/inc/functions.php 1405 fetch_forum_permissions
/inc/functions.php 2934 forum_permissions
/showthread.php 656 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1440 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1440 errorHandler->error
/inc/functions.php 1405 fetch_forum_permissions
/inc/functions.php 2934 forum_permissions
/showthread.php 656 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1440 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1440 errorHandler->error
/inc/functions.php 1405 fetch_forum_permissions
/inc/functions.php 2934 forum_permissions
/showthread.php 656 build_forum_jump
Warning [2] Trying to access array offset on value of type null - Line: 488 - File: inc/db_mysqli.php PHP 8.1.31 (Linux)
File Line Function
/inc/db_mysqli.php 488 errorHandler->error
/showthread.php 757 DB_MySQLi->fetch_field
Warning [2] Undefined property: MyLanguage::$ratings_update_error - Line: 5 - File: showthread.php(767) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(767) : eval()'d code 5 errorHandler->error
/showthread.php 767 eval
Warning [2] Undefined variable $postsdone - Line: 902 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 902 errorHandler->error
Warning [2] Trying to access array offset on value of type null - Line: 902 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 902 errorHandler->error
Warning [2] Undefined array key 21576 - Line: 902 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 902 errorHandler->error
Warning [2] Undefined array key 21577 - Line: 902 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 902 errorHandler->error
Warning [2] Undefined array key 21578 - Line: 902 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 902 errorHandler->error
Warning [2] Undefined array key 21604 - Line: 902 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 902 errorHandler->error
Warning [2] Undefined array key 21608 - Line: 902 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 902 errorHandler->error
Warning [2] Undefined array key 21611 - Line: 902 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 902 errorHandler->error
Warning [2] Undefined array key 21612 - Line: 902 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 902 errorHandler->error
Warning [2] Undefined array key 22352 - Line: 902 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 902 errorHandler->error
Warning [2] Undefined array key 22874 - Line: 902 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 902 errorHandler->error
Warning [2] Undefined array key 21576 - Line: 1616 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1616 errorHandler->error
/showthread.php 1618 buildtree
/showthread.php 914 buildtree
Warning [2] Undefined array key 21577 - Line: 1616 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1616 errorHandler->error
/showthread.php 1618 buildtree
/showthread.php 914 buildtree
Warning [2] Undefined array key 21578 - Line: 1616 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1616 errorHandler->error
/showthread.php 1618 buildtree
/showthread.php 914 buildtree
Warning [2] Undefined array key 21604 - Line: 1616 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1616 errorHandler->error
/showthread.php 1618 buildtree
/showthread.php 914 buildtree
Warning [2] Undefined array key 21608 - Line: 1616 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1616 errorHandler->error
/showthread.php 1618 buildtree
/showthread.php 914 buildtree
Warning [2] Undefined array key 21611 - Line: 1616 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1616 errorHandler->error
/showthread.php 1618 buildtree
/showthread.php 914 buildtree
Warning [2] Undefined array key 22874 - Line: 1616 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1616 errorHandler->error
/showthread.php 1618 buildtree
/showthread.php 1618 buildtree
/showthread.php 914 buildtree
Warning [2] Undefined array key 22352 - Line: 1616 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1616 errorHandler->error
/showthread.php 1618 buildtree
/showthread.php 914 buildtree
Warning [2] Undefined array key "additionalgroups" - Line: 7288 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7288 errorHandler->error
/inc/functions_user.php 844 is_member
/inc/functions_post.php 406 purgespammer_show
/showthread.php 915 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 5 - File: inc/functions_post.php(474) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php(474) : eval()'d code 5 errorHandler->error
/inc/functions_post.php 474 eval
/showthread.php 915 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 662 - File: inc/functions_post.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php 662 errorHandler->error
/showthread.php 915 build_postbit
Warning [2] Undefined array key "showimages" - Line: 747 - File: inc/functions_post.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php 747 errorHandler->error
/showthread.php 915 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 752 - File: inc/functions_post.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php 752 errorHandler->error
/showthread.php 915 build_postbit
Warning [2] Undefined array key "highlight" - Line: 1248 - File: inc/plugins/thx.php PHP 8.1.31 (Linux)
File Line Function
/inc/plugins/thx.php 1248 errorHandler->error
/inc/class_plugins.php 142 thx_code
/inc/class_parser.php 201 pluginSystem->run_hooks
/inc/functions_post.php 764 postParser->parse_message
/showthread.php 915 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1273 - File: inc/plugins/thx.php PHP 8.1.31 (Linux)
File Line Function
/inc/plugins/thx.php 1273 errorHandler->error
/inc/class_plugins.php 142 thx_code
/inc/class_parser.php 201 pluginSystem->run_hooks
/inc/functions_post.php 764 postParser->parse_message
/showthread.php 915 build_postbit
Warning [2] Undefined array key "additionalgroups" - Line: 1281 - File: inc/plugins/thx.php PHP 8.1.31 (Linux)
File Line Function
/inc/plugins/thx.php 1281 errorHandler->error
/inc/class_plugins.php 142 thx_code
/inc/class_parser.php 201 pluginSystem->run_hooks
/inc/functions_post.php 764 postParser->parse_message
/showthread.php 915 build_postbit
Warning [2] Undefined variable $start - Line: 1413 - File: inc/plugins/thx.php PHP 8.1.31 (Linux)
File Line Function
/inc/plugins/thx.php 1413 errorHandler->error
/inc/class_plugins.php 142 thx
/inc/functions_post.php 832 pluginSystem->run_hooks
/showthread.php 915 build_postbit
Warning [2] Undefined variable $perpage - Line: 1413 - File: inc/plugins/thx.php PHP 8.1.31 (Linux)
File Line Function
/inc/plugins/thx.php 1413 errorHandler->error
/inc/class_plugins.php 142 thx
/inc/functions_post.php 832 pluginSystem->run_hooks
/showthread.php 915 build_postbit
Warning [2] Undefined array key "thx_attach_enabled" - Line: 1902 - File: inc/plugins/thx.php PHP 8.1.31 (Linux)
File Line Function
/inc/plugins/thx.php 1902 errorHandler->error
/inc/class_plugins.php 142 thx_clear
/inc/functions_post.php 832 pluginSystem->run_hooks
/showthread.php 915 build_postbit
Warning [2] Undefined array key "thx_list" - Line: 27 - File: inc/functions_post.php(877) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php(877) : eval()'d code 27 errorHandler->error
/inc/functions_post.php 877 eval
/showthread.php 915 build_postbit
Warning [2] Undefined array key "thanks" - Line: 44 - File: inc/functions_post.php(877) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php(877) : eval()'d code 44 errorHandler->error
/inc/functions_post.php 877 eval
/showthread.php 915 build_postbit
Warning [2] Array to string conversion - Line: 49 - File: inc/functions_post.php(877) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php(877) : eval()'d code 49 errorHandler->error
/inc/functions_post.php 877 eval
/showthread.php 915 build_postbit
Warning [2] Array to string conversion - Line: 49 - File: inc/functions_post.php(877) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php(877) : eval()'d code 49 errorHandler->error
/inc/functions_post.php 877 eval
/showthread.php 915 build_postbit
Warning [2] Undefined array key "canonlyviewownthreads" - Line: 1120 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1120 errorHandler->error
Warning [2] Undefined array key "threadprefix" - Line: 4 - File: showthread.php(1207) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1207) : eval()'d code 4 errorHandler->error
/showthread.php 1207 eval
Warning [2] Undefined array key "threadprefix" - Line: 4 - File: showthread.php(1207) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1207) : eval()'d code 4 errorHandler->error
/showthread.php 1207 eval
Warning [2] Undefined array key "threadprefix" - Line: 4 - File: showthread.php(1207) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1207) : eval()'d code 4 errorHandler->error
/showthread.php 1207 eval
Warning [2] Undefined array key "threadprefix" - Line: 4 - File: showthread.php(1207) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1207) : eval()'d code 4 errorHandler->error
/showthread.php 1207 eval
Warning [2] Undefined array key "threadprefix" - Line: 4 - File: showthread.php(1207) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1207) : eval()'d code 4 errorHandler->error
/showthread.php 1207 eval
Warning [2] Undefined array key "threadprefix" - Line: 4 - File: showthread.php(1207) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1207) : eval()'d code 4 errorHandler->error
/showthread.php 1207 eval
Warning [2] Undefined array key "threadprefix" - Line: 4 - File: showthread.php(1207) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1207) : eval()'d code 4 errorHandler->error
/showthread.php 1207 eval
Warning [2] Undefined array key "threadprefix" - Line: 4 - File: showthread.php(1207) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1207) : eval()'d code 4 errorHandler->error
/showthread.php 1207 eval
Warning [2] Undefined array key "threadprefix" - Line: 4 - File: showthread.php(1207) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1207) : eval()'d code 4 errorHandler->error
/showthread.php 1207 eval
Warning [2] Undefined array key "threadprefix" - Line: 4 - File: showthread.php(1207) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1207) : eval()'d code 4 errorHandler->error
/showthread.php 1207 eval
Warning [2] Undefined array key "invisible" - Line: 1546 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1546 errorHandler->error
Warning [2] Undefined variable $threadnotesbox - Line: 32 - File: showthread.php(1573) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1573) : eval()'d code 32 errorHandler->error
/showthread.php 1573 eval
Warning [2] Undefined variable $multipage - Line: 64 - File: showthread.php(1573) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1573) : eval()'d code 64 errorHandler->error
/showthread.php 1573 eval
Warning [2] Undefined variable $addremovesubscription - Line: 78 - File: showthread.php(1573) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1573) : eval()'d code 78 errorHandler->error
/showthread.php 1573 eval



This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.
  • ¡Welcome to InfoServ!
Hello There, Guest! Login Register


Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Title: TSmedia addons development
Thread Modes
#5
1
Better response on post RE: TSmedia addons developmentWriting TSmedia addon

TSmedia addon code and directory structure based on kodi addons with significant modification to make it more simpler and appropriate for enigma2.
Writing addon for TSmedia is very simple with less code lines than any other similar host code for any iptv stream application.
will not go through the basic of python,a lot of tutorial available on the internet for who interested.
fist step to create TSmedia addon by help of wTSmedia.
just go to menu addon and select create new addon

[Image: screenshot-235.png]

default template appears,all needed to fill the required fields and follow the steps to create the addon.
[Image: screenshot-236.png]

Now the addon is created and the default py module is ready for editing and adding your code.
new addon template
PHP Code:
# -*- coding: utf8 -*-
import urllib,urllib2,re,sys,os
from iTools import CBaseAddonClass
,printD,printE

##########################################
class myaddon(CBaseAddonClass):
 
   def __init__(self):
 
           CBaseAddonClass.__init__(self,{'cookie':'myaddon.cookie'})
 
           self.USER_AGENT 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0'
 
           self.MAIN_URL ="http://myaddon.com" 
 
           self.HEADER = {'User-Agent'self.USER_AGENT'DNT':'1''Accept''text/html''Accept-Encoding':'gzip, deflate''Referer':self.getMainUrl(), 'Origin':self.getMainUrl()}
 
           self.AJAX_HEADER dict(self.HEADER)
 
           self.AJAX_HEADER.update( {'X-Requested-With''XMLHttpRequest''Accept-Encoding':'gzip, deflate''Content-Type':'application/x-www-form-urlencoded; charset=UTF-8''Accept':'application/json, text/javascript, */*; q=0.01'} )
 
           self.cacheLinks  = {}
 
           self.defaultParams = {'header':self.HEADER'raw_post_data':True'use_cookie'True'load_cookie'True'save_cookie'True'cookiefile'self.COOKIE_FILE}
 
   def showmenu(self):
 
           
                self
.addDir('search','https://yts.lt/api/v2/list_movies.json?limit=50&sort_by=date_added&quality=all&genre=all',103,'img/search.png','',1,searchall=True)
 
               self.addDir('Most Downloads','https://yts.lt/api/v2/list_movies.json?limit=50&sort_by=date_added&quality=all&genre=all',100,'img/1.png','',1)
 
               self.addDir('Recent','https://yts.lt/api/v2/list_movies.json?limit=50&sort_by=download_count&quality=all&genre=all',100,'img/2.png','',1)
 
               self.addDir('Top rated','https://yts.lt/api/v2/list_movies.json?limit=50&sort_by=rating&quality=all&genre=all',100,'img/3.png','',1)
 
               self.addDir('Most liked','https://yts.lt/api/v2/list_movies.json?limit=50&sort_by=like_count&quality=all&genre=all',100,'img/4.png','',1)



 
   def search_103(self,name,sterm,page):
 
           surl='https://m2.arabseed.net/?s='
 
           if page>1:
 
               url_page='https://m2.arabseed.net/page/%s/?s=%s'%(str(page),sterm)
 
           else:
 
               url_page=surl+sterm
             
##################################################################
 
           data=self.getcfPage(url_page)
 
           if data is None:
 
               return
            print 
"data",data
            
#data=self.getDM(data,'ti-video-library','class="pagination"',False)
 
           blocks=data.split('class="BlockItem ISMovie"')
 
           i=0
            print 
"blocks",len(blocks)
 
           blocks.pop(0)
 
           print "block",blocks[0]
 
           for block in blocks:
 
               
                regx
='''href="(.*?)"'''                   
                href
=self.getSM(block,regx)
 
               regx='''data-src="(.*?)"'''                   
                image
=self.getSM(block,regx)
 
               regx='''title="(.*?)"'''                   
                title
=self.getSM(block,regx)
 
               
                regx
='''<div class="Rate">imdb <em>(.*?)</em></div>'''                   
                rating
=self.getSM(block,regx)
 
               if rating!='':
 
                   
                  title
=title+"("+rating+")"
 
               regx='''<p>(.*?)</p>'''
 
               desc=self.getSM(block,regx)
 
               title=title.replace("&#8217"," ")
 
               title=self.colorize(title,"green")
 
               if 'مسلسل' in title:
 
                   mode=201
                else
:
 
                   mode=1
                try
:self.addDir(title,href,mode,image,name,1,True,desc=desc)
 
               except:pass
            if len
(blocks)>22:
 
               self.addDir("next page",sterm,103,'img/next.png','',str(page+1),dialog='nsearch')




 
   def getmovies_100(self,name,url,page):
 
           if page>1:
 
               #http://arabseed.net/cat_film/%D8%A7%D9%81%D9%84%D8%A7%D9%85-%D8%A7%D8%AC%D9%86%D8%A8%D9%8A/page/2/
 
               url_page=url+"?page="+str(page)
 
           else:
 
               url_page=url
            data
=self.getcfPage(url_page)
 
            
            if data is None
:
 
               return
            
#data=self.getDM(data,'ti-video-library','class="pagination"',False)
 
           blocks=data.split('class="BlockItem ISMovie"')
 
           i=0
            blocks
.pop(0)
 
           print "block",blocks[0]
 
           for block in blocks:
 
               
                regx
='''href="(.*?)"'''                   
                href
=self.getSM(block,regx)
 
               regx='''data-src="(.*?)"'''                   
                image
=self.getSM(block,regx)
 
               regx='''title="(.*?)"'''                   
                title
=self.getSM(block,regx)
 
               
                regx
='''<div class="Rate">imdb <em>(.*?)</em></div>'''                   
                rating
=self.getSM(block,regx)
 
               if rating!='':
 
                   
                  title
=title+"("+rating+")"
 
               regx='''<p>(.*?)</p>'''
 
               desc=self.getSM(block,regx)
 
               title=title.replace("&#8217"," ")
 
               title=self.colorize(title,"green")
 
               try:self.addDir(title,href,1,image,name,1,True,desc=desc)
 
               except:pass
            if len
(blocks)>22:
 
               self.addDir("next page",url,100,'img/next.png','',str(page+1))




 
               
    
###############################################series
 
   def getseries_200(self,name,url,page):
 
           if page>1:
 
               #http://arabseed.net/cat_film/%D8%A7%D9%81%D9%84%D8%A7%D9%85-%D8%A7%D8%AC%D9%86%D8%A8%D9%8A/page/2/
 
               url_page=url+"?page="+str(page)
 
           else:
 
               url_page=url
            data
=self.getPage(url_page)
 
           if data is None:
 
               return
            blocks
=data.split('class="BlockItem ISMovie"')
 
           i=0
            blocks
.pop(0)
 
           print "block",blocks[0]
 
           for block in blocks:
 
               
                regx
='''href="(.*?)"'''                   
                href
=self.getSM(block,regx)
 
               regx='''data-src="(.*?)"'''                   
                image
=self.getSM(block,regx)
 
               regx='''title="(.*?)"'''                   
                title
=self.getSM(block,regx)
 
               
                regx
='''<div class="Rate">imdb <em>(.*?)</em></div>'''                   
                rating
=self.getSM(block,regx)
 
               if rating!='':
 
                   
                  title
=title+"("+rating+")"
 
               regx='''<p>(.*?)</p>'''
 
               desc=self.getSM(block,regx)
 
               title=self.colorize(title,"green")
 
               if 'كامل' in title:
 
                   continue
                title
=title.replace("&#8217"," ")
 
               try:self.addDir(title,href,201,image,name,1,True,desc=desc)
 
               except:pass
            if len
(blocks)>22:
 
               self.addDir("next page",url,200,'img/next.png','',str(page+1))
 
   ###############################################series
 
   def getepisode_201(self,name,url,image,page,extra,desc=''):
 
       self.addDir(name,url,1,image,name,1,extra=extra,desc=desc,dialog='servers')
 
       self.addDir("حلقات اخرى",url,202,image,name,1,extra=extra,desc=desc,dialog='servers'
 
   def getepisodes_202(self,name,url,image,page,extra):
 
           print '**************////////////////////////*******************//////////////////'
 
           data=self.getPage(url)
 
           #if 'class="BlockItem ISMovie"' in data:
 
                #self.getepisodes_203( name,url,image,page,extra)
 
                #return
 
           extra,desc,img=self.metaData(url='',data=data,image=image)
 
           regx1='''<li class="keywordsLi"><a href="(.*?)">.*?</a>'''
 
           regx='''<a href="(.*?)" class="content-box ">\s(.*?)<span>(.*?)</span>'''
 
           blocks=data.split('episode-block box-11x1')
 
           blocks.pop(0)
 
           for block in blocks:
 
               href=self.getSM(block,'href="(.*?)"')
 
               episode="episode"+"-"+self.getSM(block,'<span>(.*?)</span>')
 
           
                self
.addDir(episode,href,1,image,name,1,extra=extra,desc=desc,dialog='servers')
 
   def getepisodes_203(self,name,url,image,page,extra):
 
           if page>1:
 
               #http://arabseed.net/cat_film/%D8%A7%D9%81%D9%84%D8%A7%D9%85-%D8%A7%D8%AC%D9%86%D8%A8%D9%8A/page/2/
 
               url_page=url+"?page="+str(page)
 
           else:
 
               url_page=url
            data
=self.getPage(url_page)
 
           if data is None:
 
               return
            blocks
=data.split('class="BlockItem ISMovie"')
 
           i=0
            blocks
.pop(0)
 
           print "block",blocks[0]
 
           for block in blocks:
 
               
                regx
='''href="(.*?)"'''                   
                href
=self.getSM(block,regx)
 
               regx='''data-src="(.*?)"'''                   
                image
=self.getSM(block,regx)
 
               regx='''title="(.*?)"'''                   
                title
=self.getSM(block,regx)
 
               
                regx
='''<div class="Rate">imdb <em>(.*?)</em></div>'''                   
                rating
=self.getSM(block,regx)
 
               if rating!='':
 
                   
                  title
=title+"("+rating+")"
 
               regx='''<p>(.*?)</p>'''
 
               desc=self.getSM(block,regx)
 
               title=self.colorize(title,"green")
 
               try:self.addDir(title,href,202,image,name,1,True,desc=desc)
 
               except:pass
            if len
(blocks)>22:
 
               self.addDir("next page",url,200,'img/next.png','',str(page+1))           
    
#######################################host resolving
 
               
    def metaData
(self,data='',extra={},image='',url='',desc='',show='movie'):
 
               if show=='tv':
 
                   self.metaDataTV(url=url,image=image,data=data,desc=desc,extra=extra)
 
                   return
                regx
='''<i class="fa fa-fw fa-star"></i>(.*?)</span>'''
 
               rating=self.getSM(data,regx)
 
               extra['rating']=rating
            

           
                
                year
=self.getDM(data,'<span>تاريخ الاصدار','</li>')
 
               extra['year']=self.cleanhtml(year)
 
           
                country
=self.getDM(data,'<span>الدولة','</li>')
 
               extra['country']=self.cleanhtml(country)
 
               
                language
=self.getDM(data,'<span>اللغة','</li>')
 
               extra['language']=self.cleanhtml(language           
                
                duration
=self.getDM(data,'<span>مدة العرض','</li>')
 
               extra['duration']=self.cleanhtml(duration)
 
           
            
                regx
='''<a href="https://arabseed.net/altsnyf/(.*?)" )"'''                
                pg
=self.getSM(data,regx)
 
               pg=self.cleanhtml(pg)
 
               extra['pg']=pg
                
            
            
                regx
='''<span>النوع"'''
 
               genre=self.getDM(data,'<span>النوع','</li>')
 
               genre=self.cleanhtml(genre,withSpace=True)
 
               extra['genre']=str(genre)
 
           
            
                regx
='''href="https://arabseed.net/quality/(.*?)"'''
 
               quality=self.getDM(data,'<span>الجودة','</li>')
 
               extra['quality']=self.cleanhtml(quality)
 
           
             
                regx
='''<meta name="description" content="(.*?)" />'''
 
               desc=self.getDM(data,'"description": "','",')
 
               desc=self.cleanhtml(desc)
 
               
                poster
=self.getDM(data,'"thumbnailUrl": "','"')
 
               if poster!='':
 
                   image=poster
                       
                 

                return extra
,desc,image
    def getservers_1
(self,name,url,img,extra):
 
           print '7777777777777777777777777777',url
            data
=self.getPage(url)
 
           extra,desc,img=self.metaData(data=data,extra=extra,image=img)
 
           from arabseed import get_arabseed_Servers
            servers
=get_arabseed_Servers(url)
 
           for server,href in servers:
 
               if not 'arabseed' in href and not 'mixdrop' in href:
 
                  server,image,supported=self.getDomain(href)
 
               
                self
.addDir(server,href,3,img,name,1,extra=extra,dialog='servers',desc=desc)
 
   
            return

    def getservers_2
(self,name,url,img,extra,desc):# get server arabseed.me
 
         if 'arabseed' in url :
 
           data=self.getPage(url)
 
           regx='''<source src="(.+?)"'''
 
           hrefs=re.findall(regx,datare.M|re.I)
 
           for href in hrefs:
 
               print '***************************href__*****************',href
                self
.addDir('arabseed'+"-"+name,href,0,img,name,1,extra=extra,dialog='servers',desc=desc)

 
         else:
 
             self.resolvehost(name,url)
 
   def resolve_host(self,name,url):
 
           self.resolvehost(name,url)####
 
   def run(self,params={}):
 
           
            url
=None
            name
=None
            mode
=None
            page
=1
            name
=params.get("name",'')
 
           url=params.get("url",'')
 
           try:mode=int(params.get("mode",None))
 
           except:mode=None
            image
=params.get("image",'')
 
           section=params.get("section",'')
 
           page=int(params.get("page",1))
 
           extra=params.get("extra",{})
 
           desc=params.get("desc",''
 
           show=params.get("show",'')
 
           ##menu and tools
 
           if mode==None:
 
               self.showmenu()
 
           ##hosts       
 
           elif mode==1:
 
               self.getservers_1(name,url,image,extra)
 
           elif mode==2:
 
               self.resolve_host(name,url)
 
           elif mode==3:
 
               self.getservers_2(name,url,image,extra,desc)
 
           elif mode==103:
 
               sterm self.getsearchtext()
 
               self.search_103("Search",sterm,page)
 
           ###movies
 
           elif mode==100:
 
               self.getmovies_100(name,url,page)
 
           elif mode==101:
 
               self.years_101()
 
           elif mode==102:
 
               self.getA_Z_102('movies')
 
           ###series
 
           elif mode==200:
 
               self.getseries_200(name,url,page)
 
           elif mode==201:
 
               self.getepisode_201(name,url,image,page,extra)
 
           elif mode==202:
 
               self.getepisodes_202(name,url,image,page,extra)
 
           return self.endDir()
def start(params={}):
 
   addon=myaddon()
 
   return addon.run(params
to continue...
Many built in functions are available to write complete addon for TSmedia.
addDir:
One of the most important function and needed to store data collected from the execution of the addon to be sent to the TSmedia to processes the data and display and on TV screen.
addDir accepts many arguments.
basic arguments are title,url,mode,image,category,page,maintitle
all are self explanatory but some words about mode  and maintitle.
mode :
used to direct the next execution of the addon and takes any integer value,some values are reserved to do certain actions
0 means play the link
-1 display error message
-10 no action,used for markers
-7 used for torrent links
103 for search
maintitle :

accepts two boolean values default False and the other True
suppose we have this branch as example   movies>divergent 2014>server1>link1
in this case the title of the link player by the player will be link1,also the title used by imdb engine and subssupport is link1,to make movie divergent instead we should use maintitle True with the addDir passing the movie title,at least one calling addDir function should include maintitle equal True else TSmedia processing will be disrupted,commonly we use maintitle=True with listing of movies and series

other some non-basic arguments: all these should be used as key-value arguments extra=extra 
extra is dictionary to hold not basic data like movie imdb_id,trailer,language.....
show accepts two values movie,tv
dialog:
dialog argument is important and some common useage
dialog="search" to display search virtual keybaord
dialog="setup" and dialog="login" to display the addon settings screen
dialog="torrentLink" to display the torrent info in special screen
dialog="servers" if we want to display data as in following screen
[Image: screenshot-1877.png]


other addDir arguements are raely used and mentioned in the file iTools in the TSmedia/scripts/script.module.main/lib

getPage(baseUrl, addParams = {}, post_data = None,cloudflare=False):
getPage used to get the data from internet website.This function is well-built to handle ssl verification and timeout.
getPage acts in get and post mode.
getPage accepts 4 arguments arguments
url:link to the website
addParams: to pass header parameters dictionary,getPage by defualt use the self.HEADER defined in the __ini__ function of the addon.
post_data :to pass other params dictionary and if this argument filled the getPage function will use post mode automatically
cloudflare=default False and if site protected by cloudflare we use cloudflare=True

getSM(data,regx):
wrapper for re.findall to find single match for given regular expression,the value of this function will give empty match in failure and not error of index out of range

getMM(data,regx):
[b]same as getSM but to get list of multiple matches[/b]

[b]getDM(data,marker1,marker2)

to get data between two markers ,we use it when we cannot use regular expression
example: getDM(data,"data_source",">")
we can use with cleanhtml to clear html tags and to get text only


getDomain(url)
to get the domain name of the link,also return the image assigned to the domain and if supprted by TSmedia or not
server,image,supported=getDomain(url)

cleanhtml(data):
to clean data from html tags and return text.

resolvehost(name,url):
 analyze the server link to direct link to read by the players.

getsearchtext()
to get the search term entered by the user

many other helpful functions are available in
the file iTools in the TSmedia/scripts/script.module.main/lib

colorize(text,'green'):
 to colorize the text between brackets with selected color
as example
divergent(2019) appear like this when use this function
divergent(2019)


to continue
management of addon settings
 
Reply
  


Messages In This Thread
TSmedia addons development - by mfaraj - 06-12-2020, 10:46 AM
RE: TSmedia addons development - by mfaraj - 06-12-2020, 08:08 PM
RE: TSmedia addons development - by frank087234 - 06-12-2020, 08:19 PM
RE: TSmedia addons development - by mfaraj - 06-12-2020, 09:02 PM
RE: TSmedia addons development - by mfaraj - 06-17-2020, 09:44 AM
RE: TSmedia addons development - by mfaraj - 06-18-2020, 01:00 PM
RE: TSmedia addons development - by mfaraj - 06-19-2020, 08:00 AM
RE: TSmedia addons development - by mfaraj - 06-19-2020, 08:24 AM
RE: TSmedia addons development - by emadsaead - 09-26-2021, 09:39 AM
RE: TSmedia addons development - by taplu - 05-22-2021, 11:36 PM

Possibly Related Threads...
Thread Author Replies Views Last Post
  TSMedia Install/Updates Here YASSINOV 1 8,724 01-23-2023, 12:47 PM
Last Post: scas
  Torrent downloads with TSmedia mfaraj 3 12,790 10-26-2021, 03:52 PM
Last Post: mohdar
  Arabic addons mfaraj 2 6,149 09-26-2021, 09:46 AM
Last Post: emadsaead
  Turkish addons mfaraj 8 6,649 05-23-2021, 06:55 PM
Last Post: taplu
  Spanish addons mfaraj 2 1,847 03-31-2021, 08:46 PM
Last Post: Dsaliba
  Torrent addons mfaraj 41 15,319 03-29-2021, 03:44 PM
Last Post: soidog2
Shield IPTV Addons YASSINOV 6 4,208 11-01-2020, 08:43 PM
Last Post: marty1
  French addons mfaraj 7 3,160 10-29-2020, 08:14 AM
Last Post: Valder2009
  TSmedia:How to. mfaraj 4 10,976 07-30-2020, 02:53 PM
Last Post: angel_heart
  Asian addons mfaraj 2 2,593 06-25-2020, 09:09 PM
Last Post: mfaraj

Forum Jump:


Browsing: 3 Guest(s)