diff --git a/README.md b/README.md index 1faf116..e7abe05 100644 --- a/README.md +++ b/README.md @@ -76,18 +76,18 @@ The bot configuration is very easy thanks to the different configuration menus i ### From release -1. Download and install [Java](https://java.com/fr/download/) (needed for Selenium webdriver) and add it to your path (on Windows) +1. Download and install [Java](https://java.com/fr/download/) and [Java JDK](https://www.oracle.com/fr/java/technologies/javase-jdk15-downloads.html) (needed for Selenium webdriver) and add them to your path (on Windows) 2. Download [lastest release](https://github.com/hbollon/igopher/releases/latest) executable for your operating system 3. Move the executable to a dedicated folder (it will create folders/files) 4. Launch it: - On Windows, open a **Windows Terminal** in the folder (or powershell/cmd but the experience quality can be lower) and execute it: ```./tui.exe``` or just drag and drop tui.exe in your command prompt -- On Linux, open you favorite shell in the folder and execute it: ```./tui``` +- On Linux or MacOS, open you favorite shell in the folder, allow it to be executed with ```chmod +x ./tui``` and launch it: ```./tui``` 5. Configure the bot with your Instagram credentials and set your desired scrapping and autodm settings. To do that, you can use the TUI settings screen or directly edit the config.yaml file. 6. You're ready! Just hit the "Launch" option in the TUI main menu 🚀 ### From sources -1. Download and install [Java](https://java.com/fr/download/) (needed for Selenium webdriver) and add it to your path (on Windows) +1. Download and install [Java](https://java.com/fr/download/) and [Java JDK](https://www.oracle.com/fr/java/technologies/javase-jdk15-downloads.html) (needed for Selenium webdriver) and add them to your path (on Windows) 2. Install [Go](https://golang.org/doc/install) (v1.13+) on your system 3. Download [lastest release](https://github.com/hbollon/igopher/releases/latest) source archive or clone the master branch 4. Launch it with this command: ```go run ./cmd/igopher/tui``` diff --git a/dependencies.go b/dependencies.go index 14cb9bc..99e93b6 100644 --- a/dependencies.go +++ b/dependencies.go @@ -45,6 +45,7 @@ const ( desiredFirefoxVersion = "68.0.1" windowsOs = "windows" + macOs = "darwin" ) type file struct { @@ -83,6 +84,14 @@ var ( os: windowsOs, compressed: true, }, + { + url: "https://saucelabs.com/downloads/sc-4.6.3-osx.zip", + name: "sauce-connect.zip", + path: downloadDirectory + "sauce-connect.zip", + rename: []string{downloadDirectory + "sc-4.6.3-osx", downloadDirectory + "sauce-connect"}, + os: macOs, + compressed: true, + }, } downloadDirectory = filepath.FromSlash("./lib/") @@ -147,6 +156,14 @@ func addChrome(ctx context.Context, latestChromeBuild string) error { chromeDriverTargetFilename = "chromedriver.zip" downloadDriverPath = filepath.FromSlash("chromedriver_win32/chromedriver.exe") targetDriverPath = "chromedriver.exe" + } else if runtime.GOOS == macOs { + prefixOS = "Mac" + lastChangeFile = "Mac/LAST_CHANGE" + chromeFilename = "chrome-mac.zip" + chromeDriverFilename = "chromedriver_mac64.zip" + chromeDriverTargetFilename = "chromedriver.zip" + downloadDriverPath = filepath.FromSlash("chromedriver_mac64/chromedriver") + targetDriverPath = "chromedriver" } else { prefixOS = "Linux_x64" lastChangeFile = "Linux_x64/LAST_CHANGE" @@ -283,6 +300,10 @@ func DownloadDependencies(downloadBrowsers, downloadLatest, forceDl bool) { if err := addLatestGithubRelease(ctx, "mozilla", "geckodriver", "geckodriver-.*win64.zip", "geckodriver.zip", true); err != nil { log.Errorf("Unable to find the latest Geckodriver: %s", err) } + } else if runtime.GOOS == macOs { + if err := addLatestGithubRelease(ctx, "mozilla", "geckodriver", "geckodriver-.*macos.tar.gz", "geckodriver.tar.gz", true); err != nil { + log.Errorf("Unable to find the latest Geckodriver: %s", err) + } } else { if err := addLatestGithubRelease(ctx, "mozilla", "geckodriver", "geckodriver-.*linux64.tar.gz", "geckodriver.tar.gz", true); err != nil { log.Errorf("Unable to find the latest Geckodriver: %s", err) diff --git a/engine.go b/engine.go index 2b27550..ba2be17 100644 --- a/engine.go +++ b/engine.go @@ -31,6 +31,10 @@ func init() { geckoDriverPath = filepath.FromSlash("./lib/geckodriver.exe") chromeDriverPath = filepath.FromSlash("./lib/chromedriver.exe") chromePath = filepath.FromSlash("./lib/chrome-win/chrome.exe") + } else if runtime.GOOS == "darwin" { + geckoDriverPath = filepath.FromSlash("./lib/geckodriver") + chromeDriverPath = filepath.FromSlash("./lib/chromedriver") + chromePath = filepath.FromSlash("./lib/chrome-mac/Chromium.app/Contents/MacOS/Chromium") } else { geckoDriverPath = filepath.FromSlash("./lib/geckodriver") chromeDriverPath = filepath.FromSlash("./lib/chromedriver") diff --git a/utils.go b/utils.go index c00c019..b5c3cf1 100644 --- a/utils.go +++ b/utils.go @@ -33,6 +33,7 @@ func init() { cmd.Stdout = os.Stdout cmd.Run() } + clear["darwin"] = clear["linux"] } // Sleep random time between default sleepMin and sleepMax