From d71257422c2fee448e3008c2b952ca7a8be68c7c Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Fri, 14 Aug 2015 10:48:40 +0100 Subject: [PATCH 01/16] Using pip to install youtube-dl --- circle.yml | 4 +--- install-dependencies.sh | 9 --------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/circle.yml b/circle.yml index 936fb68..a0c815b 100644 --- a/circle.yml +++ b/circle.yml @@ -7,10 +7,8 @@ machine: dependencies: pre: - - ffmpeg -version - - sudo apt-get remove -y ffmpeg - - ffmpeg -version - bash install-dependencies.sh + - pip install youtube-dl - ffmpeg -version override: diff --git a/install-dependencies.sh b/install-dependencies.sh index 2331fb7..a42e213 100644 --- a/install-dependencies.sh +++ b/install-dependencies.sh @@ -20,13 +20,4 @@ if [ ! -d "$HOME/opus/lib" ]; then cd opus-1.0.3 && ./configure --prefix=$HOME/opus && make && make install else echo 'Using cached version of opus.'; -fi - -# check to see if youtube-dl is installed -if [ ! -f "$HOME/bin/youtube-dl" ]; then - echo 'Installing youtube-dl' - curl https://yt-dl.org/downloads/2015.07.28/youtube-dl -o ~/bin/youtube-dl - chmod a+rx ~/bin/youtube-dl -else - echo 'Using cached version of youtube-dl.'; fi \ No newline at end of file From 9b6956f13d017067a0de456496e4369a14475049 Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Fri, 14 Aug 2015 10:50:56 +0100 Subject: [PATCH 02/16] Giving pip sudo to install youtube-dl --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index a0c815b..62e5a76 100644 --- a/circle.yml +++ b/circle.yml @@ -8,7 +8,7 @@ machine: dependencies: pre: - bash install-dependencies.sh - - pip install youtube-dl + - sudo pip install youtube-dl - ffmpeg -version override: From 536bdbe921948a7bb8b7850ab940a842bb237a22 Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Fri, 14 Aug 2015 10:57:42 +0100 Subject: [PATCH 03/16] Removing old ffmpeg --- circle.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/circle.yml b/circle.yml index 62e5a76..f536fd2 100644 --- a/circle.yml +++ b/circle.yml @@ -7,6 +7,7 @@ machine: dependencies: pre: + - sudo apt-get --qqy remove ffmpeg - bash install-dependencies.sh - sudo pip install youtube-dl - ffmpeg -version From 75bc9502905e5abf3726ab89f655dddff23c109d Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Fri, 14 Aug 2015 10:58:38 +0100 Subject: [PATCH 04/16] Removing old ffmpeg --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index f536fd2..4aad8d7 100644 --- a/circle.yml +++ b/circle.yml @@ -7,7 +7,7 @@ machine: dependencies: pre: - - sudo apt-get --qqy remove ffmpeg + - sudo apt-get -qqy remove ffmpeg - bash install-dependencies.sh - sudo pip install youtube-dl - ffmpeg -version From bcf96af96454aa2ec02ab0330663c8646e4c46bb Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Fri, 14 Aug 2015 11:01:57 +0100 Subject: [PATCH 05/16] Removing old ffmpeg --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 4aad8d7..79b9eaa 100644 --- a/circle.yml +++ b/circle.yml @@ -7,7 +7,7 @@ machine: dependencies: pre: - - sudo apt-get -qqy remove ffmpeg + - sudo apt-get -qqy remove avconv avprobe ffmpeg ffprobe - bash install-dependencies.sh - sudo pip install youtube-dl - ffmpeg -version From 3efcb43ed78027b8b93736e7141ce6fe2d01d2f5 Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Fri, 14 Aug 2015 11:02:55 +0100 Subject: [PATCH 06/16] Removing old ffmpeg --- circle.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index 79b9eaa..9f7cda9 100644 --- a/circle.yml +++ b/circle.yml @@ -7,9 +7,9 @@ machine: dependencies: pre: - - sudo apt-get -qqy remove avconv avprobe ffmpeg ffprobe + - sudo apt-get -qqy remove ffmpeg ffprobe - bash install-dependencies.sh - - sudo pip install youtube-dl + - sudo pip install youtube-dlS - ffmpeg -version override: From c35b95e9f732ddfee8f6fe9edb25d2ba388ab337 Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Fri, 14 Aug 2015 11:04:09 +0100 Subject: [PATCH 07/16] Removing old ffmpeg --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 9f7cda9..190de2c 100644 --- a/circle.yml +++ b/circle.yml @@ -9,7 +9,7 @@ dependencies: pre: - sudo apt-get -qqy remove ffmpeg ffprobe - bash install-dependencies.sh - - sudo pip install youtube-dlS + - sudo pip install youtube-dl - ffmpeg -version override: From 2571d60045ca66edfb928803b18349ca2e37fa48 Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Sat, 15 Aug 2015 15:24:29 +0100 Subject: [PATCH 08/16] Using whereis and type to find ffmpeg location --- circle.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 190de2c..be5177c 100644 --- a/circle.yml +++ b/circle.yml @@ -7,7 +7,9 @@ machine: dependencies: pre: - - sudo apt-get -qqy remove ffmpeg ffprobe + - sudo apt-get remove -y ffmpeg ffprobe + - sudo type ffmpeg + - sudo whereis ffmpeg - bash install-dependencies.sh - sudo pip install youtube-dl - ffmpeg -version From 38bf1e68bae90ee92f4011fd551244b745e3e819 Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Sat, 15 Aug 2015 15:26:11 +0100 Subject: [PATCH 09/16] Using whereis and type to find ffmpeg location --- circle.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/circle.yml b/circle.yml index be5177c..67b4886 100644 --- a/circle.yml +++ b/circle.yml @@ -8,6 +8,7 @@ machine: dependencies: pre: - sudo apt-get remove -y ffmpeg ffprobe + - sudo apt-get install -y type whereis - sudo type ffmpeg - sudo whereis ffmpeg - bash install-dependencies.sh From ac364a95493c4f8a65870b8eabcd4e3cce47d878 Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Sat, 15 Aug 2015 15:27:10 +0100 Subject: [PATCH 10/16] Using whereis and type to find ffmpeg location --- circle.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index 67b4886..54ec01d 100644 --- a/circle.yml +++ b/circle.yml @@ -8,8 +8,7 @@ machine: dependencies: pre: - sudo apt-get remove -y ffmpeg ffprobe - - sudo apt-get install -y type whereis - - sudo type ffmpeg + - sudo apt-get install -y whereis - sudo whereis ffmpeg - bash install-dependencies.sh - sudo pip install youtube-dl From 50d67127b5a63c85824d30b9f0d95d14acf2209d Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Sat, 15 Aug 2015 15:28:37 +0100 Subject: [PATCH 11/16] Using whereis and type to find ffmpeg location --- circle.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/circle.yml b/circle.yml index 54ec01d..65be379 100644 --- a/circle.yml +++ b/circle.yml @@ -8,7 +8,6 @@ machine: dependencies: pre: - sudo apt-get remove -y ffmpeg ffprobe - - sudo apt-get install -y whereis - sudo whereis ffmpeg - bash install-dependencies.sh - sudo pip install youtube-dl From 264087a2484ca098e4dace239d17803749cebe07 Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Sat, 15 Aug 2015 15:32:42 +0100 Subject: [PATCH 12/16] Removing all old ffmpeg locations --- install-dependencies.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/install-dependencies.sh b/install-dependencies.sh index a42e213..074d819 100644 --- a/install-dependencies.sh +++ b/install-dependencies.sh @@ -1,6 +1,11 @@ #!/bin/sh set -e +# removing old ffmpeg +sudo rm -rf /usr/bin/ffmpeg +sudo rm -rf /usr/bin/X11/ffmpeg +sudo rm -rf /usr/share/man/man1/ffmpeg.1.gz + # check to see if ffmpeg is installed if [ ! -f "$HOME/bin/ffmpeg" ]; then echo 'Installing ffmpeg' From 644fe0ac24a5ee3f7f4dde29fe45369ef24247c8 Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Sat, 15 Aug 2015 15:43:56 +0100 Subject: [PATCH 13/16] Cleaned up circleci files --- .travis.yml | 26 -------------------------- circle.yml | 5 ----- install-dependencies.sh | 9 +++++++++ 3 files changed, 9 insertions(+), 31 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index defd123..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: go - -cache: - directories: - - $HOME/opus - - $HOME/bin - - $HOME/gopath/bin - - $HOME/gopath/pkg - - $HOME/gopath/src/github.com/nitrous-io - - $HOME/gopath/src/github.com/MichaelOultram/mumbledj/.vendor - -before_script: - - export PATH=$PATH:$HOME/bin/ - - export LD_RUN_PATH=$LD_RUN_PATH:$HOME/opus/lib - - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/opus/lib - - export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$HOME/opus/lib/pkgconfig - - bash install-dependencies.sh - -script: - - make - - make install - -after_success: - - ffmpeg -version - - youtube-dl --output ~/.mumbledj/songs/QcIy9NiNbmo.m4a --format m4a --prefer-ffmpeg -4 --verbose http://www.youtube.com/watch?v=QcIy9NiNbmo - - mumbledj -server=$MUMBLE_IP -port=$MUMBLE_PORT -username=travis -password=$MUMBLE_PASSWORD -verbose=true -test=true \ No newline at end of file diff --git a/circle.yml b/circle.yml index 65be379..aeeb361 100644 --- a/circle.yml +++ b/circle.yml @@ -7,11 +7,7 @@ machine: dependencies: pre: - - sudo apt-get remove -y ffmpeg ffprobe - - sudo whereis ffmpeg - bash install-dependencies.sh - - sudo pip install youtube-dl - - ffmpeg -version override: - make @@ -27,6 +23,5 @@ dependencies: test: override: - - youtube-dl --output ~/.mumbledj/songs/QcIy9NiNbmo.m4a --format m4a --prefer-ffmpeg -v http://www.youtube.com/watch?v=QcIy9NiNbmo - mumbledj -server=$MUMBLE_IP -port=$MUMBLE_PORT -username=circleci -password=$MUMBLE_PASSWORD -verbose=true -test=true: timeout: 180 \ No newline at end of file diff --git a/install-dependencies.sh b/install-dependencies.sh index 074d819..cb03750 100644 --- a/install-dependencies.sh +++ b/install-dependencies.sh @@ -17,6 +17,15 @@ else echo 'Using cached version of ffmpeg.'; fi +# check to see if youtube-dl is installed +if [ ! -f "$HOME/bin/youtube-dl" ]; then + echo 'Installing youtube-dl' + curl https://yt-dl.org/latest/youtube-dl -o ~/bin/youtube-dl + chmod a+rx ~/bin/youtube-dl +else + echo 'Using cached version of youtube-dl.'; +fi + # check to see if opus is installed if [ ! -d "$HOME/opus/lib" ]; then echo 'Installing opus' From 0383202304ae614dd7f093b2d6c54199d92f58d8 Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Sat, 15 Aug 2015 15:57:55 +0100 Subject: [PATCH 14/16] Getting tests to use dummy client --- test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test.go b/test.go index 2258187..0e203c8 100644 --- a/test.go +++ b/test.go @@ -39,14 +39,14 @@ func (t TestSettings) createClient(uname string) *gumble.Client { } func (t TestSettings) testYoutubeSong() { - // dummyClient := t.createClient("dummy") - // if err := dummyClient.Connect(); err != nil { - // panic(err) - // } + dummyClient := t.createClient("dummy") + if err := dummyClient.Connect(); err != nil { + panic(err) + } dj.client.Request(gumble.RequestUserList) time.Sleep(time.Second * 5) - dummyUser := dj.client.Users.Find("BottleOToast") + dummyUser := dj.client.Users.Find("dummy") if dummyUser == nil { fmt.Printf("User does not exist, printing users\n") for _, user := range dj.client.Users { @@ -76,10 +76,10 @@ func (t TestSettings) testYoutubeSong() { fmt.Printf("For: %s; Expected: %s; Got: %s\n", url, title, dj.queue.CurrentSong().Title()) } - time.Sleep(time.Second * 5) + time.Sleep(time.Second * 10) skip(dummyUser, false, false) } os.Exit(0) - //dummyClient.Disconnect() + dummyClient.Disconnect() } From 4ae3052684dcef95b779612d0ab5dd00f73a07df Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Sat, 15 Aug 2015 16:03:24 +0100 Subject: [PATCH 15/16] Getting tests to use dummy client --- test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test.go b/test.go index 0e203c8..7365005 100644 --- a/test.go +++ b/test.go @@ -28,13 +28,14 @@ func Test(password, ip, port string, accesstokens []string) { } func (t TestSettings) createClient(uname string) *gumble.Client { - client := gumble.NewClient(&gumble.Config{ + config := gumble.Config{ Username: uname, Password: t.password, Address: t.ip + ":" + t.port, Tokens: t.accesstokens, - }) - gumbleutil.CertificateLockFile(client, fmt.Sprintf("%s/.mumbledj/cert.lock", dj.homeDir)) + } + config.TLSConfig.InsecureSkipVerify = true + client := gumble.NewClient(&config) return client } From 2396adfdf3615177af6aea4349b9d6b5cad991ca Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Sat, 15 Aug 2015 16:04:09 +0100 Subject: [PATCH 16/16] Getting tests to use dummy client --- test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/test.go b/test.go index 7365005..4edbe03 100644 --- a/test.go +++ b/test.go @@ -3,7 +3,6 @@ package main import ( "fmt" "github.com/layeh/gumble/gumble" - "github.com/layeh/gumble/gumbleutil" "os" "time" )