Skip to content

Commit

Permalink
v 0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
awarebayes committed Nov 24, 2024
1 parent 0a69566 commit 2b245b3
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 11 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/tauri-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
include:
- platform: 'macos-latest' # for Arm based macs (M1 and above).
args: '--target aarch64-apple-darwin'
- platform: 'macos-latest' # for Intel based macs.
args: '--target x86_64-apple-darwin'
- platform: 'ubuntu-22.04' # for Tauri v1 you could replace this with ubuntu-20.04.
args: ''
- platform: 'windows-latest'
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2024 Awarebayes

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Automate your Nexus mod downloads using a botted Google Chrome instance. Support
- 📦 Single self contained binary
- 🖥️ Optional [TUI](https://github.com/awarebayes/wabbaauto/tree/release/src-tauri/cli) w [RataTui](https://ratatui.rs/)


![Modlists](https://private-user-images.githubusercontent.com/42784580/389278785-1364be2c-5ac6-4ac6-a18f-289bb40f4f0c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzI0NTczODQsIm5iZiI6MTczMjQ1NzA4NCwicGF0aCI6Ii80Mjc4NDU4MC8zODkyNzg3ODUtMTM2NGJlMmMtNWFjNi00YWM2LWExOGYtMjg5YmI0MGY0ZjBjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDExMjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMTI0VDE0MDQ0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI4Mjk5MDY3Y2ViZWVjMTgzYmY2NjVmYjVjNzc1YzJjMjU2ZjM0MjBiM2NiZWZkMzNiYjZlYTg0ZjdhYzgzZTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.sUgOudYJsxaXwuHY0R-qWhRi5iWVSuEOkKyOmgRGLQ4)
![Downloading](https://private-user-images.githubusercontent.com/42784580/389278968-8e5e9729-bb5d-46a4-9a3c-4adac2cbc3e6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzI0NTk2NzAsIm5iZiI6MTczMjQ1OTM3MCwicGF0aCI6Ii80Mjc4NDU4MC8zODkyNzg5NjgtOGU1ZTk3MjktYmI1ZC00NmE0LTlhM2MtNGFkYWMyY2JjM2U2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDExMjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMTI0VDE0NDI1MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTc5Yjc1ZjliMDZkZmM2OWFlOGFjNTg5NjA5ZGUyZDVjZWQ5NzAxNGJmOTY1ZDQwM2JjYWVkZDViODU2YjcyNjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.cqNNvzOBATpX-mYVCY-sM3H9WaiaIi7sjqU8a92lvBU)

## 🚀 Quick Start Guide

Expand Down Expand Up @@ -43,16 +44,26 @@ Start-Process "C:\Users\[YourUsername]\Downloads\Chrome\GoogleChromePortable\Goo
Start-Process "C:\Users\[YourUsername]\Downloads\Chrome\GoogleChromePortable\GoogleChromePortable.exe" -ArgumentList "--remote-debugging-port=9222 --headless"
```

Adjust path to match your installation dir if needed.

### 4. Start Downloading

1. Launch Wabba Auto Downloader
2. Select your modlist
3. Begin the download process
4. Verify everything works as expected

### 5. Run Wabbajack

1. Launch wabbajack
2. Select downloaded modlist
3. Choose wabbajack downloads folder to match WabbaAuto downloads folder
4. Wait for wabbajack to complete downloading other files and installing

## 💡 Pro Tips

- Use headless mode for background operation
- Use Non-Headless mode for debugging why something does not work

## 🤝 Contributing

Expand Down
25 changes: 19 additions & 6 deletions src-tauri/lib-wabbaauto/src/downloader/headless/headless.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,30 @@ pub async fn connect_to_browser() -> Result<Browser, WabbaAutoError> {

pub async fn nexus_login() -> Result<bool, WabbaAutoError> {
let browser = connect_to_browser().await?;

let tab = browser
.new_tab()
.map_err(|_| WabbaAutoError::HeadlessChromeError)?;
.new_tab_with_options(CreateTarget {
url: "http://nexusmods.com".to_owned(),
background: Some(false),
width: Some(1920),
height: Some(1080),
browser_context_id: None,
enable_begin_frame_control: None,
new_window: None,
})
.expect("Could not open a new tab after connecting to chrome");

tab.navigate_to("http://nexusmods.com")
.map_err(|_| WabbaAutoError::HeadlessChromeError)?;
let jpeg_data = tab.capture_screenshot(
Page::CaptureScreenshotFormatOption::Jpeg,
None,
None,
true).unwrap();
std::fs::write("screenshot.jpeg", jpeg_data).unwrap();
tab.wait_for_element("header#head")
.map_err(|_| WabbaAutoError::HeadlessChromeError)?;

let is_logged_in = tab.find_element("a#login").is_err();
Ok(is_logged_in)
let is_logged_in = tab.find_element("a#login").is_ok();
Ok(!is_logged_in)
}

pub async fn get_nexus_download_url(
Expand Down
3 changes: 1 addition & 2 deletions src/lib/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ export async function checkBrowser() {
let loginStatus = result.data;
console.log(loginStatus);
chromeRunning.set(true);
nexusLoggedIn.set(loginStatus.nexusmods);
loversLoggedIn.set(loginStatus.loverslab);
nexusLoggedIn.set(loginStatus.website);
errorMsg.set(loginStatus.error);
}

Expand Down

0 comments on commit 2b245b3

Please sign in to comment.