aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/ytdlp_download.md2
-rw-r--r--scripts/ytdlp_download.ts2
-rw-r--r--scripts/ytdlp_flatten.md11
-rw-r--r--scripts/ytdlp_flatten.ts2
4 files changed, 11 insertions, 6 deletions
diff --git a/scripts/ytdlp_download.md b/scripts/ytdlp_download.md
index c9f695a..26821e1 100644
--- a/scripts/ytdlp_download.md
+++ b/scripts/ytdlp_download.md
@@ -2,7 +2,7 @@
Downloads media with yt-dlp.
-Currently supported task kinds are `youtube` and `bilibili`.
+Currently supported task kinds are `youtube`, `niconico` and `bilibili`.
The output directory is the tasks `output` data attribute which must be present.
Additional yt-dlp arguments are added based on the task's `profile` attribute.
diff --git a/scripts/ytdlp_download.ts b/scripts/ytdlp_download.ts
index b6be66d..bd5e804 100644
--- a/scripts/ytdlp_download.ts
+++ b/scripts/ytdlp_download.ts
@@ -27,11 +27,13 @@ export class TextLineStream extends TransformStream<string, string> {
const supported = [
"youtube",
"bilibili",
+ "niconico",
]
function key_to_url(key: string): string {
const [kind, id] = key.split(":", 2)
if (kind == "youtube") return `https://www.youtube.com/watch?v=${id}`
if (kind == "bilibili") return `https://www.bilibili.com/video/${id}`
+ if (kind == "niconico") return `https://www.nicovideo.jp/watch/${id}`
throw new Error("unknown kind");
}
diff --git a/scripts/ytdlp_flatten.md b/scripts/ytdlp_flatten.md
index dd7be2b..78e837a 100644
--- a/scripts/ytdlp_flatten.md
+++ b/scripts/ytdlp_flatten.md
@@ -2,8 +2,9 @@
Transforms a playlist-like object into the media items that make it up.
-Currently supported task kinds are `youtube-channel` and `bilibili-channel`.
-Where task ids are the ids assigned by the respective platform.
+Currently supported task kinds are `youtube-channel`, `niconico-channel` and
+`bilibili-channel`. Where task ids are the ids assigned by the respective
+platform.
## Configuration
@@ -17,7 +18,7 @@ Sample configuration:
```yaml
ytdlp_flatten:
- filters:
- notlive: live_status=not_live
- short: duration<300
+ filters:
+ notlive: live_status=not_live
+ short: duration<300
```
diff --git a/scripts/ytdlp_flatten.ts b/scripts/ytdlp_flatten.ts
index 499233d..896e5a2 100644
--- a/scripts/ytdlp_flatten.ts
+++ b/scripts/ytdlp_flatten.ts
@@ -6,11 +6,13 @@ let config: Config = {} as unknown as Config
const supported = [
"youtube-channel",
"bilibili-channel",
+ "niconico-channel",
]
function key_to_url(key: string): [string, string] {
const [kind, id] = key.split(":", 2)
if (kind == "youtube-channel") return ["youtube", `https://youtube.com/channel/${id}`]
if (kind == "bilibili-channel") return ["bilibili", `https://space.bilibili.com/${id}/upload/video`]
+ if (kind == "niconico-channel") return ["niconico", `https://www.nicovideo.jp/user/${id}`]
throw new Error("unknown kind");
}
function key_to_infokey(key: string): string {