Compare commits
5 Commits
dependenci
...
renovate/e
Author | SHA1 | Date | |
---|---|---|---|
164c4a8d38 | |||
5be022c5a1 | |||
8eb8c68509 | |||
147671af66 | |||
a0649911fe |
60
.github/workflows/deploy.yml
vendored
60
.github/workflows/deploy.yml
vendored
@ -1,46 +1,45 @@
|
||||
name: Release FanslySync
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
app-slug:
|
||||
type: string
|
||||
description: Slug of the application
|
||||
required: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
CN_APP_SLUG: ${{ github.event.inputs.app-slug }}
|
||||
CN_APPLICATION: "fansly-creator-bot/fansly-sync"
|
||||
|
||||
jobs:
|
||||
draft:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: create draft release
|
||||
uses: crabnebula-dev/cloud-release@v0.1.0
|
||||
uses: crabnebula-dev/cloud-release@v0
|
||||
with:
|
||||
command: release draft ${{ env.CN_APP_SLUG }} --framework tauri
|
||||
command: release draft ${{ env.CN_APPLICATION }} --framework tauri
|
||||
api-key: ${{ secrets.CN_API_KEY }}
|
||||
|
||||
build:
|
||||
build_desktop:
|
||||
needs: draft
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
include:
|
||||
- os: ubuntu-22.04
|
||||
- os: windows
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "lts/*"
|
||||
|
||||
- name: Install stable toolchain
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
@ -48,48 +47,35 @@ jobs:
|
||||
cache: true
|
||||
|
||||
- name: install Linux dependencies
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
if: matrix.os == 'ubuntu-22.04'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
|
||||
sudo apt-get install -y webkit2gtk-4.1
|
||||
|
||||
- name: Install x86_64-apple-darwin for mac and build FanslySync binaries
|
||||
if: matrix.os == 'macos-latest'
|
||||
run: |
|
||||
rustup target add x86_64-apple-darwin
|
||||
npm i
|
||||
npm run tauri build -- --target x86_64-apple-darwin
|
||||
npm run tauri build -- --target aarch64-apple-darwin
|
||||
env:
|
||||
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
||||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
|
||||
|
||||
- name: build FanslySync app for Windows, Linux
|
||||
- name: build Tauri app for Windows, Linux
|
||||
if: matrix.os != 'macos-latest'
|
||||
run: |
|
||||
npm i
|
||||
npm run tauri build
|
||||
npm ci
|
||||
npm exec tauri build
|
||||
env:
|
||||
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
||||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
|
||||
|
||||
- name: upload assets
|
||||
uses: crabnebula-dev/cloud-release@v0.1.0
|
||||
uses: crabnebula-dev/cloud-release@v0
|
||||
with:
|
||||
command: release upload ${{ env.CN_APP_SLUG }} --framework tauri
|
||||
command: release upload ${{ env.CN_APPLICATION }} --framework tauri
|
||||
api-key: ${{ secrets.CN_API_KEY }}
|
||||
path: ./src-tauri
|
||||
|
||||
publish:
|
||||
needs: build
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build_desktop]
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: publish release
|
||||
uses: crabnebula-dev/cloud-release@v0.1.0
|
||||
uses: crabnebula-dev/cloud-release@v0
|
||||
with:
|
||||
command: release publish ${{ env.CN_APP_SLUG }} --framework tauri
|
||||
command: release publish ${{ env.CN_APPLICATION }} --framework tauri
|
||||
api-key: ${{ secrets.CN_API_KEY }}
|
||||
|
@ -21,7 +21,7 @@
|
||||
"@types/eslint": "^9.6.1",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"eslint": "^9.12.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-config-prettier": "^10.0.0",
|
||||
"eslint-plugin-svelte": "^2.44.1",
|
||||
"globals": "^15.10.0",
|
||||
"postcss": "^8.4.47",
|
||||
|
@ -117,15 +117,19 @@ impl Fansly {
|
||||
.await?;
|
||||
|
||||
if !response.status().is_success() {
|
||||
eprintln!("[sync::process::get_profile] No successful response from API. Setting error state.");
|
||||
log::error!("[sync::process::get_profile] No successful response from API. Setting error state.");
|
||||
return Err(response.error_for_status().unwrap_err());
|
||||
} else {
|
||||
println!("[sync::process::get_profile] Got successful response from API.");
|
||||
log::info!("[sync::process::get_profile] Successfully fetched profile data.");
|
||||
}
|
||||
|
||||
let profile = response
|
||||
.json::<FanslyBaseResponse<FanslyAccountResponse>>()
|
||||
.await?;
|
||||
|
||||
// Show the profile data
|
||||
log::info!("[sync::process::get_profile] Profile data: {:?}", profile);
|
||||
|
||||
Ok(profile)
|
||||
}
|
||||
|
||||
@ -157,12 +161,12 @@ impl Fansly {
|
||||
let response = self.client.get(url).headers(headers).send().await?;
|
||||
|
||||
if !response.status().is_success() {
|
||||
eprintln!("[sync::process::fetch_followers] No successful response from API. Setting error state.");
|
||||
log::error!("[sync::process::fetch_followers] No successful response from API. Setting error state.");
|
||||
return Err(response.error_for_status().unwrap_err());
|
||||
}
|
||||
|
||||
let followers: FanslyBaseResponseList<FanslyFollowersResponse> = response.json().await?;
|
||||
println!(
|
||||
log::info!(
|
||||
"[sync::process::fetch_followers] Got {} followers from API.",
|
||||
followers.response.len()
|
||||
);
|
||||
@ -423,7 +427,7 @@ impl Fansly {
|
||||
.await;
|
||||
|
||||
// Every 10 requests, sleep for a bit to avoid rate limiting
|
||||
if total_requests % 10 == 0 {
|
||||
if total_requests % 50 == 0 {
|
||||
tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
|
||||
}
|
||||
|
||||
@ -463,7 +467,7 @@ impl Fansly {
|
||||
.await;
|
||||
|
||||
// Every 10 requests, sleep for a bit to avoid rate limiting
|
||||
if total_requests % 10 == 0 {
|
||||
if total_requests % 50 == 0 {
|
||||
tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ pub struct Account {
|
||||
pub id: String,
|
||||
pub email: String,
|
||||
pub username: String,
|
||||
pub display_name: String,
|
||||
pub display_name: Option<String>,
|
||||
pub flags: i64,
|
||||
pub version: i64,
|
||||
pub created_at: i64,
|
||||
|
@ -53,7 +53,7 @@ export interface AccountInfoResponse {
|
||||
export interface AccountInfo {
|
||||
id: string;
|
||||
username: string;
|
||||
displayName: string;
|
||||
displayName: string | null;
|
||||
flags: number;
|
||||
version: number;
|
||||
createdAt: number;
|
||||
@ -76,8 +76,6 @@ export interface AccountInfo {
|
||||
banner: Avatar;
|
||||
postLikes: number;
|
||||
streaming: Streaming;
|
||||
subscriptionTiers: SubscriptionTier[];
|
||||
profileAccess: boolean;
|
||||
}
|
||||
|
||||
export interface SubscriptionTier {
|
||||
|
@ -54,6 +54,9 @@
|
||||
unknown
|
||||
];
|
||||
if (err || !me?.success) {
|
||||
if (err) {
|
||||
console.error('Error fetching account info:', err);
|
||||
}
|
||||
validationErrors.fanslyToken =
|
||||
'Authentication failed. Please check your token and try again.';
|
||||
step = 1;
|
||||
|
Reference in New Issue
Block a user