當前位置: 首頁>>代碼示例>>Python>>正文


Python YDStreamExtractor.generateBlacklist方法代碼示例

本文整理匯總了Python中YDStreamExtractor.generateBlacklist方法的典型用法代碼示例。如果您正苦於以下問題:Python YDStreamExtractor.generateBlacklist方法的具體用法?Python YDStreamExtractor.generateBlacklist怎麽用?Python YDStreamExtractor.generateBlacklist使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在YDStreamExtractor的用法示例。


在下文中一共展示了YDStreamExtractor.generateBlacklist方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: resolveURLFile

# 需要導入模塊: import YDStreamExtractor [as 別名]
# 或者: from YDStreamExtractor import generateBlacklist [as 別名]
def resolveURLFile(path):
    import YDStreamExtractor as StreamExtractor

    StreamExtractor.overrideParam('noplaylist', True)
    StreamExtractor.generateBlacklist(('.*:(?:user|channel|search)$', '(?i)generic.*'))

    import xbmcvfs
    f = xbmcvfs.File(path, 'r')
    try:
        url = f.read().strip()
    except:
        kodiutil.ERROR()
        return
    finally:
        f.close()

    vid = StreamExtractor.getVideoInfo(url)

    if not vid:
        return None

    return vid.streamURL()
開發者ID:midgetspy,項目名稱:script.cinemavision,代碼行數:24,代碼來源:experience.py

示例2: getURLMediaType

# 需要導入模塊: import YDStreamExtractor [as 別名]
# 或者: from YDStreamExtractor import generateBlacklist [as 別名]
# -*- coding: utf-8 -*-
import xbmc, xbmcgui
import urllib
import YDStreamExtractor as StreamExtractor
import YDStreamUtils as StreamUtils
import common

StreamExtractor.overrideParam("noplaylist", True)
StreamExtractor.generateBlacklist((".*:(?:user|channel|search)$", "(?i)generic.*"))


def getURLMediaType(url):
    if url.startswith("http"):
        videoTypes = xbmc.getSupportedMedia("video")
        musicTypes = xbmc.getSupportedMedia("music")
        imageTypes = xbmc.getSupportedMedia("picture")
        ext = url.rsplit(".", 1)[-1]
        if ext in videoTypes:
            return "video"
        elif ext in musicTypes:
            return "audio"
        elif ext in imageTypes:
            return "image"
    return protocolMediaType(url)


def canHandle(data):
    if data.get("type") == "link":
        url = data.get("url", "")
        if StreamExtractor.mightHaveVideo(url):
            return "video"
開發者ID:rjof,項目名稱:xbmc.service.pushbullet,代碼行數:33,代碼來源:pushhandler.py

示例3: getURLMediaType

# 需要導入模塊: import YDStreamExtractor [as 別名]
# 或者: from YDStreamExtractor import generateBlacklist [as 別名]
# -*- coding: utf-8 -*-
import xbmc, xbmcgui
import urllib
import YDStreamExtractor as StreamExtractor
import YDStreamUtils as StreamUtils
import common

StreamExtractor.overrideParam('noplaylist',True)
StreamExtractor.generateBlacklist(('.*:(?:user|channel|search)$','(?i)generic.*'))

def getURLMediaType(url):
    if url.startswith('http'):
        videoTypes = xbmc.getSupportedMedia('video')
        musicTypes = xbmc.getSupportedMedia('music')
        imageTypes = xbmc.getSupportedMedia('picture')
        ext = url.rsplit('.',1)[-1]
        if ext in videoTypes:
            return 'video'
        elif ext in musicTypes:
            return 'audio'
        elif ext in imageTypes:
            return 'image'
    return protocolMediaType(url)

def canHandle(data):
    if data.get('type') == 'link':
        url = data.get('url','')
        if StreamExtractor.mightHaveVideo(url): return 'video'
        mediaType = getURLMediaType(url)
        if mediaType: return mediaType
        return canPlayURL(url) and 'video' or None
開發者ID:rattrapper,項目名稱:xbmc.service.pushbullet,代碼行數:33,代碼來源:pushhandler.py


注:本文中的YDStreamExtractor.generateBlacklist方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。