def METHOD_NAME(self, pyfile):
    api_data = self.api_request(
        "link/unlock",
        get={
            "link": pyfile.url,
            "password": self.get_password(),
            "apikey": self.account.info["login"]["password"],
        },
    )
    if api_data.get("error", False):
        if api_data["error"]["code"] == "LINK_DOWN":
            self.offline()
        else:
            self.log_error(api_data["error"]["message"])
            self.temp_offline()
    else:
        if api_data["link"] == "" and "streams" in api_data:
            unlock_id = api_data["id"]
            streams = dict(
                [
                    (
                        _s["quality"],
                        {
                            "ext": _s["ext"],
                            "filesize": _s["filesize"],
                            "id": _s["id"],
                        },
                    )
                    for _s in api_data["streams"]
                    if type(_s["quality"]) == int
                ]
            )
            qualities = sorted(streams.keys())
            self.log_debug("AVAILABLE STREAMS: {}".format(qualities))
            desired_quality = self.config.get("stream_quality")
            if desired_quality == "Lowest":
                chosen_quality = qualities[0]
            elif desired_quality == "Highest":
                chosen_quality = qualities[-1]
            else:
                desired_quality = int(re.search(r"\d+", desired_quality).group(0))
                chosen_quality = min(qualities, key=lambda x: abs(x - desired_quality))
            self.log_debug("CHOSEN STREAM: {}".format(chosen_quality))
            stream_id = streams[chosen_quality]["id"]
            stream_name = (
                api_data["filename"] + "." + streams[chosen_quality]["ext"]
            )
            stream_size = streams[chosen_quality]["filesize"]
            api_data = self.api_request(
                "link/streaming",
                get={
                    "apikey": self.account.info["login"]["password"],
                    "id": unlock_id,
                    "stream": stream_id,
                },
            )
            if api_data.get("error", False):
                self.log_error(api_data["error"]["message"])
                self.temp_offline()
            delayed_id = api_data.get("delayed")
            if delayed_id:
                pyfile.set_custom_status("delayed stream")
                while True:
                    api_data = self.api_request(
                        "link/delayed",
                        get={
                            "apikey": self.account.info["login"]["password"],
                            "id": delayed_id,
                        },
                    )
                    if "link" in api_data:
                        pyfile.name = stream_name
                        pyfile.size = stream_size
                        self.chunk_limit = api_data.get("max_chunks", 16)
                        self.link = api_data["link"]
                        return
                    self.sleep(5)
        pyfile.name = api_data["filename"]
        pyfile.size = api_data["filesize"]
        self.chunk_limit = api_data.get("max_chunks", 16)
        self.link = api_data["link"]