Skip to content

Commit

Permalink
export to module
Browse files Browse the repository at this point in the history
  • Loading branch information
xxxxuanran committed Jun 4, 2024
1 parent b6c61d0 commit d27dca6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
1 change: 1 addition & 0 deletions crates/biliup/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ mod tests {

#[test]
fn it_works() {
assert_eq!(Ok(Vid::Aid(10)), Vid::from_str("10"));
assert_eq!(Ok(Vid::Aid(971158452)), Vid::from_str("971158452"));
assert_eq!(Ok(Vid::Aid(971158452)), Vid::from_str("av971158452"));
assert_eq!(
Expand Down
3 changes: 2 additions & 1 deletion crates/biliup/src/uploader/bilibili.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ impl FromStr for Vid {
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
let s = s.trim();
if s.len() < 3 {
return s.parse::<u64>().map(|val| Vid::Aid(val)).map_err(|e| e);
return s.parse::<u64>()
.map(|val| Vid::Aid(val));
}
match &s[..2] {
"BV" => Ok(Vid::Bvid(s.to_string())),
Expand Down
4 changes: 2 additions & 2 deletions crates/stream-gears/src/uploader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ pub async fn upload(studio_pre: StudioPre) -> Result<ResponseData> {
// Some(UploadLine::Kodo) => line::kodo(),
// Some(UploadLine::Cos) => line::cos(),
// Some(UploadLine::CosInternal) => line::cos_internal(),
Some(UploadLine::Bldsa) => line::bldsa(),
Some(UploadLine::Bda) => line::bda(),
Some(UploadLine::Tx) => line::tx(),
Some(UploadLine::Txa) => line::txa(),
Some(UploadLine::Bda) => line::bda(),
Some(UploadLine::Bldsa) => line::bldsa(),
None => Probe::probe(&client.client).await.unwrap_or_default(),
};
for video_path in video_path {
Expand Down
23 changes: 16 additions & 7 deletions crates/stream-gears/stream_gears/stream_gears.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def download_with_callback(url: str,
file_name_callback_fn: Callable[[str], None]) -> None:
"""
下载视频
:param str url: 视频地址
:param Dict[str, str] header_map: HTTP请求头
:param str file_name: 文件名格式
Expand Down Expand Up @@ -111,14 +111,23 @@ class UploadLine(Enum):
Qn = 3
"""七牛upos"""

Kodo = 4
"""七牛bupfetch"""
# Kodo = 4
# """七牛bupfetch"""

# Cos = 5
# """腾讯bupfetch"""

# CosInternal = 6
# """上海腾讯云内网"""

Bda = 4
"""百度云海外"""

Cos = 5
"""腾讯bupfetch"""
Tx = 5
"""腾讯云EO"""

CosInternal = 6
"""上海腾讯云内网"""
Txa = 6
"""腾讯云EO海外"""

Bldsa = 7
"""Bldsa"""
Expand Down

0 comments on commit d27dca6

Please sign in to comment.