google-chrome-extensionm3u8

How can i get m3u8 address without devtools-network?


I want create some program (chrome extension or python) which crawl m3u8 links.

My target site include no information of m3u8 link in page source. so, I cant get m3u8 link in HTML page.

I already know chrome devtools-network can view m3u8 links. but I want crawl, so i can't use that idea.

I saw this program. https://chrome.google.com/webstore/detail/video-m3u8-sniffer-find-h/akkncdpkjlfanomlnpmmolafofpnpjgn

It display m3u8 link. that's what i need!

Sadly, I can't find how to do that. please help me!


Solution

  • this code work for me.

    const filter = {
        urls: [
        ]
    };
    chrome.webRequest.onBeforeRequest.addListener(
        async function (details) {
            if (details.url.indexOf(".m3u8") > 0) { //get only m3u8 request
                update_urlMap('last', details.url) //save to map variable
                            
            }
        }, filter);
    

    upper code is 'background script' code. That code run for every time, get all m3u8 request.

    Chrome extension can use message-passing to communicate with background script and popup.