Skip to content
This repository has been archived by the owner on Aug 12, 2020. It is now read-only.

Commit

Permalink
Refactor Format struct
Browse files Browse the repository at this point in the history
  • Loading branch information
corny committed Dec 27, 2019
1 parent 92eff6f commit 6532141
Show file tree
Hide file tree
Showing 9 changed files with 639 additions and 591 deletions.
6 changes: 3 additions & 3 deletions cmd/ytdl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func handler(identifier string, options options) {
fps = format.ValueForKey("fps").(string)
}

data = append(data, []string{strconv.Itoa(format.Itag), format.Extension, format.Resolution, fps, format.VideoEncoding, format.AudioEncoding, strconv.Itoa(format.AudioBitrate)})
data = append(data, []string{strconv.Itoa(format.Itag.Itag), format.Itag.Extension, format.Resolution(), fps, format.Itag.VideoEncoding, format.Itag.AudioEncoding, strconv.Itoa(format.Itag.AudioBitrate)})
}

table := tablewriter.NewWriter(os.Stdout)
Expand Down Expand Up @@ -260,9 +260,9 @@ func handler(identifier string, options options) {
var fileName string
fileName, err = createFileName(options.outputFile, outputFileName{
Title: sanitizeFileNamePart(info.Title),
Ext: sanitizeFileNamePart(format.Extension),
Ext: sanitizeFileNamePart(format.Itag.Extension),
DatePublished: sanitizeFileNamePart(info.DatePublished.Format("2006-01-02")),
Resolution: sanitizeFileNamePart(format.Resolution),
Resolution: sanitizeFileNamePart(format.Resolution()),
Duration: sanitizeFileNamePart(info.Duration.String()),
})
if err != nil {
Expand Down
Loading

0 comments on commit 6532141

Please sign in to comment.