The Stream Detector

repository·master·Indexed 19 days ago

https://github.com/54ac/stream-detector

A browser extension for Firefox and Chrome that identifies and captures media stream URLs (HLS, DASH, HDS, and Smooth Streaming). It monitors file extensions and Content-Type headers to provide direct download links and generates ready-to-use commands for CLI tools such as yt-dlp, FFmpeg, Streamlink, hlsdl, and N_m3u8DL-RE, including necessary cookies and headers.

Tokens
1.2K
Snippets
5
Records
9
Agent score
22%

What's inside stream-detector

  1. Overview of The Stream Detector

    master

    The Stream Detector is a browser extension (Firefox and Chrome) designed to identify and capture URLs for media streams. It detects playlists and subtitles used by protocols such as Apple HLS, Adobe HDS, MPEG-DASH, and Microsoft Smooth Streaming.

    Key capabilities include:

    • Monitoring file extensions and Content-Type headers to detect media.
    • Providing direct download links for video/audio files.
    • Assembling ready-made commands for external tools like yt-dlp, FFmpeg, Streamlink, hlsdl, and N_m3u8DL-RE, automatically including necessary cookies and headers.
  2. How to use The Stream Detector

    master
    1. Detection: When a stream is detected on a webpage, you will receive a notification.
    2. Accessing URLs: Click the extension's toolbar button to open the menu.
    3. Copying Data: Click on the appropriate filename within the menu to copy the URL in your desired format (e.g., raw URL or a pre-assembled command for a downloader).
    4. Customization: Use the addon's options page to configure behavior, such as enabling direct media file downloads.
  3. Limitations and Compatibility Notes

    master

    When using The Stream Detector, keep the following in mind:

    • Mainstream Services: Websites like YouTube, Vimeo, and Facebook often use proprietary technologies that this addon does not support. For these services, use tools like yt-dlp directly.
    • Chrome Support: The Chrome version is not actively maintained or supported; the Firefox version is the primary target.
    • Project Status: As of v2.11, active development is on hold, though serious issues may still be addressed.
  4. Automate option saving with saveOptionStorage

    master

    The saveOptionStorage(e, options) function is a helper designed to handle UI events (like change or input) and automatically persist the corresponding settings to chrome.storage.local. It also sends a chrome.runtime.sendMessage({ options: true }) to notify other parts of the extension that options have changed.

    It handles several input types:

    • Textareas: Splits content by newline and filters out empty lines, storing them as an array.
    • Checkboxes: Stores the checked boolean state.
    • Radio Buttons: When a radio button is clicked, it iterates through the provided options array to update the storage state for the entire radio group.
    • Text Inputs: Trims whitespace. If a text input is cleared, the key is removed from storage.
    • Custom Commands: If the target is regexCommand or customCommand, it uses specific logic to map the input to storage keys (e.g., prefixing customCommand with the selected copyMethod).
    // Example: Handling a checkbox change event
    const event = { target: { id: 'myCheckbox', type: 'checkbox', checked: true } };
    await saveOptionStorage(event, []);
    
    // Example: Handling a textarea change event
    const event = { target: { id: 'myList', tagName: 'TEXTAREA', value: 'item1\nitem2' } };
    await saveOptionStorage(event, []);