diff --git a/go.mod b/go.mod index 6705d08..f08c313 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect github.com/kr/pretty v0.1.0 // indirect github.com/lbryio/errors.go v0.0.0-20180223142025-ad03d3cc6a5c - github.com/lbryio/lbry.go v1.0.2 + github.com/lbryio/lbry.go v1.0.6 github.com/lusis/slack-test v0.0.0-20190408224659-6cf59653add2 // indirect github.com/mitchellh/go-ps v0.0.0-20170309133038-4fdf99ab2936 github.com/mitchellh/mapstructure v1.1.2 // indirect @@ -34,7 +34,6 @@ require ( golang.org/x/crypto v0.0.0-20190418165655-df01cb2cc480 // indirect golang.org/x/net v0.0.0-20190415214537-1da14a5a36f2 // indirect golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a // indirect - golang.org/x/sys v0.0.0-20190418153312-f0ce4c0180be // indirect google.golang.org/api v0.3.2 google.golang.org/appengine v1.5.0 // indirect google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7 // indirect diff --git a/go.sum b/go.sum index 63087a0..bdfd81c 100644 --- a/go.sum +++ b/go.sum @@ -127,8 +127,8 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/lbryio/errors.go v0.0.0-20180223142025-ad03d3cc6a5c h1:BhdcWGsuKif/XoSZnqVGNqJ1iEmH0czWR5upj+AuR8M= github.com/lbryio/errors.go v0.0.0-20180223142025-ad03d3cc6a5c/go.mod h1:muH7wpUqE8hRA3OrYYosw9+Sl681BF9cwcjzE+OCNK8= -github.com/lbryio/lbry.go v1.0.2 h1:AXxH7eLT+9VKlsFP4FhLsJoVoJpT99P4dIvO93KtWWM= -github.com/lbryio/lbry.go v1.0.2/go.mod h1:vYXbDnRvMXcK67i8p8DjXV52uXp5jqYByBdywQ6QHIY= +github.com/lbryio/lbry.go v1.0.6 h1:dGZHwYdD5bb7PCOhG2ksJuvhOjqIARAcXJGggaOhC6o= +github.com/lbryio/lbry.go v1.0.6/go.mod h1:JtyI30bU51rm0LZ/po3mQuzf++14OWb6kR/6mMRAmKU= github.com/lbryio/lbryschema.go v0.0.0-20190428231007-c54836bca002 h1:urfYK5ElpUrAv90auPLldoVC60LwiGAcY0OE6HJB9KI= github.com/lbryio/lbryschema.go v0.0.0-20190428231007-c54836bca002/go.mod h1:dAzPCBj3CKKWBGYBZxK6tKBP5SCgY2tqd9SnQd/OyKo= github.com/lbryio/ozzo-validation v0.0.0-20170323141101-d1008ad1fd04/go.mod h1:fbG/dzobG8r95KzMwckXiLMHfFjZaBRQqC9hPs2XAQ4= @@ -185,7 +185,6 @@ github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAm github.com/shopspring/decimal v0.0.0-20180607144847-19e3cb6c2930/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24 h1:pntxY8Ary0t43dCZ5dqY4YTJCObLY1kIXl0uzMv+7DE= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= -github.com/sirupsen/logrus v0.0.0-20180523074243-ea8897e79973/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= @@ -214,7 +213,6 @@ go.opencensus.io v0.20.2 h1:NAfh7zF0/3/HqtMvJNZ/RFrSlCE6ZTlHmKfhL/Dm1Jk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20180608092829-8ac0e0d97ce4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190418165655-df01cb2cc480 h1:O5YqonU5IWby+w98jVUG9h7zlCWCcH4RHyPVReBmhzk= @@ -252,8 +250,8 @@ golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190418153312-f0ce4c0180be h1:mI+jhqkn68ybP0ORJqunXn+fq+Eeb4hHKqLQcFICjAc= -golang.org/x/sys v0.0.0-20190418153312-f0ce4c0180be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190520201301-c432e742b0af h1:NXfmMfXz6JqGfG3ikSxcz2N93j6DgScr19Oo2uwFu88= +golang.org/x/sys v0.0.0-20190520201301-c432e742b0af/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 h1:z99zHgr7hKfrUcX/KsoJk5FJfjTceCKIp96+biqP4To= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -282,7 +280,6 @@ google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3 google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0 h1:DlsSIrgEBuZAUFJcta2B5i/lzeHHbnfkNFAfFXLVFYQ= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= -gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -290,7 +287,6 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/ini.v1 v1.41.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.42.0 h1:7N3gPTt50s8GuLortA00n8AqRTk75qOP98+mTPpgzRk= gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= diff --git a/sources/youtubeVideo.go b/sources/youtubeVideo.go index 773c6b0..6988e9c 100644 --- a/sources/youtubeVideo.go +++ b/sources/youtubeVideo.go @@ -2,8 +2,10 @@ package sources import ( "fmt" + "io/ioutil" "math" "os" + "os/exec" "regexp" "strconv" "strings" @@ -15,6 +17,7 @@ import ( "github.com/lbryio/ytsync/namer" "github.com/lbryio/ytsync/sdk" + "github.com/lbryio/ytsync/tagsManager" "github.com/lbryio/ytsync/thumbs" "github.com/ChannelMeter/iso8601duration" @@ -151,6 +154,21 @@ func (v *YoutubeVideo) getAbbrevDescription() string { return strings.Join(strings.Split(description, "\n")[:maxLines], "\n") + "\n..." } +func (v *YoutubeVideo) fallbackDownload() error { + cmd := exec.Command("youtube-dl", + "--id "+v.ID(), + "--no-progress", + "-f \"bestvideo[ext=mp4,height<=1080,filesize<1000M]+bestaudio/best[ext=mp4,height<=1080,filesize<1000M]\"", + "-o "+strings.TrimRight(v.getFullPath(), ".mp4")) + log.Printf("Running command and waiting for it to finish...") + err := cmd.Run() + if err != nil { + log.Printf("Command finished with error: %v", err) + return errors.Err(err) + } + return nil +} + func (v *YoutubeVideo) download() error { videoPath := v.getFullPath() @@ -237,15 +255,40 @@ func (v *YoutubeVideo) download() error { func (v *YoutubeVideo) videoDir() string { return v.dir + "/" + v.id } - -func (v *YoutubeVideo) delete() error { - videoPath := v.getFullPath() - err := os.Remove(videoPath) +func (v *YoutubeVideo) getDownloadedPath() (string, error) { + files, err := ioutil.ReadDir(v.videoDir()) if err != nil { - log.Errorln(errors.Prefix("delete error", err)) + err = errors.Prefix("list error", err) + log.Errorln(err) + return "", err + } + + for _, f := range files { + if f.IsDir() { + continue + } + if strings.Contains(v.getFullPath(), f.Name()) { + return v.videoDir() + "/" + f.Name(), nil + } + } + return "", errors.Err("could not find any downloaded videos") + +} +func (v *YoutubeVideo) delete() error { + videoPath, err := v.getDownloadedPath() + if err != nil { + log.Errorln(err) return err } - log.Debugln(v.id + " deleted from disk (" + videoPath + ")") + err = os.Remove(videoPath) + log.Debugf("%s deleted from disk (%s)", v.id, videoPath) + + if err != nil { + err = errors.Prefix("delete error", err) + log.Errorln(err) + return err + } + return nil } @@ -273,8 +316,11 @@ func (v *YoutubeVideo) publish(daemon *jsonrpc.Client, claimAddress string, amou ReleaseTime: util.PtrToInt64(v.publishedAt.Unix()), ChannelID: &v.lbryChannelID, } - - return publishAndRetryExistingNames(daemon, v.title, v.getFullPath(), amount, options, namer) + downloadPath, err := v.getDownloadedPath() + if err != nil { + return nil, err + } + return publishAndRetryExistingNames(daemon, v.title, downloadPath, amount, options, namer) } func (v *YoutubeVideo) Size() *int64 { @@ -304,7 +350,12 @@ func (v *YoutubeVideo) Sync(daemon *jsonrpc.Client, params SyncParams, existingV func (v *YoutubeVideo) downloadAndPublish(daemon *jsonrpc.Client, params SyncParams) (*SyncSummary, error) { err := v.download() if err != nil { - return nil, errors.Prefix("download error", err) + log.Errorf("standard downloader failed: %s. Trying fallback downloader\n", err.Error()) + fallBackErr := v.fallbackDownload() + if fallBackErr != nil { + log.Errorf("fallback downloader failed: %s\n", err.Error()) + return nil, errors.Prefix("download error", err) //return original error + } } log.Debugln("Downloaded " + v.id) @@ -335,6 +386,7 @@ func (v *YoutubeVideo) getMetadata() (languages []string, locations []jsonrpc.Lo }} } tags = append([]string{youtubeCategories[v.youtubeInfo.Snippet.CategoryId]}, v.youtubeInfo.Snippet.Tags...) + tags = tagsManager.SanitizeTags(tags) return languages, locations, tags } diff --git a/tagsManager/tags_mapping.go b/tagsManager/tags_mapping.go new file mode 100644 index 0000000..de6595b --- /dev/null +++ b/tagsManager/tags_mapping.go @@ -0,0 +1,818 @@ +package tagsManager + +const ( + Gaming = "gaming" + Blockchain = "blockchain" + News = "news" + Learning = "learning" + Funny = "funny" + Technology = "technology" + Automotive = "automotive" + Economics = "economics" + Sports = "sports" + Food = "food" + Science = "science" + Fitness = "fitness" + Art = "art" + Nature = "nature" +) + +func SanitizeTags(tags []string) []string { + ts := &tagsSanitizer{ + Unsanitized: tags, + } + ts.init() + ts.cleanup() + ts.replace() + ts.add() + + sanitizedTags := make([]string, len(ts.Sanitized)) + index := 0 + for t := range ts.Sanitized { + sanitizedTags[index] = t + index++ + } + return sanitizedTags +} + +type tagsSanitizer struct { + Unsanitized []string + Sanitized map[string]bool +} + +func (ts *tagsSanitizer) init() { + if len(ts.Sanitized) == 0 { + ts.Sanitized = make(map[string]bool, len(ts.Unsanitized)+14) + } +} + +func (ts *tagsSanitizer) cleanup() { + for _, t := range ts.Unsanitized { + _, ok := tagsToSkip[t] + if !ok { + ts.Sanitized[t] = true + } + } +} + +func (ts *tagsSanitizer) replace() { + for _, t := range ts.Unsanitized { + match, filterMatch := mapAndReplace[t] + if filterMatch { + delete(ts.Sanitized, t) + ts.Sanitized[match] = true + } + } +} + +func (ts *tagsSanitizer) add() { + for _, t := range ts.Unsanitized { + match, filterMatch := mapAndKeep[t] + if filterMatch { + ts.Sanitized[match] = true + ts.Sanitized[t] = true + } + } +} + +var tagsToSkip = map[string]*struct{}{ + "video": nil, + "review": nil, + "youtube": nil, + "david packman": nil, + "2018": nil, + "new": nil, + "the": nil, + "music": nil, + "hd": nil, + "talk": nil, + "entertainment": nil, + "Radio": nil, + "2017": nil, + "live": nil, + "free": nil, + "america": nil, + "of": nil, + "david pakman": nil, + "dave pacman": nil, + "pakman": nil, + "davidpakman.com": nil, + "tdps": nil, + "1080p": nil, + "united": nil, + "david pakman show": nil, + "states": nil, + "europe": nil, + "tomonews": nil, + "Tomonews": nil, + "2016": nil, + "eeuu": nil, + "REVIEW": nil, + "Launch": nil, + "taiwanese animators": nil, + "best": nil, + "TURBO": nil, + "television": nil, + "gt": nil, + "USA": nil, + "GPS": nil, + "PREMIERE": nil, + "guide": nil, + "scoope": nil, + "US": nil, + "nma": nil, + "Nma": nil, + "to": nil, + "auto imagen": nil, + "tips": nil, + "action": nil, + "download": nil, + "david pacman": nil, + "taiwanese animation": nil, + "Taiwanese animation": nil, + "YouTube Editor": nil, + "Tomo news": nil, + "replay": nil, + "update": nil, + "battle": nil, + "2019": nil, + "story": nil, + "one": nil, + "spreaker": nil, + "Jay's": nil, + "episode": nil, + "for": nil, + "SHAREfactory™": nil, + "#hangoutsonair": nil, + "#hoa": nil, + "vs": nil, + "bob": nil, + "dnb portal": nil, + "instagram": nil, + "challenge": nil, + "eatmydiction1": nil, + "usa": nil, + "français": nil, + "live stream": nil, + "top": nil, + "fr": nil, + "fanta": nil, + "HD": nil, + "and": nil, + "foto": nil, + "no": nil, + "720p": nil, + "up": nil, + "radio": nil, + "david": nil, + "russia": nil, + "ytquality=high": nil, + "part": nil, + "bollywood tashan": nil, + "bounty": nil, + "dnb": nil, + "highlights": nil, + "thefantasio974": nil, + "great": nil, + "man": nil, + "replica": nil, + "red": nil, + "chiara ferragni": nil, + "in": nil, + "bob lennon": nil, + "series": nil, + "life": nil, + "first": nil, + "dnbportal": nil, + "fantabobgames": nil, + "segui": nil, + "lennon": nil, + "neurofunk": nil, + "on": nil, + "kag3": nil, + "2015": nil, + "ITA": nil, + "gamerworf": nil, + "chickens": nil, + "uct-wqktykk1_70u4bb4k4lq": nil, + "beard": nil, + "videos": nil, + "nidge": nil, + "bill still": nil, + "nickatnyte": nil, + "прохождение": nil, + "minimal": nil, + "clash": nil, + "trofeo": nil, + "attack": nil, + "test": nil, + "DFX": nil, + "india": nil, + "police": nil, + "campaign": nil, + "tricks": nil, + "depression": nil, + "unique": nil, + "Bharat": nil, + "imagen": nil, + "LanceScurv": nil, + "us": nil, + "google": nil, + "defense": nil, + "gameplay fr": nil, + "giveaway": nil, + "hot": nil, + "Interior": nil, + "show": nil, + "YouTube Capture": nil, + "jump": nil, + "2014": nil, + "thailand": nil, + "santa": nil, + "ultimate": nil, + "deutsch": nil, + "mission": nil, + "The Lancescurv Show": nil, + "Legends": nil, + "modi": nil, + "noise": nil, + "Texas": nil, + "china": nil, + "Scurv": nil, + "gift": nil, + "sikh": nil, + "night": nil, + "Episode": nil, + "good": nil, + "plus": nil, + "szekelyvegan": nil, + "székelyvegán": nil, + "szekely": nil, + "игра": nil, + "is": nil, + "székely vegán": nil, + "john sonmez": nil, + "jew": nil, + "magyar vlogger": nil, + "magyar vlog": nil, + "hungarian vlog": nil, + "baba": nil, + "montage": nil, + "New": nil, + "squad": nil, + "german": nil, + "amerika": nil, + "full": nil, + "sri": nil, + "kristomaster4": nil, + "narendra": nil, + "sant": nil, + "adityanath": nil, + "sadhguru": nil, + "ped": nil, + "Sadhu": nil, + "Shyam": nil, + "dharm": nil, + "babas": nil, + "gaay": nil, + "Pradesh": nil, + "Raebareli": nil, + "waale": nil, + "Uttar": nil, + "Bandar": nil, + "kutta": nil, + "bakri": nil, + "aughad": nil, + "suar": nil, + "jaanwar": nil, + "tona": nil, + "bhawreshwara": nil, + "vaanar": nil, + "bhagwa": nil, + "prakriti": nil, + "samaj": nil, + "totka": nil, + "bhoj": nil, + "dave": nil, + "vulcanhdgaming": nil, + "fast": nil, + "moon": nil, + "scene": nil, + "tv": nil, + "2": nil, + "fighter": nil, + "NEW": nil, + "jeux": nil, + "игры": nil, + "tanyázás": nil, + "obiettivo": nil, + "csgo": nil, + "The guy From Pittsburgh": nil, + "blue": nil, + "youtuber": nil, + "clash royale": nil, + "SHOW": nil, + "johnsp69": nil, + "japan": nil, + "YouTube": nil, + "The David Pakman Show": nil, + "thecreativeone": nil, + "Youtube": nil, + "classic": nil, + "Talk Radio": nil, + "white": nil, + "летсплей": nil, + "clash of clans": nil, + "Industry (Organization Sector)": nil, + "difranco": nil, + "custom": nil, + "прохождение игры": nil, + "progressive podcast": nil, + "george Senda": nil, + "360": nil, + "betv": nil, + "gamingoncaffeine": nil, + "Drive": nil, + "Africa": nil, + "progressive news": nil, + "full hd": nil, + "Asia": nil, + "liberal news": nil, + "packman": nil, + "hdtv": nil, + "Entertainment": nil, + "Simple Programmer": nil, + "indonesia": nil, + "karmakut": nil, + "gorthemoviegod": nil, + "Lance scurvin": nil, + "silver": nil, + "clans": nil, + "игры для мальчиков": nil, + "игры для девочек": nil, + "blackpeace72": nil, + "multicolored": nil, + "intro": nil, + "creative beard": nil, + "cyber locks": nil, + "uniqornaments": nil, + "daily holidays": nil, + "daily celebration": nil, + "holiday everyday": nil, + "3d": nil, + "lp": nil, + "interview": nil, + "Heroes": nil, + "maskedmage": nil, + "рпг": nil, + "north": nil, + "road": nil, + "monster": nil, + "de": nil, + "mode": nil, + "podcastradio": nil, + "Man": nil, + "preview": nil, + "rage": nil, + "map": nil, + "Pittsburgh pa": nil, + "david di franco": nil, + "win": nil, + "junior senior": nil, + "demo": nil, + "paul": nil, + "simpleprogrammer.com": nil, + "2013": nil, + "green": nil, + "la": nil, + "london": nil, + "adam": nil, + "jnrsnrgaming": nil, + "jnrsnr": nil, + "TRUE": nil, + "junior senior gaming": nil, + "the kag3 gaming": nil, + "sonny daniel": nil, + "atlanta": nil, + "wordofgod": nil, + "2012": nil, + "Katrina kaif": nil, + "English": nil, + "Addon": nil, + "High": nil, + "To": nil, + "willie": nil, + "it": nil, + "trolling": nil, + "Bollywood news": nil, + "willie pelissier": nil, + "canada": nil, + "productions": nil, + "iMovie": nil, + "channel": nil, + "total": nil, + "trick": nil, + "the kag3": nil, + "Scurvin": nil, + "Free": nil, + "make": nil, + "The": nil, + "ops": nil, + "trevor": nil, + "kevin": nil, + "life is strange": nil, + "you": nil, + "kokesh": nil, + "the brotherhood of gaming": nil, + "Martinez ca": nil, + "real": nil, + "เกม": nil, + "sonny daniel vlogs": nil, + "China": nil, + "African American": nil, + "Slime": nil, + "America": nil, + "price": nil, + "michigan": nil, + "call": nil, + "truetotalempireinc": nil, + "Akshay Kumar": nil, + "Shield": nil, + "aventure": nil, + "until dawn": nil, + "camera": nil, + "florida": nil, + "with": nil, + "battlefield": nil, + "joe": nil, + "tom": nil, + "Atmospheric": nil, + "squad ops": nil, + "overview": nil, + "fist": nil, + "clan": nil, + "guy": nil, + "sonnydaniel": nil, + "Voice Over": nil, + "Test": nil, + "HouseParty": nil, + "ending": nil, + "my": nil, + "garena": nil, + "kag3 entertainment": nil, + "{5859dfec-026f-46ba-bea0-02bf43aa1a6f}": nil, + "shahrukh Khan": nil, + "Opening": nil, + "erik": nil, + "part 1": nil, + "UK": nil, + "dean": nil, + "hcg": nil, + "4k": nil, + "cheat": nil, +} +var mapAndReplace = map[string]string{ + "nfl": Sports, + "Minecraft (Award-Winning Work)": Gaming, + "minecraft survival": Gaming, + "modded minecraft": Gaming, + "minecraft movie": Gaming, + "minecraft videos": Gaming, +} + +var mapAndKeep = map[string]string{ + "gameplay": Gaming, + "games": Gaming, + "News": News, + "game": Gaming, + "politics": News, + "PlayStation 4": Gaming, + "Sony Interactive Entertainment": Gaming, + "walkthrough": Gaming, + "pc": Technology, + "playthrough": Gaming, + "#PS4Live": Gaming, + "let's play": Gaming, + "democrat": News, + "liberal": News, + "progressive": News, + "government": News, + "play": Gaming, + "republican": News, + "conservative": News, + "commentary": News, + "political": News, + "CNN": News, + "tutorial": Learning, + "cbs": News, + "lets play": Gaming, + "MSNBC": News, + "bitcoin": Blockchain, + "minecraft": Gaming, + "twitch": Gaming, + "Video Game (Industry)": Gaming, + "ps4": Gaming, + "#PS4share": Gaming, + "how to": Learning, + "Fox news": News, + "fox": News, + "xbox": Gaming, + "nbc": News, + "Gaming": Gaming, + "comedy": Funny, + "video game": Gaming, + "car": Automotive, + "Education": Learning, + "POLITICS": News, + "Educational": Learning, + "cryptocurrency": Blockchain, + "News & Politics": News, + "fun": Funny, + "playstation": Gaming, + "CARS": Automotive, + "xbox one": Gaming, + "senate": News, + "steam": Gaming, + "4x4": Automotive, + "AUTOMOBILE": Automotive, + "fortnite": Gaming, + "autos": Automotive, + "Sport": Sports, + "crypto": Blockchain, + "Carros": Automotive, + "ethereum": Blockchain, + "Suv": Automotive, + "playstation 4": Gaming, + "TRUCK": Automotive, + "video games": Gaming, + "Funny": Funny, + "Garage": Automotive, + "congress": News, + "lets": Gaming, + "nintendo": Gaming, + "ps3": Gaming, + "auto": Automotive, + "house of representatives": News, + "fps": Gaming, + "rpg": Gaming, + "btc": Blockchain, + "video game (industry)": Gaming, + "multiplayer": Gaming, + "video news": News, + "animated news": News, + "android": Technology, + "computer": Technology, + "how": Learning, + "let's": Gaming, + "donald trump": News, + "Fortnite": Gaming, + "COMO": News, + "online": Technology, + "TRUMP": News, + "mods": Technology, + "tech": Technology, + "hilarious": Funny, + "dota 2": Gaming, + "crash": Automotive, + "PUTIN": News, + "dance": Art, + "money": Economics, + "news radio": News, + "lol": Funny, + "xbox 360": Gaming, + "SALMAN KHAN": Learning, + "airdrop": Blockchain, + "litecoin": Blockchain, + "Sony Computer Entertainment": Gaming, + "pc games": Gaming, + "eth": Blockchain, + "mining": Blockchain, + "ios": Technology, + "linux": Technology, + "sony": Technology, + "space": Nature, + "iphone": Technology, + "education": Learning, + "Gamer": Gaming, + "bitcoin news": Blockchain, + "call of duty": Gaming, + "pokemon": Gaming, + "League": Gaming, + "Let's Play": Gaming, + "Let's": Gaming, + "league of legends": Gaming, + "League Of Legends (Video Game)": Gaming, + "economy": Economics, + "cod": Gaming, + "ico": Blockchain, + "pubg": Gaming, + "gold": Economics, + "Xbox": Gaming, + "pvp": Gaming, + "videogame": Gaming, + "vegan": Food, + "dota": Gaming, + "Games": Gaming, + "let's play fr": Gaming, + "satire": Funny, + "mario": Gaming, + "pc game": Gaming, + "help": Learning, + "PS4": Gaming, + "crypto news": Blockchain, + "humor": Funny, + "let": Gaming, + "fallout 4": Gaming, + "Shooter Game (Media Genre)": Gaming, + "funny moments": Funny, + "Comedy": Funny, + "Playthrough": Gaming, + "gamer": Gaming, + "wii": Gaming, + "playing": Gaming, + "PC": Technology, + "computer game games": Gaming, + "Gameplay": Gaming, + "arcade": Gaming, + "token": Blockchain, + "federal reserve": Economics, + "Video Game Culture": Gaming, + "driving": Automotive, + "plants": Nature, + "trees": Nature, + "eggs": Nature, + "Xbox 360 (Video Game Platform)": Gaming, + "RPG": Gaming, + "design": Art, + "market": Economics, + "cars": Automotive, + "fruits": Food, + "flowers": Nature, + "ram": Technology, + "lessons": Learning, + "token free": Blockchain, + "vegán": Food, + "Game": Gaming, + "investing": Economics, + "samsung": Technology, + "racing": Sports, + "online learning": Learning, + "dollar": Economics, + "software": Technology, + "beach": Nature, + "gta": Gaming, + "windows": Technology, + "let’s play": Gaming, + "Minecraft": Gaming, + "race": Automotive, + "skyrim": Gaming, + "rainbow": Nature, + "health": Fitness, + "Action-adventure Game (Media Genre)": Gaming, + "programming": Technology, + "sony interactive entertainment": Gaming, + "dlc": Gaming, + "diy": Learning, + "bitcoin price": Blockchain, + "monetary reform": Economics, + "xbox360": Gaming, + "zelda": Gaming, + "Steam": Gaming, + "capcom": Gaming, + "economic": Economics, + "simulation": Technology, + "recession": Economics, + "fortnite battle royale": Gaming, + "altcoins": Blockchain, + "facebook": Technology, + "cryptocurrency news": Blockchain, + "singleplayer": Gaming, + "altcoin": Blockchain, + "pacman": Gaming, + "fashion": Art, + "gta 5": Gaming, + "Grand Theft Auto V": Gaming, + "valve": Gaming, + "Massively Multiplayer Online Role-playing Game (Video Game Genre)": Gaming, + "#gaming": Gaming, + "Bmw": Automotive, + "halo": Gaming, + "Hillary Clinton": News, + "trading": Economics, + "computer games": Gaming, + "vehicle": Automotive, + "desktop": Technology, + "coin": Blockchain, + "water": Nature, + "nintendo switch": Gaming, + "progressive talk": News, + "3d games": Gaming, + "animals": Nature, + "install": Technology, + "MOBA": Gaming, + "Ps2": Gaming, + "Role-playing Video Game (Media Genre)": Gaming, + "trump": News, + "ripple": Blockchain, + "parody": Funny, + "supercell": Gaming, + "dota2": Gaming, + "microsoft": Technology, + "sims": Gaming, + "barack obama": News, + "funny video": Funny, + "finance": Economics, + "floral": Nature, + "creative hairstyles": Art, + "food holidays": Food, + "colorful hair": Art, + "currency": Economics, + "free bitcoin": Blockchain, + "how-to": Learning, + "pc gaming": Gaming, + "Playstation 4": Gaming, + "twitter": Technology, + "battle royale": Gaming, + "rpg games": Gaming, + "sims 4": Gaming, + "Android": Technology, + "Benz": Automotive, + "silly": Funny, + "roblox": Gaming, + "Mw3": Gaming, + "humour": Funny, + "far cry 5": Gaming, + "Mobile": Technology, + "squad gameplay": Gaming, + "tf2": Gaming, + "Auto Show (Event)": Automotive, + "business": Economics, + "apple": Technology, + "Ps3": Gaming, + "Resident Evil": Gaming, + "iOS": Technology, + "Mercedes": Automotive, + "engine": Automotive, + "indie game": Gaming, + "overwatch": Gaming, + "brawl": Gaming, + "ltc": Blockchain, + "Call of Duty®: Black Ops III": Gaming, + "Donald Trump": News, + "dash": Blockchain, + "newscast": News, + "server": Technology, + "gardening": Nature, + "console": Gaming, + "mugen": Gaming, + "Play": Gaming, + "Nvidia": Technology, + "cool long hair": Art, + "howto": Learning, + "Mass effect": Gaming, + "mercedes": Automotive, + "ubisoft": Gaming, + "open source": Technology, + "Minecraft: PlayStation®4 Edition": Gaming, + "rts": Gaming, + "mmorpg": Gaming, + "first person shooter": Gaming, + "eos": Blockchain, + "motorcycle": Automotive, + "Action Role-playing Game (Video Game Genre)": Gaming, + "steemit": Blockchain, + "porsche": Automotive, + "sport": Sports, + "training": Sports, + "Apple": Technology, + "coinbase": Blockchain, + "Role-playing Game (Game Genre)": Gaming, + "sonic": Gaming, + "advice": Learning, + "videogames": Gaming, + "Simulator": Gaming, + "level": Gaming, + "apps": Technology, + "sims 3": Gaming, + "Satire": Funny, + "esports": Gaming, + "Minecraft (Video Game)": Gaming, + "simulator": Gaming, + "horrible gamers": Gaming, + "Bus": Automotive, + "moba": Gaming, + "football": Sports, + "cryptocurrencies": Blockchain, + "the game": Gaming, + "laptop": Technology, + "link": Gaming, + "Game Reviews": Gaming, + "sims 5": Gaming, + "snk": Gaming, + "online games": Gaming, + "squad game": Gaming, + "switch": Gaming, + "Lets Play": Gaming, + "racism": News, + "jeep": Automotive, +}