Skip to content
This repository was archived by the owner on Feb 10, 2023. It is now read-only.

Commit 324ddfc

Browse files
small fix in parsing m3u8 and retuned file path
1 parent cd5c194 commit 324ddfc

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
result.json
2-
F1viewer.exe
2+
*.exe
33
config.json
44
*.m3u8
55
interesting API urls.txt

downloadHandling.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func downloadAsset(url string, title string) string {
2525
//download and patch .m3u8 file
2626
//TODO: switch id to title
2727
downloadM3U8(title+".m3u8", url)
28-
return `./downloaded/` + title + ".m3u8"
28+
return `./downloaded/` + strings.Replace(title, " ", "\x20", -1) + ".m3u8"
2929
}
3030

3131
//returns valid m3u8 URL as string
@@ -116,7 +116,7 @@ func fixm3u8(lines []string, url string, filePath string) {
116116
//fix URLs in m3u8
117117
for _, line := range lines {
118118
if strings.Contains(line, "https") {
119-
} else if len(line) > 6 && (line[:5] == "layer" || line[:4] == "clip") {
119+
} else if len(line) > 6 && (line[:5] == "layer" || line[:4] == "clip" || line[:3] == "OTT") {
120120
line = url + line
121121
} else {
122122
var re = regexp.MustCompile(`[^"]*m3u8"`)

main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,6 @@ func addPlaybackNodes(node *tview.TreeNode, title string, epID string) {
705705
}
706706
}
707707

708-
//TODO launch custom command
709708
playNode := tview.NewTreeNode("Play with MPV")
710709
playNode.SetReference(epID)
711710
node.AddChild(playNode)

0 commit comments

Comments
 (0)