def concat(cid, offset):
     u = 'http://api.amemv.com/aweme/v1/challenge/aweme/?ch_id={ch_id}&cursor={cursor}&count=20&type=5&retry_type=no_retry&iid={iid}&device_id={device_id}&ac=wifi&channel=update&aid=1128&app_name=aweme&version_code=162&version_name=1.6.2&device_platform=android&ssmix=a&device_type=MIX&device_brand=Xiaomi&os_api=24&os_version=7.0&uuid={uuid}&openudid={openudid}&manifest_version_code=162&resolution=1920*1080&dpi=440&update_version_code=1622&app_type=normal'
     u = u.format(ch_id=cid,
                  cursor=offset,
                  uuid=const_douyin.get_uuid(),
                  iid=const_douyin.get_iid(),
                  device_id=const_douyin.get_device_id(),
                  openudid=const_douyin.get_openudid())
     return u
 def onReceiveMsg(self, msg):
     """
     :param msg:
     """
     log.debug("DouyinMainFeedProvider receive {}".format(msg))
     if msg.msgType == const_douyin.DATA_TYPE_MAINFEED:
         target = self.url.format(iid=const_douyin.get_iid(),
                                  device_id=const_douyin.get_device_id(),
                                  openudid=const_douyin.get_openudid(),
                                  uuid=const_douyin.get_uuid())
         urlPack = urlprovider.UrlPack(priority=0, url=target)
         urlPack.fillMsg(msg, self.pipe)
         self.add(urlPack)
         return True
     return False
Example #3
0
 def onReceiveMsg(self, msg):
     """
     :param msg:
     """
     log.debug("DouyinVideoDetailProvider receive ".format(msg))
     if msg.msgType == const_douyin.DATA_TYPE_VIDEO:
         target = self.url.format(aweme_id=msg.msgData,
                                  iid=const_douyin.get_iid(),
                                  device_id=const_douyin.get_device_id(),
                                  openudid=const_douyin.get_openudid(),
                                  uuid=const_douyin.get_uuid())
         urlPack = urlprovider.UrlPack(priority=20, url=target)
         urlPack.fillMsg(msg, self.pipe)
         self.add(urlPack)
         return True
     return False
    def onReceiveMsg(self, msg):  # @UnusedVariable
        """

        :param msg:
        """
        if msg.msgType == const_douyin.DATA_TYPE_TOPIC:
            target = self.url.format(ch_id=msg.msgData,
                                     iid=const_douyin.get_iid(),
                                     device_id=const_douyin.get_device_id(),
                                     uuid=const_douyin.get_uuid(),
                                     openudid=const_douyin.get_openudid())
            urlPack = urlprovider.UrlPack(priority=20, url=target)
            urlPack.fillMsg(msg, self.pipe)
            self.add(urlPack)
            return True
        return False
 def onReceiveMsg(self, msg):  # @UnusedVariable
     """
     :param msg:
     """
     if msg.msgType == const_douyin.DATA_TYPE_TOPIC_KEYWORD:
         keyword = msg.msgData
         target = self.url.format(keyword=keyword,
                                  iid=const_douyin.get_iid(),
                                  device_id=const_douyin.get_device_id(),
                                  openudid=const_douyin.get_openudid(),
                                  uuid=const_douyin.get_uuid(),
                                  cursor=msg.getKey('cursor', 0))
         urlPack = urlprovider.UrlPack(1, url=target)
         urlPack.addKey('keyword', keyword)
         urlPack.addKey('cursor', msg.getKey('cursor', 0))
         urlPack.fillMsg(msg, self.pipe)
         self.add(urlPack)
         return True
     return False
    def onReceiveMsg(self, msg):
        """
        :param msg:
        """
        log.debug("DouyinAuthorVideoProvider receive {}".format(msg))
        if msg.msgType == const_douyin.DATA_TYPE_AUTHOR:
            cursor = 0
            if msg.getExtra("cursor") is None:
                cursor = 0
            else:
                cursor = msg.getExtra("cursor")

            target = self.url.format(user_id=msg.msgData,
                                     cursor=cursor,
                                     iid=const_douyin.get_iid(),
                                     device_id=const_douyin.get_device_id(),
                                     openudid=const_douyin.get_openudid(),
                                     uuid=const_douyin.get_uuid())
            urlPack = urlprovider.UrlPack(priority=20, url=target)
            urlPack.fillMsg(msg, self.pipe)
            self.add(urlPack)
            return True
        return False