AdultColony-API icon indicating copy to clipboard operation
AdultColony-API copied to clipboard

Some `/get` endpoint like missAV is missing stream info?

Open jjymiju opened this issue 1 year ago • 2 comments

Hi 👋

I noticed that the MissAV and some others Platform /get endpoint returns video metadata successfully, but the assets field only contains the cover image — no stream URLs are included. Is this because the site is blocking or limiting scraping of video streams?

Here’s an example of the response I received:

{
  "success": true,
  "data": {
    "title": "HMN-507 Sharing a room with my female boss who is always bullish and never shows weakness...",
    "id": "hmn-507",
    "image": "https://fourhoi.com/hmn-507/cover-n.jpg",
    "upload_date": "2023-12-24",
    "duration": "1:59:17",
    "tags": ["Big Breasts", "Individual", "Ntr", "Plot", "Creampie", "Hd", "Exclusive", "Female Boss"],
    "description": "[Kimina's pheromones are on full display! ...]"
  },
  "assets": ["https://fourhoi.com/hmn-507/cover-n.jpg"],
  "source": "https://missav.ws/en/hmn-507"
}

jjymiju avatar Oct 15 '25 03:10 jjymiju

You’re right — MissAV is quite restrictive by default. Although it already uses Puppeteer to fetch the basic content metadata, it’s not incapable of retrieving stream URLs directly. I intentionally avoided that approach to keep the scraper lightweight and reduce unnecessary network overhead.

Instead, I wrote a Python function that leverages Playwright and BeautifulSoup to extract all available streaming URLs from a MissAV video page.

Here’s the working script:

`from playwright.sync_api import sync_playwright from bs4 import BeautifulSoup import re import js2py from collections import defaultdict

url = input("Enter your MissAV URL: ")

def normalize_quality(q): if 'x' in q: try: _, h = q.lower().split('x', 1) h_int = int(re.findall(r'\d+', h)[0]) return f"{h_int}p" except Exception: return q m = re.fullmatch(r'(\d{3,4})p', q.lower()) if m: return f"{m.group(1)}p" return q

with sync_playwright() as p: browser = p.chromium.launch(headless=True) page = browser.new_page(user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36") page.goto(url, timeout=60000) page.wait_for_load_state("networkidle")

html = page.content()
browser.close()

response = BeautifulSoup(html, "html5lib")
script_tags = response.find_all('script')

for script in script_tags:
    if script.string and 'm3u8' in script.string.lower():
        script_content = script.string
        eval_pattern = r'eval\(function\(p,a,c,k,e,d\).*?\}\(.*?\)\)'
        eval_matches = re.findall(eval_pattern, script_content, re.DOTALL)

        for eval_code in eval_matches:
            try:
                result = js2py.eval_js(eval_code)
                base_url_pattern = r'(https?://[\w\d\.-]+/[\w\d\.-]+-[\w\d\.-]+-[\w\d\.-]+-[\w\d\.-]+-[\w\d\.-]+)'
                base_url_match = re.search(base_url_pattern, result)
                if base_url_match:
                    base_url = base_url_match.group(1)

                    qualities_wxh = re.findall(r'\b(\d{2,4}x\d{2,4})\b', eval_code)
                    qualities_hp = re.findall(r'\b(\d{3,4}p)\b', eval_code)
                    raw_tokens = qualities_wxh + qualities_hp

                    def to_norm_p(q):
                        if 'x' in q.lower():
                            try:
                                _, h = q.lower().split('x', 1)
                                h_int = int(re.findall(r'\d+', h)[0])
                                return f"{h_int}p"
                            except Exception:
                                return q
                        m = re.fullmatch(r'(\d{3,4})p', q.lower())
                        if m:
                            return f"{m.group(1)}p"
                        return q

                    norm_to_raw = defaultdict(set)
                    for tok in raw_tokens:
                        norm_to_raw[to_norm_p(tok)].add(tok)

                    norm_qualities = set(norm_to_raw.keys())
                    has_1080_720 = ('1080p' in norm_qualities) and ('720p' in norm_qualities)
                    only_480 = ('480p' in norm_qualities) and ('720p' not in norm_qualities) and ('1080p' not in norm_qualities)
                    from_720p = ('720p' in norm_qualities) and ('1080p' not in norm_qualities)

                    if has_1080_720:
                        norm_qualities.update(['480p', '360p'])
                    elif only_480:
                        if any("x480" in raw for raw in norm_to_raw["480p"]):
                            norm_to_raw["360p"].add("640x360")
                        else:
                            norm_to_raw["360p"].add("360p")
                        norm_qualities.add("360p")
                    elif from_720p:
                        if any('x720' in raw for raw in norm_to_raw["720p"]):
                            norm_to_raw["360p"].add("640x360")
                        else:
                            norm_to_raw["360p"].add("360p")
                        norm_qualities.add("360p")

                    for nq in list(norm_qualities):
                        if nq not in norm_to_raw:
                            norm_to_raw[nq].add(nq)

                    norm_qualities = sorted(norm_qualities, key=lambda x: int(re.findall(r'\d+', x)[0]), reverse=True)

                    print("Found qualities (normalized):", norm_qualities)
                    print("Available m3u8 URLs:")

                    for nq in norm_qualities:
                        for raw_tok in sorted(norm_to_raw[nq]):
                            print(f"{nq}: {base_url}/{raw_tok}/video.m3u8")
                    print("-" * 80)

            except Exception as e:
                print(f"Error decoding eval: {e}")

`

This script successfully extracts and prints all available m3u8 stream URLs for a given MissAV video.

Snowball-01 avatar Oct 19 '25 10:10 Snowball-01

You’re right — MissAV is quite restrictive by default. Although it already uses Puppeteer to fetch the basic content metadata, it’s not incapable of retrieving stream URLs directly. I intentionally avoided that approach to keep the scraper lightweight and reduce unnecessary network overhead.

Instead, I wrote a Python function that leverages Playwright and BeautifulSoup to extract all available streaming URLs from a MissAV video page.

Here’s the working script:

`from playwright.sync_api import sync_playwright from bs4 import BeautifulSoup import re import js2py from collections import defaultdict

url = input("Enter your MissAV URL: ")

def normalize_quality(q): if 'x' in q: try: _, h = q.lower().split('x', 1) h_int = int(re.findall(r'\d+', h)[0]) return f"{h_int}p" except Exception: return q m = re.fullmatch(r'(\d{3,4})p', q.lower()) if m: return f"{m.group(1)}p" return q

with sync_playwright() as p: browser = p.chromium.launch(headless=True) page = browser.new_page(user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36") page.goto(url, timeout=60000) page.wait_for_load_state("networkidle")

html = page.content()
browser.close()

response = BeautifulSoup(html, "html5lib")
script_tags = response.find_all('script')

for script in script_tags:
    if script.string and 'm3u8' in script.string.lower():
        script_content = script.string
        eval_pattern = r'eval\(function\(p,a,c,k,e,d\).*?\}\(.*?\)\)'
        eval_matches = re.findall(eval_pattern, script_content, re.DOTALL)

        for eval_code in eval_matches:
            try:
                result = js2py.eval_js(eval_code)
                base_url_pattern = r'(https?://[\w\d\.-]+/[\w\d\.-]+-[\w\d\.-]+-[\w\d\.-]+-[\w\d\.-]+-[\w\d\.-]+)'
                base_url_match = re.search(base_url_pattern, result)
                if base_url_match:
                    base_url = base_url_match.group(1)

                    qualities_wxh = re.findall(r'\b(\d{2,4}x\d{2,4})\b', eval_code)
                    qualities_hp = re.findall(r'\b(\d{3,4}p)\b', eval_code)
                    raw_tokens = qualities_wxh + qualities_hp

                    def to_norm_p(q):
                        if 'x' in q.lower():
                            try:
                                _, h = q.lower().split('x', 1)
                                h_int = int(re.findall(r'\d+', h)[0])
                                return f"{h_int}p"
                            except Exception:
                                return q
                        m = re.fullmatch(r'(\d{3,4})p', q.lower())
                        if m:
                            return f"{m.group(1)}p"
                        return q

                    norm_to_raw = defaultdict(set)
                    for tok in raw_tokens:
                        norm_to_raw[to_norm_p(tok)].add(tok)

                    norm_qualities = set(norm_to_raw.keys())
                    has_1080_720 = ('1080p' in norm_qualities) and ('720p' in norm_qualities)
                    only_480 = ('480p' in norm_qualities) and ('720p' not in norm_qualities) and ('1080p' not in norm_qualities)
                    from_720p = ('720p' in norm_qualities) and ('1080p' not in norm_qualities)

                    if has_1080_720:
                        norm_qualities.update(['480p', '360p'])
                    elif only_480:
                        if any("x480" in raw for raw in norm_to_raw["480p"]):
                            norm_to_raw["360p"].add("640x360")
                        else:
                            norm_to_raw["360p"].add("360p")
                        norm_qualities.add("360p")
                    elif from_720p:
                        if any('x720' in raw for raw in norm_to_raw["720p"]):
                            norm_to_raw["360p"].add("640x360")
                        else:
                            norm_to_raw["360p"].add("360p")
                        norm_qualities.add("360p")

                    for nq in list(norm_qualities):
                        if nq not in norm_to_raw:
                            norm_to_raw[nq].add(nq)

                    norm_qualities = sorted(norm_qualities, key=lambda x: int(re.findall(r'\d+', x)[0]), reverse=True)

                    print("Found qualities (normalized):", norm_qualities)
                    print("Available m3u8 URLs:")

                    for nq in norm_qualities:
                        for raw_tok in sorted(norm_to_raw[nq]):
                            print(f"{nq}: {base_url}/{raw_tok}/video.m3u8")
                    print("-" * 80)

            except Exception as e:
                print(f"Error decoding eval: {e}")

`

This script successfully extracts and prints all available m3u8 stream URLs for a given MissAV video.

Thanks a lot for sharing this script — appreciate your effort! ❤

jjymiju avatar Oct 19 '25 14:10 jjymiju