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


Python Domain.Resource类代码示例

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


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

示例1: buildResource

def buildResource(url,title,channelId,videoId):
    resource = Resource()
    resource['resourceName'] = title
    resource['resourceUrl'] = url
    resource['channelId'] = channelId
    resource['type'] = 'video'
    resource['videoType'] = '56'
    resource['videoId'] =  videoId
    resource['createTime'] = getCurTime()

    return resource.getInsertDict()
开发者ID:xiaol,项目名称:ccv-impl,代码行数:11,代码来源:handle_56_top.py

示例2: buildResource

def buildResource(url,title,channelId,videoId):
    resource = Resource()
    resource['resourceName'] = title
    resource['resourceUrl'] = url
    resource['channelId'] = channelId
    #resource['categoryId'] = clct_channel.find_one({'channelId':resource['channelId']})['channelType']
    resource['type'] = 'video'
    resource['videoType'] = '56'
    resource['videoId'] = videoId
    resource['createTime'] = getCurTime()

    return resource.getInsertDict()
开发者ID:xiaol,项目名称:ccv-impl,代码行数:12,代码来源:handle_56_fashion.py

示例3: buildResource

def buildResource(url,title,hot,channelId):
    resource = Resource()
    resource['resourceName'] = title
    resource['resourceUrl'] = url
    resource['hot'] = hot
    resource['channelId'] = channelId
    #resource['categoryId'] = clct_channel.find_one({'channelId':resource['channelId']})['channelType']
    resource['type'] = 'video'
    resource['videoType'] = 'baomihua'
    resource['videoId'] =  p_vid.search(url).groups()[0]
    resource['createTime'] = getCurTime()
    return resource.getInsertDict()
开发者ID:xiaol,项目名称:ccv-impl,代码行数:12,代码来源:handle_baomihua_specialEdition.py

示例4: buildResource

def buildResource(url,title, number, channelId):
    resource = Resource()
    resource['resourceName'] = title
    resource['resourceUrl'] = url
    resource['number'] = number
    resource['channelId'] = channelId
    resource['type'] = 'video'
    resource['videoType'] = 'netease'
    resource['videoId'] = url
    resource['createTime'] = getCurTime()

    return resource.getInsertDict()
开发者ID:xiaol,项目名称:ccv-impl,代码行数:12,代码来源:handle_163_open.py

示例5: buildResource

def buildResource(url, title, channelId, videoId, number = None):
    resource = Resource()
    resource['resourceName'] = title
    resource['resourceUrl'] = url
    resource['channelId'] = channelId
    resource['type'] = 'video'
    resource['videoType'] = 'wasu'
    resource['videoId'] = videoId
    resource['createTime'] = getCurTime()
    if number!= None:resource['number'] = number

    return resource.getInsertDict()
开发者ID:xiaol,项目名称:ccv-impl,代码行数:12,代码来源:handle_wasu_list.py

示例6: buildGifResource

def buildGifResource(url,title,channelId,videoId, resourceImageUrl):
    resource = Resource()
    resource['resourceName'] = title
    resource['resourceUrl'] = url
    resource['channelId'] = channelId
    resource['type'] = 'gif'
    resource['videoType'] =  'gif'
    resource['videoId'] =  videoId#videoUrl
    resource['createTime'] = getCurTime()
    resource['modifyTime'] = getCurTime()
    resource['resourceImageUrl'] = resourceImageUrl

    return resource.getInsertDict()
开发者ID:xiaol,项目名称:ccv-impl,代码行数:13,代码来源:handle_weibo.py

示例7: handleDetailPage

def handleDetailPage(itemList,channelId):
    ans = []
    for item in itemList:
        resource = Resource()
        #...
        resource['resourceName'] = item['title']
        resource['resourceUrl'] = item['url']
        resource['channelId'] = channelId
        resource['categoryId'] = clct_channel.find_one({'channelId':resource['channelId']})['channelType']
        resource['videoId'] = p_vid.search(get_html(item['url'])).groups()[0]
        resource['videoType'] = 'iqiyi'
        resource['createTime'] = getCurTime()

        #...
        ans.append(resource.getInsertDict())
        pprint(resource.getInsertDict())
    return ans
开发者ID:xiaol,项目名称:ccv-impl,代码行数:17,代码来源:handle_revenge2.py

示例8: extractTasks

def extractTasks(url,channelId,season=None,format="MP4",type="ed2k"):
    tree = etree.HTML(get_html(url))
    if season:
        xpath = '//div[@class="box_1"]/ul[@season="%s"]/li[@format="%s"]/span[@class="r"]/a[@type="%s"]/@href'%(season,format,type)
    else:
        xpath = '//div[@class="box_1"]/ul/li[@format="%s"]/span[@class="r"]/a[@type="%s"]/@href'%(format,type)
    urls = tree.xpath(xpath)
    ans = []
    for url in urls:
        filename = p.search(url).groups()[0]
        filename = urllib.unquote(filename).decode('utf-8')
        name = filename[:filename.find('.')]
        number = 0
        if season:
            print filename
            try:
                m = pse.search(filename)
                name += ' 第%s季第%s集'%(m.groups()[0],m.groups()[1])
                number = m.groups()[1]
            except:
                print '[error] %s can\'t be recognized '
                continue
        #ans.append({'name':name,'url':url,'filename':filename})
        channel = clct_channel.find_one({'channelId':channelId})
        resourceImageUrl = channel['resourceImageUrl']
        resource = Resource()
        resource['resourceName'] = name
        resource['resourceImageUrl'] = resourceImageUrl
        resource['channelId'] = channelId
        resource['categoryId'] = clct_channel.find_one({'channelId':resource['channelId']})['channelType']
        resource['createTime'] = getCurTime()
        resource['resourceUrl'] = url
        resource['type'] = 'video'
        resource['videoType'] = 'bt'
        resource['videoId'] = filename
        resource['number'] = int(number)
        ans.append(resource.getInsertDict())
    return ans    
开发者ID:xiaol,项目名称:ccv-impl,代码行数:38,代码来源:handle_yyets.py


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