-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
增加
--download-danmaku-formats
选项以控制弹幕下载格式 (#950)
* feat: add -ddf,--download-danmaku-format option to keep only xml/ass file * chore: fix review advice * chore: fix ident * chore: fix flags usage * chore: use enum.ToString() * Update BBDown/Program.cs Co-authored-by: nilaoda <[email protected]> * chore: rename to plural & add desc help info * chore: manual format --------- Co-authored-by: nilaoda <[email protected]>
- Loading branch information
Showing
7 changed files
with
85 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
charset = utf-8 | ||
# end_of_line = crlf | ||
# trim_trailing_whitespace = false | ||
# insert_final_newline = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Linq; | ||
|
||
namespace BBDown; | ||
|
||
public enum BBDownDanmakuFormat | ||
{ | ||
Xml, | ||
Ass, | ||
} | ||
|
||
public static class BBDownDanmakuFormatInfo | ||
{ | ||
// 默认 | ||
public static BBDownDanmakuFormat[] DefaultFormats = [BBDownDanmakuFormat.Xml, BBDownDanmakuFormat.Ass]; | ||
public static string[] DefaultFormatsNames = DefaultFormats.Select(f => f.ToString().ToLower()).ToArray(); | ||
// 可选项 | ||
public static string[] AllFormatNames = Enum.GetNames(typeof(BBDownDanmakuFormat)).Select(f => f.ToLower()).ToArray(); | ||
|
||
public static BBDownDanmakuFormat FromFormatName(string formatName) | ||
{ | ||
return formatName switch | ||
{ | ||
"xml" => BBDownDanmakuFormat.Xml, | ||
"ass" => BBDownDanmakuFormat.Ass, | ||
_ => BBDownDanmakuFormat.Xml, | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters