当前位置: 首页>>代码示例>>Python>>正文


Python YDStreamExtractor.overrideParam方法代码示例

本文整理汇总了Python中YDStreamExtractor.overrideParam方法的典型用法代码示例。如果您正苦于以下问题:Python YDStreamExtractor.overrideParam方法的具体用法?Python YDStreamExtractor.overrideParam怎么用?Python YDStreamExtractor.overrideParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在YDStreamExtractor的用法示例。


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

示例1: resolveURLFile

# 需要导入模块: import YDStreamExtractor [as 别名]
# 或者: from YDStreamExtractor import overrideParam [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 overrideParam [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 overrideParam [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.overrideParam方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。