• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python kodi.i18n函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中salts_lib.kodi.i18n函数的典型用法代码示例。如果您正苦于以下问题:Python i18n函数的具体用法?Python i18n怎么用?Python i18n使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了i18n函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: get_settings

 def get_settings(cls):
     settings = super(cls, cls).get_settings()
     settings = scraper_utils.disable_sub_check(settings)
     name = cls.get_name()
     settings.append(
         '         <setting id="%s-filter" type="slider" range="0,180" option="int" label="     %s" default="30" visible="eq(-4,true)"/>'
         % (name, i18n("filter_results_days"))
     )
     settings.append(
         '         <setting id="%s-select" type="enum" label="     %s" lvalues="30636|30637" default="0" visible="eq(-5,true)"/>'
         % (name, i18n("auto_select"))
     )
     return settings
开发者ID:henry73,项目名称:salts,代码行数:13,代码来源:myvideolinks_scraper.py


示例2: get_settings

 def get_settings(cls):
     settings = super(cls, cls).get_settings()
     name = cls.get_name()
     settings.append(
         '         <setting id="%s-username" type="text" label="     %s" default="" visible="eq(-4,true)"/>'
         % (name, i18n("username"))
     )
     settings.append(
         '         <setting id="%s-password" type="text" label="     %s" option="hidden" default="" visible="eq(-5,true)"/>'
         % (name, i18n("password"))
     )
     settings.append(
         '         <setting id="%s-include_premium" type="bool" label="     %s" default="false" visible="eq(-6,true)"/>'
         % (name, i18n("include_premium"))
     )
     return settings
开发者ID:henry73,项目名称:salts,代码行数:16,代码来源:noobroom_scraper.py


示例3: resolve_link

    def resolve_link(self, link):
        try:
            headers = dict([item.split('=') for item in (link.split('|')[1]).split('&')])
            for key in headers: headers[key] = urllib.unquote(headers[key])
            link = link.split('|')[0]
        except:
            headers = {}

        if not link.startswith('http'):
            link = urlparse.urljoin(self.base_url, link)
        html = self._http_get(link, headers=headers, cache_limit=0)
                    
        fragment = dom_parser.parse_dom(html, 'div', {'class': 'player'})
        if fragment:
            iframe_url = dom_parser.parse_dom(fragment[0], 'iframe', ret='src')
            if iframe_url:
                iframe_url = iframe_url[0]
                headers = {'Referer': link}
                html = self._http_get(iframe_url, headers=headers, cache_limit=0)
                sitekey = dom_parser.parse_dom(html, 'div', {'class': 'g-recaptcha'}, ret='data-sitekey')
                if sitekey:
                    token = recaptcha_v2.UnCaptchaReCaptcha().processCaptcha(sitekey[0], lang='en')
                    if token:
                        data = {'g-recaptcha-response': token}
                        html = self._http_get(iframe_url, data=data, cache_limit=0)
                        log_utils.log(html)
                        
                match = re.search("\.replace\(\s*'([^']+)'\s*,\s*'([^']*)'\s*\)", html, re.I)
                if match:
                    html = html.replace(match.group(1), match.group(2))

                match = re.search("window\.atob[\([]+'([^']+)", html)
                if match:
                    func_count = len(re.findall('window\.atob', html))
                    html = match.group(1)
                    for _i in xrange(func_count):
                        html = base64.decodestring(html)
                
                streams = []
                for match in re.finditer('''<source[^>]+src=["']([^'"]+)[^>]+label=['"]([^'"]+)''', html):
                    streams.append(match.groups())
                
                if len(streams) > 1:
                    if not self.auto_pick:
                        result = xbmcgui.Dialog().select(i18n('choose_stream'), [e[1] for e in streams])
                        if result > -1:
                            return streams[result][0] + '|User-Agent=%s' % (scraper_utils.get_ua())
                    else:
                        best_stream = ''
                        best_q = 0
                        for stream in streams:
                            stream_url, label = stream
                            if Q_ORDER[scraper_utils.height_get_quality(label)] > best_q:
                                best_q = Q_ORDER[scraper_utils.height_get_quality(label)]
                                best_stream = stream_url
                        
                        if best_stream:
                            return best_stream + '|User-Agent=%s' % (scraper_utils.get_ua())
                elif streams:
                    return streams[0][0] + '|User-Agent=%s' % (scraper_utils.get_ua())
开发者ID:dsjh,项目名称:tknorris-beta-repo,代码行数:60,代码来源:watchhd_scraper.py


示例4: resolve_link

 def resolve_link(self, link):
     query = urlparse.parse_qs(link)
     if 'hash_id' in query:
         hash_id = query['hash_id'][0].lower()
         if self.__add_torrent(hash_id):
             browse_url = BROWSE_URL % (hash_id)
             browse_url = urlparse.urljoin(self.base_url, browse_url)
             js_data = self._json_get(browse_url, cache_limit=0)
             videos = self.__get_videos(js_data['content'])
             
             if len(videos) > 1:
                 result = xbmcgui.Dialog().select(i18n('choose_stream'), [video['label'] for video in videos])
                 if result > -1:
                     return videos[result]['url']
             elif videos:
                 return videos[0]['url']
开发者ID:Stevie-Bs,项目名称:repository.xvbmc,代码行数:16,代码来源:premiumize_scraper.py


示例5: resolve_link

    def resolve_link(self, link):
        try:
            headers = dict([item.split('=') for item in (link.split('|')[1]).split('&')])
            for key in headers: headers[key] = urllib.unquote(headers[key])
            link = link.split('|')[0]
        except:
            headers = {}

        html = self._http_get(link, headers=headers, cache_limit=0)
        fragment = dom_parser.parse_dom(html, 'div', {'class': 'player'})
        if fragment:
            iframe_url = dom_parser.parse_dom(fragment[0], 'iframe', ret='src')
            if iframe_url:
                headers = {'Referer': link}
                html = self._http_get(iframe_url[0], headers=headers, cache_limit=0)
                match = re.search("window\.atob\('([^']+)", html)
                if match:
                    func_count = len(re.findall('window\.atob', html))
                    html = match.group(1)
                    for _i in xrange(func_count):
                        html = base64.decodestring(html)
                
                streams = []
                for match in re.finditer('''<source[^>]+src=["']([^'"]+)[^>]+label=['"]([^'"]+)''', html):
                    streams.append(match.groups())
                
                if len(streams) > 1:
                    if not self.auto_pick:
                        result = xbmcgui.Dialog().select(i18n('choose_stream'), [e[1] for e in streams])
                        if result > -1:
                            return streams[result][0] + '|User-Agent=%s' % (scraper_utils.get_ua())
                    else:
                        best_stream = ''
                        best_q = 0
                        for stream in streams:
                            stream_url, label = stream
                            if Q_ORDER[scraper_utils.height_get_quality(label)] > best_q:
                                best_q = Q_ORDER[scraper_utils.height_get_quality(label)]
                                best_stream = stream_url
                        
                        if best_stream:
                            return best_stream + '|User-Agent=%s' % (scraper_utils.get_ua())
                elif streams:
                    return streams[0][0] + '|User-Agent=%s' % (scraper_utils.get_ua())
开发者ID:c0ns0le,项目名称:YCBuilds,代码行数:44,代码来源:watchhd_scraper.py


示例6: resolve_link

    def resolve_link(self, link):
        playlist = super(self.__class__, self)._http_get(link, cache_limit=.5)
        try:
            ns = '{http://xspf.org/ns/0/}'
            root = ET.fromstring(playlist)
            tracks = root.findall('.//%strack' % (ns))
            locations = []
            for track in tracks:
                duration = track.find('%sduration' % (ns)).text
                try: duration = int(duration)
                except: duration = 0
                if duration >= MIN_DURATION:
                    location = track.find('%slocation' % (ns)).text
                    locations.append({'duration': duration / 1000, 'url': location})

            if len(locations) > 1:
                result = xbmcgui.Dialog().select(i18n('choose_stream'), [self.__format_time(location['duration']) for location in locations])
                if result > -1:
                    return locations[result]['url']
            elif locations:
                return locations[0]['url']
        except Exception as e:
            log_utils.log('Failure during furk playlist parse: %s' % (e), log_utils.LOGWARNING)
开发者ID:AMOboxTV,项目名称:AMOBox.LegoBuild,代码行数:23,代码来源:furk_scraper.py


示例7: get_settings

 def get_settings(cls):
     settings = super(cls, cls).get_settings()
     name = cls.get_name()
     settings.append('         <setting id="%s-username" type="text" label="     %s" default="" visible="eq(-4,true)"/>' % (name, i18n('username')))
     settings.append('         <setting id="%s-password" type="text" label="     %s" option="hidden" default="" visible="eq(-5,true)"/>' % (name, i18n('password')))
     return settings
开发者ID:Stevie-Bs,项目名称:repository.xvbmc,代码行数:6,代码来源:flixanity_scraper.py


示例8: get_settings

 def get_settings(cls):
     settings = super(cls, cls).get_settings()
     settings = scraper_utils.disable_sub_check(settings)
     name = cls.get_name()
     settings.append('         <setting id="%s-filter" type="slider" range="0,180" option="int" label="     %s" default="60" visible="eq(-4,true)"/>' % (name, i18n('filter_results_days')))
     return settings
开发者ID:monicarero,项目名称:repository.xvbmc,代码行数:6,代码来源:ddlvalley_scraper.py


示例9: get_settings

 def get_settings(cls):
     settings = super(cls, cls).get_settings()
     name = cls.get_name()
     settings.append('         <setting id="%s-auto_pick" type="bool" label="    %s" default="false" visible="eq(-4,true)"/>' % (name, i18n('auto_pick')))
     return settings
开发者ID:c0ns0le,项目名称:YCBuilds,代码行数:5,代码来源:watchhd_scraper.py


示例10: get_settings

 def get_settings(cls):
     settings = super(cls, cls).get_settings()
     settings = scraper_utils.disable_sub_check(settings)
     name = cls.get_name()
     settings.append('         <setting id="%s-use_https" type="bool" label="     %s" default="false" visible="eq(-4,true)"/>' % (name, i18n('use_https')))
     settings.append('         <setting id="%s-username" type="text" label="     %s" default="" visible="eq(-5,true)"/>' % (name, i18n('username')))
     settings.append('         <setting id="%s-password" type="text" label="     %s" option="hidden" default="" visible="eq(-6,true)"/>' % (name, i18n('password')))
     settings.append('         <setting id="%s-base_url2" type="text" label="     %s %s" default="%s" visible="eq(-7,true)"/>' % (name, i18n('movies'), i18n('base_url'), cls.movie_base_url))
     settings.append('         <setting id="%s-base_url3" type="text" label="     %s %s" default="%s" visible="eq(-8,true)"/>' % (name, i18n('tv_shows'), i18n('base_url'), cls.tv_base_url))
     return settings
开发者ID:ScriptUp,项目名称:salts,代码行数:10,代码来源:premiumize_scraper.py


示例11: get_settings

 def get_settings(cls):
     name = cls.get_name()
     settings = [
         '         <setting id="%s-enable" type="bool" label="%s %s" default="true" visible="true"/>' % (name, name, i18n('enabled')),
         '         <setting id="%s-sub_check" type="bool" label="    %s" default="false" visible="eq(-1,true)"/>' % (name, i18n('page_existence')),
         '         <setting id="%s_last_results" type="number" default="0" visible="false"/>' % (name)
     ]
     return settings
开发者ID:c0ns0le,项目名称:YCBuilds,代码行数:8,代码来源:premiumizev2_scraper.py


示例12: get_settings

 def get_settings(cls):
     settings = super(cls, cls).get_settings()
     settings = scraper_utils.disable_sub_check(settings)
     name = cls.get_name()
     settings.append('         <setting id="%s-username" type="text" label="     %s" default="" visible="eq(-4,true)"/>' % (name, i18n('username')))
     settings.append('         <setting id="%s-password" type="text" label="     %s" option="hidden" default="" visible="eq(-5,true)"/>' % (name, i18n('password')))
     settings.append('         <setting id="%s-result_limit" label="     %s" type="slider" default="10" range="10,100" option="int" visible="eq(-6,true)"/>' % (name, i18n('result_limit')))
     return settings
开发者ID:henry73,项目名称:salts,代码行数:8,代码来源:furk_scraper.py


示例13: get_settings

 def get_settings(cls):
     settings = super(cls, cls).get_settings()
     name = cls.get_name()
     settings.append('         <setting id="%s-base_url2" type="text" label="    %s %s" default="%s" visible="eq(-4,true)"/>' % (name, i18n('tv_shows'), i18n('base_url'), cls.tv_base_url))
     return settings
开发者ID:kevintone,项目名称:tdbaddon,代码行数:5,代码来源:moviesub_scraper.py


示例14: get_settings

 def get_settings(cls):
     """
     Returns a list of settings to be used for this scraper. Settings are automatically checked for updates every time scrapers are imported
     The list returned by each scraper is aggregated into a big settings.xml string, and then if it differs from the current settings xml in the Scrapers category
     the existing settings.xml fragment is removed and replaced by the new string
     """
     name = cls.get_name()
     return [
         '         <setting id="%s-enable" type="bool" label="%s %s" default="true" visible="true"/>' % (name, name, i18n('enabled')),
         '         <setting id="%s-base_url" type="text" label="    %s" default="%s" visible="eq(-1,true)"/>' % (name, i18n('base_url'), cls.base_url),
         '         <setting id="%s-sub_check" type="bool" label="    %s" default="true" visible="eq(-2,true)"/>' % (name, i18n('page_existence')),
         '         <setting id="%s_last_results" type="number" default="0" visible="false"/>' % (name),
     ]
开发者ID:monicarero,项目名称:repository.xvbmc,代码行数:13,代码来源:scraper.py



注:本文中的salts_lib.kodi.i18n函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python log_utils.log函数代码示例发布时间:2022-05-27
下一篇:
Python kodi.get_setting函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap