MIT License

项目介绍

mediago-dev/mediago-core 是一个托管在 GitHub 上的开源项目,主要使用 Go 编写,采用 MIT License 许可证,目前获得 46 个 Star、9 次 Fork。

仓库全名
mediago-dev/mediago-core
开源许可证
MIT License
Star 数
46
Fork 数
9
未关闭 Issue
3

README 摘要

mediago A streaming media downloader written in Go, supporting HLS and DASH protocols. Features HLS — Master/media playlist parsing, AES-128 decryption, BYTERANGE DASH — SegmentTemplate, SegmentList, SegmentBase, Timeline Concurrent download — Goroutine pool with configurable thread count Live recording — Playlist refresh, segment deduplication, duration limit Auto stream selection — Pick best quality video + audio…

完整内容见 GitHub 原始 README 或本页 。

常见问题

mediago-core 用什么语言开发?

主要使用 Go 编写,采用 MIT License 许可证,目前有 46 个 Star。

mediago-core 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 mediago-core 的源码?

可以直接克隆仓库:git clone https://github.com/mediago-dev/mediago-core.git,默认分支为 master;安装与运行步骤见仓库 README。

mediago-core 最近还在维护吗?

仓库最近一次更新为 4月7日,当前有 3 个未关闭 Issue;Star 数为 46,可作为社区活跃度的参考。

简要分析

热度分
67
价值分
30
活跃状态
活跃

语言占比

Go
Shell

Release

README

mediago

A streaming media downloader written in Go, supporting HLS and DASH protocols.

Features

  • HLS — Master/media playlist parsing, AES-128 decryption, BYTERANGE
  • DASH — SegmentTemplate, SegmentList, SegmentBase, Timeline
  • Concurrent download — Goroutine pool with configurable thread count
  • Live recording — Playlist refresh, segment deduplication, duration limit
  • Auto stream selection — Pick best quality video + audio
  • Merge — Binary concat (fMP4) / FFmpeg concat (TS → MP4)
  • Custom headers, proxy, retry — For restricted content and unstable networks

Install

go install github.com/caorushizi/mediago-core/cmd/mediago@latest

Or build from source:

git clone https://github.com/caorushizi/mediago-core.git
cd mediago-core
task build

Usage

# Basic download
mediago "https://example.com/video.m3u8"

# Specify output
mediago "https://example.com/video.m3u8" -d ./output -n "my_video"

# Custom headers
mediago "https://example.com/video.m3u8" \
  -H "Referer: https://example.com" \
  -H "Cookie: token=xxx"

# 16 threads + proxy
mediago "https://example.com/video.m3u8" -t 16 --proxy socks5://127.0.0.1:1080

# Auto select best quality
mediago "https://example.com/master.m3u8" --auto-select

# DASH
mediago "https://example.com/manifest.mpd" --auto-select

# Live recording for 1 hour
mediago "https://example.com/live.m3u8" --live-duration 01:00:00

# Download only, skip merge
mediago "https://example.com/video.m3u8" --no-merge

CLI Reference

Flag Short Default Description
--save-dir -d . Save directory
--save-name -n auto Output filename
--tmp-dir system temp Temporary directory
--header -H Custom HTTP header (repeatable)
--proxy Proxy URL (http/socks5)
--timeout 30 HTTP timeout in seconds
--thread-count -t 8 Concurrent threads
--retry-count -r 3 Retry per segment
--auto-select false Auto select best quality
--select-video -sv Video stream filter
--select-audio -sa Audio stream filter
--no-merge false Skip merge step
--del-after-done true Delete temp files
--ffmpeg-path ffmpeg Path to ffmpeg
--binary-merge false Force binary concat
--key Decryption key (HEX, repeatable)
--custom-hls-method Force encryption method
--custom-hls-key Force HLS key (HEX)
--custom-hls-iv Force HLS IV (HEX)
--live auto Force live mode
--live-duration unlimited Recording duration (HH:mm:ss)
--live-wait-time auto Playlist refresh interval (sec)
--log-level info Log level
--no-log false Disable logging

Architecture

mediago [url]
    │
    ├─ Detect protocol (HLS / DASH)
    │
    ├─ Parse manifest
    │   ├─ HLS: master playlist → media playlist → segments
    │   └─ DASH: MPD → periods → adaptation sets → segments
    │
    ├─ Select streams (auto / manual)
    │
    ├─ Download segments (concurrent HTTP)
    │
    ├─ Decrypt (AES-128-CBC if encrypted)
    │
    ├─ Merge
    │   ├─ fMP4: binary concat (init + segments)
    │   └─ TS: ffmpeg -c copy
    │
    └─ Cleanup temp files
cmd/mediago/          CLI entry point
internal/
├── parser/
│   ├── hls/          HLS playlist parsing
│   └── dash/         DASH MPD parsing
├── downloader/       Concurrent HTTP download engine
├── crypto/           AES-128 decryption
├── merger/           Binary concat + FFmpeg merge
├── pipeline/         Orchestration + live recording
└── model/            Shared data types

Development

Requires Go 1.21+ and Task.

task build        # Build binary to bin/mediago
task run          # Run directly
task test         # Run all tests
task fmt          # Format code
task lint         # Run linter

Disclaimer

This software is for educational and research purposes only. See DISCLAIMER.md for details.

License

MIT

评论

暂无评论