cat-catch 插件调用 N_m3u8DL-RE

cat-catch 设置 N_m3u8DL-RE

ref https://github.com/nilaoda/N_m3u8DL-RE
ref https://github.com/xifangczy/cat-catch
ref https://github.com/corbamico/m3u8dl-invoke/

1.1 安装 n-m3u8dl-re

1
scoop install n-m3u8dl-re_x

1.2 新建 m3u8dl 程序

先用 powershell 写一段脚本 n_m3u8dl-re_protocol.ps1 ,然后转换成可执行文件 n_m3u8dl-re_protocol.exe

  • 脚本
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    # 接收m3u8://xxxxxx
    param($m3u8url)
    Write-Host "m3u8url: $m3u8url"

    $bs64 = $m3u8url.replace('m3u8dl://', '').replace('/', '')
    $httpurl = [Text.Encoding]::ASCII.GetString([Convert]::FromBase64String($bs64))
    Write-Host "httpurl: $httpurl"

    $path = 'c:\Users\xxxxx\scoop\shims\N_m3u8DL-re.exe'
    $cmd = $path + ' ' + $httpurl
    Write-Host "$cmd"

    Start-Process "$path" "$httpurl" -NoNewWindow
    Start-Sleep 30
  • 转换
    1
    2
    3
    Install-Module ps2exe

    ps2exe n_m3u8dl-re_protocol.ps1 n_m3u8dl-re_protocol.exe

1.3 添加注册表 m3u8dl 协议

1
2
3
reg add "HKCR\m3u8dl\shell\open\command" /ve /t REG_SZ /d "C:\Users\XXXX\n_m3u8dl-re_protocol.exe %1" /f

# 测试在浏览器输入 'm3u8dl://' , 能够打开?

1.4 安装 cat-catch 插件, 对n-m3u8dl-cli 默认设置修改

1
"${url}"

===

2 N_m3u8DL-RE on Synology

2.1 下载/安装 N_m3u8DL-RE

1
2
wget https://github.com/nilaoda/N_m3u8DL-RE/releases/download/v0.2.0-beta/N_m3u8DL-RE_Beta_linux-x64_20230628.tar.gz

2.2 设置 ffmpeg 等路径

1
2
3
4
5
~/N_m3u8DL-RE --del-after-done --binary-merge\
--ffmpeg-binary-path /var/packages/ffmpeg6/target/bin/ffmpeg6\
--tmp-dir /volume2/video/tmp/ \
--save-dir /volume2/video/ \
--save-name yyy.mp4 https://xxxxxxxxxxxxxxxxxxxxxx.m3u8