Ejemplo n.º 1
0
 def getVideo(self):
     newsoup = self.getNextStep()
     script = newsoup.find("div", id="play").find("script").getText()
     script = stringutils.get_after(script, "playlist: '")
     script = stringutils.get_before(script, "',")
     xmlsoup = self.getPageSoup(self.getBaseUrl() + script)
     return xmlsoup.find("media:content").get("url")
Ejemplo n.º 2
0
 def getVideo(self):
     newsoup = self.getNextStep()
     script = newsoup.find("div", id = "play").find("script").getText()
     script = stringutils.get_after(script, "playlist: '")
     script = stringutils.get_before(script, "',")
     xmlsoup = self.getPageSoup(self.getBaseUrl() + script)
     return xmlsoup.find("media:content").get("url")
Ejemplo n.º 3
0
 def getVideo(self):
     newsoup = self.getStep2()
     scripts = newsoup.findAll("script")
     for script in scripts:
         text = script.getText()
         if text[0:4] == "eval" and "SWFObject" in text:
             script = stringutils.decode_packed_javascript(text)
             after = get_after(script, "addVariable('file','")
             middle = get_before(after, "');")
             return middle
Ejemplo n.º 4
0
 def getVideo(self):
     newsoup = self.getStep2()
     scripts = newsoup.findAll("script")
     for script in scripts:
         text = script.getText()
         if text[0:4] == "eval" and "SWFObject" in text:
             script = stringutils.decode_packed_javascript(text)
             after = get_after(script, "addVariable('file','")
             middle = get_before(after,"');")
             return middle
Ejemplo n.º 5
0
 def getVideo(self):
     newsoup = self.getStep2()
     scripts = newsoup.find("div", {"id":"player_code"}).findAll("script")
     #could either be the 2nd or 3rd script... have to check each one.
     for script in scripts:
         if 'file: "' in script.getText():
             targetScriptText = script.getText()
             targetScriptPart = stringutils.get_after(targetScriptText, 'file: "')
             targetScriptPart = stringutils.get_before(targetScriptPart, '",')
             return targetScriptPart
Ejemplo n.º 6
0
    def getHostSiteTypes(self, season, episode):
        assert isinstance(season, int)
        assert isinstance(episode, int)

        sites = self.getEpisodeSoup(season, episode).findAll("span", {"class":"version_host"})
        types = []
        for site in sites:
            site = str(site.getText())
            site = stringutils.get_after(site, "('")
            site = stringutils.get_before(site, "')")
            types.append(site)
        return types
Ejemplo n.º 7
0
    def getMetadata(self):
        soup = self.getNextStep()
        scripts = soup.find("div", id = "divxshowboxt").findAll("script")
        ret = dict()
        for script in scripts:
            text = script.getText()
            if len(text) > 0 and text.count("var file_name = escape('") > 0:
                namepart = stringutils.get_after(text, "var file_name = escape('")
                ret["name"] = stringutils.get_before(namepart, "');\n")
                ret["extension"] = ret["name"][-3:]

        return ret
Ejemplo n.º 8
0
 def getMetadata(self):
     ret = dict()
     soup = self.getStep2()
     scripts = soup.find("div", {"id": "player_code"}).findAll("script")
     #could either be the 2nd or 3rd script... have to check each one.
     for script in scripts:
         scriptText = script.getText()
         #makes sure it's the right script (there are multiple)
         if 'file: "' in script.getText():
             namepart = stringutils.get_after(scriptText, 'file: "')
             ret["name"] = stringutils.get_before(namepart, '"')
             ret["extension"] = ret["name"][-3:]
             durpart = stringutils.get_after(scriptText, 'duration:"')
             ret["duration"] = stringutils.get_before(durpart, '"')
             heightpart = stringutils.get_after(scriptText, 'height: "')
             ret["height"] = stringutils.get_before(heightpart, '"')
             widthpart = stringutils.get_after(scriptText, 'width: "')
             ret["width"] = stringutils.get_before(widthpart, '"')
             imagepart = stringutils.get_after(scriptText, 'image: "')
             ret["image"] = stringutils.get_before(imagepart, '"')
     return ret
Ejemplo n.º 9
0
    def getMetadata(self):
        soup = self.getNextStep()
        scripts = soup.find("div", id="divxshowboxt").findAll("script")
        ret = dict()
        for script in scripts:
            text = script.getText()
            if len(text) > 0 and text.count("var file_name = escape('") > 0:
                namepart = stringutils.get_after(text,
                                                 "var file_name = escape('")
                ret["name"] = stringutils.get_before(namepart, "');\n")
                ret["extension"] = ret["name"][-3:]

        return ret