Skip to content

Commit

Permalink
upgrade ua to Chrome v117
Browse files Browse the repository at this point in the history
  • Loading branch information
sagan committed Sep 27, 2023
1 parent d704e64 commit 42c23a4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 16 deletions.
4 changes: 2 additions & 2 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ func QueryTorrents(clientInstance Client, category string, tag string, filter st
isAll := len(hashOrStateFilters) == 0
for _, arg := range hashOrStateFilters {
if !IsValidInfoHashOrStateFilter(arg) {
return nil, fmt.Errorf("%s is not a valid infoHash or stateFilter", arg)
return nil, fmt.Errorf("%s is not a valid infoHash nor stateFilter", arg)
}
if arg == "_all" {
isAll = true
Expand Down Expand Up @@ -517,7 +517,7 @@ func SelectTorrents(clientInstance Client, category string, tag string, filter s
isAll := len(hashOrStateFilters) == 0
for _, arg := range hashOrStateFilters {
if !IsValidInfoHashOrStateFilter(arg) {
return nil, fmt.Errorf("%s is not a valid infoHash or stateFilter", arg)
return nil, fmt.Errorf("%s is not a valid infoHash nor stateFilter", arg)
}
if arg == "_all" {
isAll = true
Expand Down
14 changes: 12 additions & 2 deletions cmd/shell/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,16 @@ var exitCmd = &cobra.Command{
},
}

var exitfCmd = &cobra.Command{
Use: "exitf",
Short: `(shell only) Alias of "exit -f". Exit shell immediately & forcely`,
Args: cobra.MatchAll(cobra.ExactArgs(0), cobra.OnlyValidArgs),
RunE: func(cmd *cobra.Command, args []string) error {
force = true
return exitCmd.RunE(cmd, args)
},
}

var historyCmd = &cobra.Command{
Use: "history",
Short: "(shell only) List history of executed commands in shell",
Expand Down Expand Up @@ -184,7 +194,7 @@ If no args provided, the cache of ALL clients and sites will be purged`,
} else if site.SiteExists(name) {
site.Purge(name)
} else {
log.Errorf("%s is not a client or site", name)
log.Errorf("%s is not a client nor site", name)
errorCnt++
}
}
Expand Down Expand Up @@ -229,7 +239,7 @@ func purgeCmdSuggestion(document *prompt.Document) []prompt.Suggest {
return suggest.ClientArg(info.MatchingPrefix)
}

var shellCommands = []*cobra.Command{pwdCwd, cdCmd, lsCmd, historyCmd, exitCmd, purgeCmd, execCmd}
var shellCommands = []*cobra.Command{pwdCwd, cdCmd, lsCmd, historyCmd, exitCmd, exitfCmd, purgeCmd, execCmd}

var shellCommandSuggestions = map[string](func(document *prompt.Document) []prompt.Suggest){
"cd": cdCmdSuggestion,
Expand Down
31 changes: 19 additions & 12 deletions util/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,25 @@ var (
CHROME_HTTP_REQUEST_HEADERS = map[string]string{
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
// "Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "en-US,en;q=0.9",
"Cache-Control": "max-age=0",
"Connection": "keep-alive",
"sec-ch-ua": `"Chromium";v="116", "Not)A;Brand";v="24", "Google Chrome";v="116"`,
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": `"Windows"`,
"Sec-Fetch-Dest": "document",
"Sec-Fetch-Mode": "navigate",
"Sec-Fetch-Site": "none",
"Sec-Fetch-User": "?1",
"Upgrade-Insecure-Requests": "1",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36",
"Accept-Language": "en-US,en;q=0.9",
"Cache-Control": "max-age=0",
"Connection": "keep-alive",
"Sec-Ch-Ua": `"Google Chrome";v="117", "Not;A=Brand";v="8", "Chromium";v="117"`,
"Sec-Ch-Ua-Arch": `"x86"`,
"Sec-Ch-Ua-Bitness": `"64"`,
"Sec-Ch-Ua-Full-Version": `"117.0.5938.92"`,
"Sec-Ch-Ua-Full-Version-List": `"Google Chrome";v="117.0.5938.92", "Not;A=Brand";v="8.0.0.0", "Chromium";v="117.0.5938.92"`,
"Sec-Ch-Ua-Mobile": `?0`,
"Sec-Ch-Ua-Model": `""`,
"Sec-Ch-Ua-Platform": `"Windows"`,
"Sec-Ch-Ua-Platform-Version": `"15.0.0"`,
"Sec-Ch-Ua-Wow64": `?0`,
"Sec-Fetch-Dest": `document`,
"Sec-Fetch-Mode": `navigate`,
"Sec-Fetch-Site": `same-origin`,
"Sec-Fetch-User": `?1`,
"Upgrade-Insecure-Requests": "1",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36",
}
)

Expand Down

0 comments on commit 42c23a4

Please sign in to comment.