mirror of
https://framagit.org/veretcle/oolatoocs.git
synced 2025-07-20 12:31:18 +02:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
402fcffc75 | ||
![]() |
b295cc5b94 | ||
![]() |
a882aaa59d | ||
![]() |
259032a7b9 |
10
Cargo.lock
generated
10
Cargo.lock
generated
@@ -2037,7 +2037,7 @@ checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oolatoocs"
|
name = "oolatoocs"
|
||||||
version = "4.2.3"
|
version = "4.3.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atrium-api",
|
"atrium-api",
|
||||||
"bsky-sdk",
|
"bsky-sdk",
|
||||||
@@ -2470,9 +2470,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ravif"
|
name = "ravif"
|
||||||
version = "0.11.12"
|
version = "0.11.20"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d6a5f31fcf7500f9401fea858ea4ab5525c99f2322cfcee732c0e6c74208c0c6"
|
checksum = "5825c26fddd16ab9f515930d49028a630efec172e903483c94796cfe31893e6b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"avif-serialize",
|
"avif-serialize",
|
||||||
"imgref",
|
"imgref",
|
||||||
@@ -3066,9 +3066,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "2.0.103"
|
version = "2.0.104"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e4307e30089d6fd6aff212f2da3a1f9e32f3223b1f010fb09b7c95f90f3ca1e8"
|
checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "oolatoocs"
|
name = "oolatoocs"
|
||||||
version = "4.2.3"
|
version = "4.3.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
@@ -18,7 +18,7 @@ What it can do:
|
|||||||
* Cuts (poorly) the Toot in half in it’s too long for Bluesky and thread it (this is cut using a word count, not the best method, but it gets the job done);
|
* Cuts (poorly) the Toot in half in it’s too long for Bluesky and thread it (this is cut using a word count, not the best method, but it gets the job done);
|
||||||
* Reuploads images/gifs/videos from Mastodon to Bluesky
|
* Reuploads images/gifs/videos from Mastodon to Bluesky
|
||||||
* ⚠️ Bluesky does not support mixing images and videos. You can have up to 4 images on a Bsky record **or** 1 video but not mix around. If you do so, only the video will be posted on Bluesky.
|
* ⚠️ Bluesky does not support mixing images and videos. You can have up to 4 images on a Bsky record **or** 1 video but not mix around. If you do so, only the video will be posted on Bluesky.
|
||||||
* ⚠️ Bluesky does not support images greater than 1Mb (that is 1,000,000,000 bytes or 976.6 KiB). I might incorporate soon a image quality reducer or WebP transcoding to avoid this issue.
|
* ⚠️ Bluesky does not support images greater than 1Mb (that is 1,000,000 bytes or 976.6 KiB), so Oolatoocs converts the image to WebP and progressively reduces the quality to fit that limitation.
|
||||||
* Can reproduce threads from Mastodon to Bluesky
|
* Can reproduce threads from Mastodon to Bluesky
|
||||||
* ⚠️ Bluesky does support polls for now. So the poll itself is just presented as text from Mastodon instead which is not the most elegant.
|
* ⚠️ Bluesky does support polls for now. So the poll itself is just presented as text from Mastodon instead which is not the most elegant.
|
||||||
* Can prevent a Toot from being recorded to Bluesky by using the #NoTweet (case-insensitive) hashtag in Mastodon
|
* Can prevent a Toot from being recorded to Bluesky by using the #NoTweet (case-insensitive) hashtag in Mastodon
|
||||||
@@ -30,6 +30,7 @@ The configuration is relatively easy to follow:
|
|||||||
```toml
|
```toml
|
||||||
[oolatoocs]
|
[oolatoocs]
|
||||||
db_path = "/var/lib/oolatoocs/db.sqlite3" # the path to the DB where toots/tweets/records are stored
|
db_path = "/var/lib/oolatoocs/db.sqlite3" # the path to the DB where toots/tweets/records are stored
|
||||||
|
remove_hashtags = false # optional, default to false
|
||||||
|
|
||||||
[mastodon] # This part can be generated, see below
|
[mastodon] # This part can be generated, see below
|
||||||
base = "https://m.nintendojo.fr"
|
base = "https://m.nintendojo.fr"
|
||||||
|
@@ -11,6 +11,17 @@ pub struct Config {
|
|||||||
#[derive(Debug, Deserialize)]
|
#[derive(Debug, Deserialize)]
|
||||||
pub struct OolatoocsConfig {
|
pub struct OolatoocsConfig {
|
||||||
pub db_path: String,
|
pub db_path: String,
|
||||||
|
#[serde(default)]
|
||||||
|
pub remove_hashtags: bool,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Default for OolatoocsConfig {
|
||||||
|
fn default() -> Self {
|
||||||
|
OolatoocsConfig {
|
||||||
|
db_path: "/var/lib/oolatoocs/db".to_string(),
|
||||||
|
remove_hashtags: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Deserialize)]
|
#[derive(Debug, Deserialize)]
|
||||||
|
@@ -88,7 +88,12 @@ pub async fn run(config: &Config) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// form tweet_content and strip everything useless in it
|
// form tweet_content and strip everything useless in it
|
||||||
let Ok(mut tweet_content) = strip_everything(&toot.content, &toot.tags) else {
|
let toot_tags: Vec<megalodon::entities::status::Tag> =
|
||||||
|
match &config.oolatoocs.remove_hashtags {
|
||||||
|
true => toot.tags.clone(),
|
||||||
|
false => vec![],
|
||||||
|
};
|
||||||
|
let Ok(mut tweet_content) = strip_everything(&toot.content, &toot_tags) else {
|
||||||
continue; // skip in case we can’t strip something
|
continue; // skip in case we can’t strip something
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user