Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow committed Aug 3, 2021
1 parent 8a75a4c commit d025d0d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Examples:
Flags:
--chatid string Telegram channel id.
-c, --config string Configuration file path, defaults: ./wayback.conf, ~/wayback.conf, /etc/wayback.conf
-d, --daemon strings Run as daemon service, supported services are telegram, web, mastodon, twitter, irc
-d, --daemon strings Run as daemon service, supported services are telegram, web, mastodon, twitter, discord, slack, irc
--debug Enable debug mode. (default false)
-h, --help help for wayback
--ia Wayback webpages to Internet Archive.
Expand Down
2 changes: 1 addition & 1 deletion cmd/wayback/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func init() {
rootCmd.Flags().BoolVarP(&is, "is", "", false, "Wayback webpages to Archive Today.")
rootCmd.Flags().BoolVarP(&ip, "ip", "", false, "Wayback webpages to IPFS. (default false)")
rootCmd.Flags().BoolVarP(&ph, "ph", "", false, "Wayback webpages to Telegraph. (default false)")
rootCmd.Flags().StringSliceVarP(&daemon, "daemon", "d", []string{}, "Run as daemon service, supported services are telegram, web, mastodon, twitter, discord, irc")
rootCmd.Flags().StringSliceVarP(&daemon, "daemon", "d", []string{}, "Run as daemon service, supported services are telegram, web, mastodon, twitter, discord, slack, irc")
rootCmd.Flags().StringVarP(&host, "ipfs-host", "", "127.0.0.1", "IPFS daemon host, do not require, unless enable ipfs.")
rootCmd.Flags().UintVarP(&port, "ipfs-port", "p", 5001, "IPFS daemon port.")
rootCmd.Flags().StringVarP(&mode, "ipfs-mode", "m", "pinner", "IPFS mode.")
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ require (
github.com/dghubble/oauth1 v0.7.0
github.com/dustin/go-humanize v1.0.0
github.com/fatih/color v1.12.0
github.com/gabriel-vasile/mimetype v1.3.1
github.com/go-shiori/go-readability v0.0.0-20210627123243-82cc33435520
github.com/go-shiori/obelisk v0.0.0-20201115143556-8de0d40b0a9b // indirect
github.com/google/go-github/v37 v37.0.0
Expand Down
8 changes: 7 additions & 1 deletion reduxer/reduxer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"time"

"github.com/dustin/go-humanize"
"github.com/gabriel-vasile/mimetype"
"github.com/go-shiori/go-readability"
"github.com/iawia002/annie/downloader"
"github.com/iawia002/annie/extractors"
Expand Down Expand Up @@ -383,7 +384,12 @@ func media(ctx context.Context, dir, in string) string {
logger.Warn("file %s not exists", fp)
return ""
}
return v
mtype, _ := mimetype.DetectFile(v)
if strings.HasPrefix(mtype.String(), "video") || strings.HasPrefix(mtype.String(), "audio") {
return v
}

return ""
}

func sortStreams(streams map[string]*types.Stream) []*types.Stream {
Expand Down

0 comments on commit d025d0d

Please sign in to comment.