try:
    import requests
except Exception:
    # --- embedded requests-compatible shim (urllib based) for Yingxia adaptation ---
    # Inserted by py578 adaptation: used only when real `requests` is unavailable.
    import json as _json
    import ssl as _ssl
    import urllib.error as _uerr
    import urllib.parse as _uparse
    import urllib.request as _ureq
    import http.cookiejar as _cookiejar


    class _ReqExc(Exception):
        pass


    class _Timeout(_ReqExc):
        pass


    class _ConnectionError(_ReqExc):
        pass


    class _HTTPError(_ReqExc):
        pass


    class _CaseDict(dict):
        def get(self, k, d=None):
            for kk, vv in self.items():
                if kk.lower() == str(k).lower():
                    return vv
            return d

        def __getitem__(self, k):
            v = self.get(k)
            if v is None:
                raise KeyError(k)
            return v


    class _Response:
        def __init__(self, status_code=0, headers=None, content=b"", url="", cookies=None):
            self.status_code = status_code
            self.headers = _CaseDict(headers or {})
            self.content = content or b""
            self.url = url
            self.cookies = cookies or {}
            self.encoding = None
            self._text = None

        @property
        def text(self):
            if self._text is None:
                enc = self.encoding
                if not enc:
                    ct = self.headers.get("Content-Type", "")
                    m = _uparse.parse_qs(ct.replace(";", "&")) if False else None
                    enc = "utf-8"
                    if "charset=" in ct:
                        enc = ct.split("charset=")[-1].split(";")[0].strip() or "utf-8"
                try:
                    self._text = self.content.decode(enc, "ignore")
                except Exception:
                    self._text = self.content.decode("utf-8", "ignore")
            return self._text

        def json(self):
            return _json.loads(self.text)

        def raise_for_status(self):
            if self.status_code >= 400:
                raise _HTTPError("HTTP %s" % self.status_code)

        def iter_content(self, chunk_size=65536):
            for i in range(0, len(self.content), chunk_size):
                yield self.content[i:i + chunk_size]

        def close(self):
            pass


    class _Session:
        def __init__(self):
            self.headers = {"User-Agent": "Mozilla/5.0 (Linux; Android 13) AppleWebKit/537.36 Chrome/120 Mobile Safari/537.36"}
            self.cookies = {}
            self._jar = _cookiejar.CookieJar()
            self._ctx = _ssl._create_unverified_context()
            self._opener = _ureq.build_opener(
                _ureq.HTTPCookieProcessor(self._jar),
                _ureq.HTTPSHandler(context=self._ctx))

        def request(self, method, url, headers=None, timeout=15, data=None,
                    json=None, params=None, cookies=None, verify=False,
                    allow_redirects=True, stream=False, **kw):
            if params:
                qs = _uparse.urlencode(params, doseq=True)
                url = url + ("&" if "?" in url else "?") + qs
            hd = dict(self.headers)
            if headers:
                hd.update(headers)
            body = None
            if json is not None:
                body = _json.dumps(json, ensure_ascii=False).encode("utf-8")
                hd.setdefault("Content-Type", "application/json")
            elif isinstance(data, dict):
                body = _uparse.urlencode(data, doseq=True).encode("utf-8")
                hd.setdefault("Content-Type", "application/x-www-form-urlencoded")
            elif isinstance(data, str):
                body = data.encode("utf-8")
            elif isinstance(data, (bytes, bytearray)):
                body = bytes(data)
            if cookies:
                hd["Cookie"] = "; ".join("%s=%s" % kv for kv in cookies.items())
            elif self.cookies:
                hd.setdefault("Cookie", "; ".join("%s=%s" % kv for kv in self.cookies.items()))
            req = _ureq.Request(url, data=body, headers=hd, method=method.upper())
            try:
                to = timeout
                if isinstance(to, (tuple, list)):
                    to = max(to)
                if to and float(to) > 120:
                    to = float(to) / 1000.0
                with self._opener.open(req, timeout=to or 15) as resp:
                    content = resp.read()
                    hdrs = dict(resp.headers.items())
                    final = resp.geturl()
                    status = resp.status
            except _uerr.HTTPError as e:
                try:
                    content = e.read()
                except Exception:
                    content = b""
                hdrs = dict(e.headers.items()) if e.headers else {}
                final = e.geturl() if hasattr(e, "geturl") else url
                status = e.code
            except Exception as e:
                raise _ConnectionError(str(e))
            for c in self._jar:
                self.cookies[c.name] = c.value
            return _Response(status, hdrs, content, final, dict(self.cookies))

        def get(self, url, **kw):
            return self.request("GET", url, **kw)

        def post(self, url, data=None, **kw):
            return self.request("POST", url, data=data, **kw)

        def head(self, url, **kw):
            return self.request("HEAD", url, **kw)

        def close(self):
            pass


    class _Exceptions:
        RequestException = _ReqExc
        Timeout = _Timeout
        ConnectTimeout = _Timeout
        ReadTimeout = _Timeout
        ConnectionError = _ConnectionError
        HTTPError = _HTTPError
        SSLError = _ConnectionError


    class _RequestsShim:
        Session = _Session
        exceptions = _Exceptions
        Response = _Response

        @staticmethod
        def request(method, url, **kw):
            return _Session().request(method, url, **kw)

        @staticmethod
        def get(url, **kw):
            return _Session().request("GET", url, **kw)

        @staticmethod
        def post(url, data=None, **kw):
            return _Session().request("POST", url, data=data, **kw)

        @staticmethod
        def head(url, **kw):
            return _Session().request("HEAD", url, **kw)


    requests = _RequestsShim
    # --- end embedded requests shim ---
    requests.RequestException = requests.exceptions.RequestException
    requests.Timeout = requests.exceptions.Timeout
    requests.ConnectionError = requests.exceptions.ConnectionError
    requests.HTTPError = requests.exceptions.HTTPError
    requests.SSLError = requests.exceptions.SSLError
    def _req_mount(self, prefix, adapter):
        pass
    requests.Session.mount = _req_mount
    requests.Session.proxies = {}
    requests.Session.trust_env = True
    class _CookieDict(dict):
        def set(self, name, value, **kw):
            self[name] = value
        def get_dict(self):
            return dict(self)
        def clear(self):
            dict.clear(self)
    _orig_sess_init = requests.Session.__init__
    def _sess_init(self, *a, **kw):
        _orig_sess_init(self, *a, **kw)
        self.cookies = _CookieDict(self.cookies)
        self.proxies = {}
    requests.Session.__init__ = _sess_init
    _orig_sess_request = requests.Session.request
    def _sess_request(self, method, url, headers=None, timeout=15, data=None, json=None, params=None, cookies=None, verify=False, allow_redirects=True, stream=False, **kw):
            # 映匣适配：容忍 IncompleteRead（分片传输截断时用已读部分），并自动解 gzip/deflate
            import urllib.parse as _up2
            import urllib.request as _ur2
            import urllib.error as _ue2
            import http.client as _hc2
            import json as _json2
            if params:
                _qs = _up2.urlencode(params, doseq=True)
                url = url + ("&" if "?" in url else "?") + _qs
            _hd = dict(self.headers)
            if headers:
                _hd.update(headers)
            _body = None
            if json is not None:
                _body = _json2.dumps(json, ensure_ascii=False).encode("utf-8")
                _hd.setdefault("Content-Type", "application/json")
            elif isinstance(data, dict):
                _body = _up2.urlencode(data, doseq=True).encode("utf-8")
                _hd.setdefault("Content-Type", "application/x-www-form-urlencoded")
            elif isinstance(data, str):
                _body = data.encode("utf-8")
            elif isinstance(data, (bytes, bytearray)):
                _body = bytes(data)
            if cookies:
                _hd["Cookie"] = "; ".join("%s=%s" % _kv for _kv in cookies.items())
            elif self.cookies:
                _hd.setdefault("Cookie", "; ".join("%s=%s" % _kv for _kv in self.cookies.items()))
            _to = timeout
            if isinstance(_to, (tuple, list)):
                _to = max(_to)
            if _to and float(_to) > 120:
                _to = float(_to) / 1000.0
            _last_exc = None
            for _attempt in range(2):
                _req = _ur2.Request(url, data=_body, headers=_hd, method=method.upper())
                try:
                    with self._opener.open(_req, timeout=_to or 15) as _resp:
                        try:
                            _content = _resp.read()
                        except _hc2.IncompleteRead as _ire:
                            _content = _ire.partial or b""
                        _hdrs = dict(_resp.headers.items())
                        _final = _resp.geturl()
                        _status = _resp.status
                except _ue2.HTTPError as _he:
                    try:
                        _content = _he.read()
                    except _hc2.IncompleteRead as _ire:
                        _content = _ire.partial or b""
                    except Exception:
                        _content = b""
                    _hdrs = dict(_he.headers.items()) if _he.headers else {}
                    _final = _he.geturl() if hasattr(_he, "geturl") else url
                    _status = _he.code
                except Exception as _exc:
                    _last_exc = _exc
                    continue
                try:
                    _ce = (_hdrs.get("Content-Encoding", "") or "").lower()
                    if "gzip" in _ce:
                        import gzip as _gz
                        _content = _gz.decompress(_content)
                    elif "deflate" in _ce:
                        import zlib as _zl
                        _content = _zl.decompress(_content)
                except Exception:
                    pass
                for _c in self._jar:
                    self.cookies[_c.name] = _c.value
                return requests.Response(_status, _hdrs, _content, _final, dict(self.cookies))
            raise requests.exceptions.ConnectionError(str(_last_exc))
    requests.Session.request = _sess_request
    def _resp_apparent_encoding(self):
        _ct = self.headers.get("Content-Type", "") or ""
        return _ct.split("charset=")[-1].split(";")[0].strip() if "charset=" in _ct else "utf-8"
    requests.Response.apparent_encoding = property(_resp_apparent_encoding)
    requests.Response.ok = property(lambda self: self.status_code < 400)
    requests.Response.reason = property(lambda self: "")
    def _resp_apparent_encoding(self):
        _ct = self.headers.get("Content-Type", "") or ""
        return _ct.split("charset=")[-1].split(";")[0].strip() if "charset=" in _ct else "utf-8"
    requests.Response.apparent_encoding = property(_resp_apparent_encoding)
    requests.Response.ok = property(lambda self: self.status_code < 400)
    requests.Response.reason = property(lambda self: "")
    class _ReqUtils:
        @staticmethod
        def quote(s, safe="/"):
            import urllib.parse as _up
            return _up.quote(s, safe=safe)
        @staticmethod
        def unquote(s):
            import urllib.parse as _up
            return _up.unquote(s)
    requests.utils = _ReqUtils
try:
    from bs4 import BeautifulSoup
except Exception:
    # --- embedded BeautifulSoup-compatible shim (pyquery/lxml based) for Yingxia adaptation ---
    # Inserted by py578 adaptation: Yingxia has no bs4; pyquery is available via host html().
    import re as _re_bs4


    class _Bs4Text(str):
        """NavigableString stand-in: str with .parent."""
        def __new__(cls, s, parent=None):
            obj = str.__new__(cls, s)
            obj.parent = parent
            return obj


    class _Bs4Tag:
        def __init__(self, pq_obj):
            self._pq = pq_obj  # PyQuery holding exactly one element (or empty)

        # -- basic --
        @property
        def _el(self):
            els = list(self._pq) if self._pq is not None else []
            return els[0] if els else None

        @property
        def name(self):
            el = self._el
            return el.tag if el is not None else None

        @property
        def attrs(self):
            el = self._el
            if el is None:
                return {}
            out = dict(el.attrib)
            if "class" in out:
                out["class"] = out["class"].split()
            return out

        def get(self, key, default=None):
            el = self._el
            if el is None:
                return default
            v = el.get(key)
            if v is None:
                return default
            if key == "class":
                return v.split()
            return v

        def __getitem__(self, key):
            v = self.get(key)
            if v is None:
                raise KeyError(key)
            return v

        def __contains__(self, key):
            el = self._el
            return el is not None and key in el.attrib

        def __bool__(self):
            return self._el is not None

        __nonzero__ = __bool__

        def __repr__(self):
            return "<_Bs4Tag %s>" % (self.name,)

        # -- text --
        def get_text(self, separator="", strip=False):
            el = self._el
            if el is None:
                return ""
            chunks = list(el.itertext())
            if strip:
                chunks = [c.strip() for c in chunks]
                chunks = [c for c in chunks if c]
            return separator.join(chunks)

        @property
        def text(self):
            return self.get_text()

        @property
        def string(self):
            el = self._el
            if el is None:
                return None
            texts = [t for t in el.itertext() if t.strip()]
            return texts[0].strip() if len(texts) == 1 else None

        # -- traversal --
        @property
        def parent(self):
            el = self._el
            if el is None:
                return None
            p = el.getparent()
            if p is None:
                return None
            return _Bs4Tag(self._pq.__class__(p))

        def find_parent(self, name=None, **kw):
            node = self.parent
            while node is not None:
                if name is None or node.name == name:
                    if _bs4_match_attrs(node, kw):
                        return node
                node = node.parent
            return None

        def find_previous_sibling(self, name=None, **kw):
            el = self._el
            if el is None:
                return None
            prev = el.getprevious()
            while prev is not None:
                if isinstance(prev.tag, str):
                    node = _Bs4Tag(self._pq.__class__(prev))
                    if name is None or node.name == name:
                        if _bs4_match_attrs(node, kw):
                            return node
                prev = prev.getprevious()
            return None

        previous_sibling = property(lambda self: self.find_previous_sibling())

        def find_next_sibling(self, name=None, **kw):
            el = self._el
            if el is None:
                return None
            nxt = el.getnext()
            while nxt is not None:
                if isinstance(nxt.tag, str):
                    node = _Bs4Tag(self._pq.__class__(nxt))
                    if name is None or node.name == name:
                        if _bs4_match_attrs(node, kw):
                            return node
                nxt = nxt.getnext()
            return None

        next_sibling = property(lambda self: self.find_next_sibling())

        # -- search --
        def select(self, css):
            if self._pq is None:
                return []
            try:
                found = self._pq(css)
            except Exception:
                return []
            return [_Bs4Tag(item) for item in found.items()]

        def select_one(self, css):
            res = self.select(css)
            return res[0] if res else None

        def find_all(self, name=None, attrs=None, recursive=True, text=None, **kw):
            if text is not None or (attrs and "text" in (attrs or {})):
                pat = text if text is not None else attrs.get("text")
                return self._find_text(pat)
            css = _bs4_css_for(name, attrs, kw)
            if css is None:
                # regex attr filters etc.: gather candidates then filter in python
                base = name if isinstance(name, str) and name else "*"
                cands = self.select(base)
                return [c for c in cands if _bs4_match_attrs(c, _bs4_merge_attrs(attrs, kw))]
            return self.select(css)

        def find(self, name=None, attrs=None, recursive=True, text=None, **kw):
            res = self.find_all(name, attrs, recursive, text, **kw)
            return res[0] if res else None

        def _find_text(self, pat):
            el = self._el
            if el is None:
                return []
            out = []
            for node in el.iter():
                if not isinstance(node.tag, str):
                    continue
                for txt, parent_el in ((node.text, node), (node.tail, node.getparent())):
                    if txt and _bs4_text_match(pat, txt):
                        if parent_el is None:
                            parent_el = node
                        out.append(_Bs4Text(txt, _Bs4Tag(self._pq.__class__(parent_el))))
            return out


    def _bs4_text_match(pat, txt):
        if pat is None:
            return True
        if hasattr(pat, "search"):
            return bool(pat.search(txt))
        return str(pat) in txt


    def _bs4_merge_attrs(attrs, kw):
        merged = {}
        if attrs:
            merged.update(attrs)
        merged.update(kw)
        return merged


    def _bs4_match_attrs(tag, want):
        if not want:
            return True
        for k, v in want.items():
            key = "class" if k == "class_" else k
            have = tag.get(key)
            if have is None:
                return False
            if hasattr(v, "search"):
                if not v.search(" ".join(have) if isinstance(have, list) else str(have)):
                    return False
            elif isinstance(v, (list, tuple)):
                have_list = have if isinstance(have, list) else [have]
                if not all(x in have_list for x in v):
                    return False
            elif key == "class":
                have_list = have if isinstance(have, list) else str(have).split()
                if not all(x in have_list for x in str(v).split()):
                    return False
            elif str(have) != str(v):
                return False
        return True


    def _bs4_css_for(name, attrs, kw):
        """Build CSS selector, or None if python-side filtering is needed."""
        merged = _bs4_merge_attrs(attrs, kw)
        for v in merged.values():
            if hasattr(v, "search"):
                return None
        parts = []
        if isinstance(name, str) and name:
            parts.append(name)
        elif isinstance(name, (list, tuple)):
            return None
        for k, v in merged.items():
            if k == "class_":
                for cls in str(v).split():
                    parts.append("." + cls)
            elif k == "id":
                parts.append("#" + str(v))
            elif isinstance(v, (list, tuple)):
                parts.append('[%s="%s"]' % (k, " ".join(str(x) for x in v)))
            elif v is True:
                parts.append("[%s]" % k)
            else:
                parts.append('[%s="%s"]' % (k, str(v).replace('"', '\\"')))
        return "".join(parts) if parts else "*"


    def _bs4_make(html_text):
        from pyquery import PyQuery as _PQ
        if html_text is None:
            html_text = ""
        if isinstance(html_text, bytes):
            html_text = html_text.decode("utf-8", "ignore")
        return _PQ(str(html_text))


    class BeautifulSoup(_Bs4Tag):
        def __init__(self, markup="", features=None, **kw):
            super().__init__(_bs4_make(markup))
    # --- end embedded BeautifulSoup shim ---
import re
import sys
import json
import urllib.parse
from base.spider import Spider
from urllib.parse import quote, urljoin

sys.path.append('..')

xurl = "http://www.dgpengcheng.com"
headers = {
    'User-Agent': 'Mozilla/5.0 (Linux; Android 13; M2102J2SC Build/TKQ1.221114.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/144.0.7559.31 Mobile Safari/537.36',
    'Referer': xurl,
}

class Spider(Spider):
    global xurl, headers

    def getName(self):
        return "星辰影院"

    def init(self, extend):
        pass

    def isVideoFormat(self, url):
        pass

    def manualVideoCheck(self):
        pass

    def homeContent(self, filter):
        classes = [
            {"type_id": "1", "name": "电影"},
            {"type_id": "2", "name": "电视剧"},
            {"type_id": "3", "name": "综艺"},
            {"type_id": "4", "name": "动漫"},
            {"type_id": "28", "name": "纪录片"}
        ]
        return {'class': classes}

    def _parse_video_items(self, soup):
        videos = []
        seen_ids = set()

        for li in soup.select('li'):
            a_tag = li.select_one('a.stui-vodlist__thumb')
            if not a_tag:
                continue

            href = a_tag.get('href', '')
            if not href:
                continue
            vod_id = href if 'http' in href else xurl + href
            if vod_id in seen_ids:
                continue
            seen_ids.add(vod_id)

            img = a_tag.select_one('img')
            title = a_tag.get('title', '')
            if not title and img:
                title = img.get('alt', '')
            if not title:
                title = a_tag.get_text(strip=True)
            if not title:
                continue

            pic = a_tag.get('data-original', '')
            if not pic and img:
                pic = img.get('data-original') or img.get('src', '')
            if pic and not pic.startswith('http'):
                pic = xurl + ('' if pic.startswith('/') else '/') + pic

            remark = ''
            remark_span = a_tag.select_one('span.pic-text')
            if remark_span:
                remark = remark_span.get_text(strip=True)

            videos.append({
                "vod_id": vod_id,
                "vod_name": title,
                "vod_pic": pic,
                "vod_remarks": remark
            })
        return videos

    def homeVideoContent(self):
        return {'list': self._parse_video_items(BeautifulSoup(requests.get(xurl, headers=headers).text, 'lxml'))}

    def categoryContent(self, cid, pg, filter, ext):
        page = int(pg) if pg else 1
        url = f"{xurl}/vtype/{cid}-{page}.html"
        videos = self._parse_video_items(BeautifulSoup(requests.get(url, headers=headers).text, 'lxml'))
        return {
            'list': videos,
            'page': page,
            'pagecount': 999,
            'limit': 90,
            'total': 9999
        }

    def detailContent(self, ids):
        did = ids[0]
        if not did.startswith('http'):
            did = urljoin(xurl, did)
        resp = requests.get(did, headers=headers, timeout=10)
        soup = BeautifulSoup(resp.text, 'lxml')
        info = {'vod_id': did}

        thumb = soup.select_one('.stui-content__thumb img')
        if thumb:
            pic = thumb.get('data-original') or thumb.get('src', '')
            if pic and pic.startswith('//'):
                pic = 'https:' + pic
            elif pic and not pic.startswith('http'):
                pic = urljoin(xurl, pic)
            info['vod_pic'] = pic

        detail_div = soup.select_one('.stui-content')
        if detail_div:
            title_h1 = detail_div.select_one('h3.title')
            if title_h1:
                raw_title = title_h1.get_text(strip=True).replace('\n', '')
                info['vod_name'] = raw_title

            for p in detail_div.select('p.data'):
                text = p.get_text(strip=True)
                if '主演：' in text:
                    info['vod_actor'] = text.split('主演：')[-1].strip()
                if '类型：' in text:
                    info['type_name'] = text.split('类型：')[-1].strip()
                if '导演：' in text:
                    info['vod_director'] = text.split('导演：')[-1].strip()
                if '状态：' in text:
                    info['vod_remarks'] = text.split('状态：')[-1].strip()
                if '年代：' in text:
                    info['vod_year'] = text.split('年代：')[-1].strip()
                if '地区：' in text:
                    info['vod_area'] = text.split('地区：')[-1].strip()

        content_div = soup.select_one('.detail-content')
        if content_div:
            p = content_div.find('p')
            if p:
                text = p.get_text(strip=True)
            else:
                text = content_div.get_text(strip=True)
            text = re.sub(r'^简介[：:]\s*', '', text)
            info['vod_content'] = text
        else:
            info['vod_content'] = ''

        filter_lines = ['猜您喜欢', '同类型']
        filter_titles = ['1080P', 'дрр滈凊']
        ktabs = []
        klists = []
        seen_lines = set()

        line_items = soup.select('.stui-pannel__head h3')
        playlist_containers = soup.select('.stui-content__playlist')

        for idx, tab in enumerate(line_items):
            if idx >= len(playlist_containers):
                break
            line_name = tab.get_text(strip=True)
            if not line_name or line_name in filter_lines:
                continue
            if line_name in seen_lines:
                continue
            container = playlist_containers[idx]
            episode_links = container.select('li a')
            if not episode_links:
                continue
            klist = []
            for ep in episode_links:
                ep_name = ep.get_text(strip=True)
                ep_link = ep.get('href', '')
                if ep_name in filter_titles:
                    continue
                if ep_name and ep_link:
                    klist.append(f'{ep_name}${ep_link}')
            if klist:
                seen_lines.add(line_name)
                ktabs.append(line_name)
                klists.append('#'.join(klist))

        info["vod_play_from"] = '$$$'.join(ktabs)
        info["vod_play_url"] = '$$$'.join(klists)

        return {'list': [info]}

    def playerContent(self, flag, id, vipFlags):
        try:
            play_url = id if id.startswith(('http://', 'https://')) else xurl + id
            html = requests.get(play_url, headers=headers, timeout=10).text

            pattern = r'var\s+player_\w+\s*=\s*(\{[^;]+?\})\s*(?:;|</script)'
            match = re.search(pattern, html, re.DOTALL)
            video_url = ''
            if match:
                try:
                    json_str = match.group(1).strip()
                    json_str = re.sub(r',\s*}', '}', json_str)
                    data = json.loads(json_str)
                    video_url = data.get('url', '')
                except Exception:
                    pass

            if not video_url:
                m3u8_match = re.search(r'["\']url["\']\s*:\s*["\'](https?://[^"\']+\.m3u8[^"\']*)["\']', html)
                if m3u8_match:
                    video_url = m3u8_match.group(1)

            if video_url:
                parse = 0 if re.search(r'\.(m3u8|mp4|mkv|flv|ts)$', video_url, re.I) else 1
                if parse:
                    video_url = play_url
            else:
                parse = 1
                video_url = play_url

            return {"parse": parse, "playUrl": "", "url": video_url, "header": headers}
        except Exception as e:
            print(f"player error: {e}")
            return {"parse": 1, "playUrl": "", "url": xurl + id, "header": headers}

    def searchContent(self, key, quick, page='1'):
        page = int(page) if page else 1
        encoded_key = urllib.parse.quote(key, safe='')
        url = f"{xurl}/vodsearch/{encoded_key}----------{page}---.html"
        soup = BeautifulSoup(requests.get(url, headers=headers).text, 'lxml')
        videos = self._parse_video_items(soup)
        return {
            'list': videos,
            'page': page,
            'pagecount': 60,
            'limit': 30,
            'total': 999999
        }

    # 映匣适配：宿主基类未提供 proxyM3u8/proxyMedia/proxyTs；本脚本播放链不生成代理地址，
    # localProxy 分发为死代码，补空实现避免 AttributeError
    def proxyM3u8(self, params):
        return None

    def proxyMedia(self, params):
        return None

    def proxyTs(self, params):
        return None

    def localProxy(self, params):
        if params['type'] == "m3u8":
            return self.proxyM3u8(params)
        elif params['type'] == "media":
            return self.proxyMedia(params)
        elif params['type'] == "ts":
            return self.proxyTs(params)
        return None