panic: strconv.ParseFloat: parsing "1.1.1.1": invalid syntax #7

Closed
opened 2024-03-16 20:24:41 +10:30 by tardisx · 2 comments
tardisx commented 2024-03-16 20:24:41 +10:30 (Migrated from github.com)

2024/03/16 19:47:39 Executing command executable: /home/user/bin/yt-dlp) in /home/user/down
panic: strconv.ParseFloat: parsing "1.1.1.1": invalid syntax

This needs proper error handling:

    percentRE := regexp.MustCompile(`download.+?([\d\.]+)%`)
    matches = percentRE.FindStringSubmatch(s)
    if len(matches) == 2 {
            p, err := strconv.ParseFloat(matches[1], 32)
            if err == nil {
                    dl.Percent = float32(p)
            } else {
                    panic(err)
            }
    }
2024/03/16 19:47:39 Executing command executable: /home/user/bin/yt-dlp) in /home/user/down panic: strconv.ParseFloat: parsing "1.1.1.1": invalid syntax This needs proper error handling: percentRE := regexp.MustCompile(`download.+?([\d\.]+)%`) matches = percentRE.FindStringSubmatch(s) if len(matches) == 2 { p, err := strconv.ParseFloat(matches[1], 32) if err == nil { dl.Percent = float32(p) } else { panic(err) } }
tardisx commented 2024-03-16 20:28:58 +10:30 (Migrated from github.com)

Probably caused by matching on this:

[debug] Invoking hlsnative downloader ...

where the URL on the line includes an IP address.

Probably caused by matching on this: [debug] Invoking hlsnative downloader ... where the URL on the line includes an IP address.
tardisx commented 2024-03-17 09:05:01 +10:30 (Migrated from github.com)

wrong repo

wrong repo
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: justin/linkwallet#7