2025年m3u8 ts文件利用系统工具COPY合并序列TS文件

m3u8 ts文件利用系统工具COPY合并序列TS文件实现原理 1 批量下载 ts 文件到系统文件夹 2 不破坏文件命名规则 重命名 并保存在一个 INT 数组 如 我下载的文件名都是 8 3 3990 16 ts 8 3 3989 17 ts 8 3 3968 18 ts

大家好,我是讯享网,很高兴认识大家。

实现原理:

1、批量下载.ts文件到系统文件夹,

2、不破坏文件命名规则-重命名,并保存在一个INT数组

如:我下载的文件名都是:

8-3_3990_16.ts

8-3_3989_17.ts

8-3_3968_18.ts

8-3_3968_19.ts

8-3_3968_X.ts

前面是一个数字串的规则我们不管。一会我们重命名的时候,只要记录尾数的序号。将尾数(16、17、18...存入数组)

3、生成COPY语句,TS文件由升序排列:copy /b 16.ts+17.ts+18.ts+19.ts+20.ts...

4、打开 CMD,复制语句执行。

Private Sub Form_Load() Dim strDir$ Dim strFile$ Dim sPath$: sPath = "E:\迅雷下载\视频任务组__1129\" Dim newPath$: newPath = "E:\迅雷下载\视频任务组__xyb\" Dim fnamelst$ Dim Wjm() As String strDir = Dir("E:\迅雷下载\视频任务组__1129\") Dim firstRedim As Boolean Do If InStr(strDir, ".ts") > 0 Then strFile = strFile & "+" & strDir Dim fname$: fname = Split(strDir, ".")(0) Dim newFname$ newFname$ = Right(fname, Len(fname) - InStrRev(fname, "_")) Name sPath & fname & ".ts" As newPath & newFname & ".ts" If Not firstRedim Then ReDim Wjm(0): firstRedim = True Else ReDim Preserve Wjm(UBound(Wjm) + 1) End If Wjm(UBound(Wjm)) = newFname fnamelst = fnamelst & newFname & ".ts" & "+" End If strDir = Dir Loop While strDir <> "" Dim i As Integer Dim x As Integer For i = 0 To UBound(Wjm) For x = 0 To UBound(Wjm) If Int(Wjm(x)) > Int(Wjm(i)) Then Dim tmp$: tmp = Wjm(i) Wjm(i) = Wjm(x) Wjm(x) = tmp End If Next Next i = 0 fnamelst = "" x = 0 For i = 0 To UBound(Wjm) fnamelst = fnamelst & Wjm(i) & ".ts" & "+" If i Mod 110 = 0 And i > 0 Then Debug.Print "copy /b " & Left(fnamelst, Len(fnamelst) - 1) & " new" & x & ".ts" fnamelst = "" x = x + 1 End If Next End Sub 
讯享网

小讯
上一篇 2025-01-07 08:28
下一篇 2025-03-09 22:30

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/68056.html