Exemplo n.º 1
0
    def get_response(self):
        id = self.get_argument("id", None)
        vsb = self.get_argument("vsb", None)
        Database.add_hot(id)
        if id and vsb:
            video = Database.get_video(id)
            data = dict()

            data[
                "site_title"] = "正在播放_" + video.name + "_" + vsb + "_" + self.site_name
            data['video'] = video

            subvideo = []
            curvideo = []
            for sub in video.links.split("\r\n"):
                temp = dict()
                temp["episode"] = sub.split("@")[0]
                temp["link"] = sub.split("@")[1]
                if temp["episode"] == vsb:
                    curvideo.append(temp)
                subvideo.append(temp)

            data['video'] = video
            data["online"] = random.randint(1, 50)
            data['sub_video'] = subvideo
            data['cur_video'] = curvideo[0]
            self.html("normal/play.html", data=data)
Exemplo n.º 2
0
 def get_response(self):
     data = dict()
     if self.name.decode(encoding='utf-8') == "admin":
         id = self.get_argument("id", None)
         if id:
             data = dict()
             data["site_title"] = "编辑视频_" + self.site_name
             data["video"] = Database.get_video(id)
             self.html("admin/edit.html", data=data)
         else:
             self.write("编辑失败! <a href=\"/manage/\">点击返回</a>")
     else:
         data["site_name"] = self.site_name
         self.html("404.html", data=data)
Exemplo n.º 3
0
    def get_response(self):
        id = self.get_argument("id", None)
        if id:
            video = Database.get_video(id)
            data = dict()
            data["site_title"] = video.name + "_" + self.site_name
            data['video'] = video
            data['hot'] = random.randint(45, 99)
            data['tags'] = video.tags.replace(' ', '').split("/")
            subvideo = []

            for sub in video.links.split("\r\n"):
                try:
                    temp = dict()
                    temp["episode"] = sub.split("@")[0]
                    temp["link"] = sub.split("@")[1]
                    subvideo.append(temp)
                except:
                    break

            data['sub_video'] = subvideo
            self.html("normal/detail.html", data=data)