Skip to content

Commit

Permalink
fix: 📍小码王问题解决
Browse files Browse the repository at this point in the history
  • Loading branch information
LycasLdt committed Feb 8, 2024
1 parent 9bdc458 commit c1101a1
Show file tree
Hide file tree
Showing 8 changed files with 195 additions and 29 deletions.
151 changes: 143 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "rabdog"
description = "A Scratch communities' project downloader"
version = "0.2.1"
version = "0.2.4"
edition = "2021"
build = "build.rs"

Expand All @@ -24,6 +24,9 @@ scraper = "0.18.1"

# Decoding
base64 = "0.21"
md-5 = "0.11.0-pre.3"
chrono = "0.4"
base16ct = { version = "0.2", features = ["alloc"] }
aes = "0.8"
zip = { version = "0.6", features = ["deflate"]}
cbc = { version = "0.1", features = ["std"] }
Expand Down
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

* :white_check_mark: [**Clipcc**][clipcc]

* :bomb: [**小码王**][xmw]
* :white_check_mark: [**小码王**][xmw]

* :white_check_mark: [**Scratch 中社**][scratch-cn] <sup>v0.2.1</sup>

Expand All @@ -32,17 +32,11 @@
> [!CAUTION]
> 经测试
>
> 有 小码王 作品采用该程序架构 **暂时无法解决****响应**
>
> **75%** 的 小码王**旧作品 (包括最新更新但发布时间早的作品) 无法使用**
>
> 于此同时
>
> 有 40code 作品 **只支持 Firefox 的 `User-Agent` 访问**, 暂时仍未解决
>
> **35%** 的 40code作品 **无法使用**
### 安装
### :package:安装

[![ci](https://github.com/LycasLdt/rabdog/actions/workflows/ci.yml/badge.svg)](https://github.com/LycasLdt/rabdog/actions/workflows/ci.yml)

Expand Down
8 changes: 6 additions & 2 deletions src/downloads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,18 +191,22 @@ impl<'a> Handler<'a> {

self.downloader.get(&mut self.context).await.and_then(|_| {
let title = self.context.clone().title.unwrap();
Ok(tx.send_single(idx, Notification::FetchedProject(title))?)
tx.send_single(idx, Notification::FetchedProject(title))
})?;
self.get_buffer().await?;
self.downloader
.decode(&mut self.context)
.and_then(|_| Ok(tx.send_single(idx, Notification::DecodedProject)?))?;
.and_then(|_| tx.send_single(idx, Notification::DecodedProject))?;
self.pack_sb3(config.path.clone()).await?;
tx.send_single(idx, Notification::Finished)?;

Ok(())
}
async fn get_buffer(&mut self) -> Result<()> {
if self.context.buffer.is_some() {
return Ok(());
}

let url = self.context.url.clone().unwrap();
let res = self.context.get(url).send().await?;

Expand Down
Loading

0 comments on commit c1101a1

Please sign in to comment.