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