douyin-downloader 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -15
- package/package.json +2 -3
package/README.md
CHANGED
@@ -26,68 +26,68 @@ npm install -g douyin-downloader
|
|
26
26
|
或者,如果您不想全域安裝,可以使用 `npx`:
|
27
27
|
|
28
28
|
```bash
|
29
|
-
npx
|
29
|
+
npx dydl <命令> [選項]
|
30
30
|
```
|
31
31
|
|
32
32
|
## 🛠️ 使用說明
|
33
33
|
|
34
|
-
`douyin-downloader` 提供了一個名為 `
|
34
|
+
`douyin-downloader` 提供了一個名為 `dydl` 的命令列介面。
|
35
35
|
|
36
36
|
### 基本命令格式
|
37
37
|
|
38
38
|
```bash
|
39
|
-
|
39
|
+
dydl <命令> [選項] [參數]
|
40
40
|
```
|
41
41
|
|
42
42
|
### 可用命令
|
43
43
|
|
44
44
|
* **`login`**: 登入抖音帳號並儲存 Cookie。
|
45
45
|
```bash
|
46
|
-
|
46
|
+
dydl login
|
47
47
|
```
|
48
48
|
執行後會開啟瀏覽器顯示 QR Code,請使用抖音 App 掃描登入。Cookie 將儲存於預設路徑。
|
49
49
|
|
50
50
|
* **`check`**: 檢查已儲存的 Cookie 是否有效。
|
51
51
|
```bash
|
52
|
-
|
52
|
+
dydl check
|
53
53
|
```
|
54
54
|
|
55
55
|
* **`open`**: 開啟一個已載入 Cookie 的瀏覽器實例。
|
56
56
|
```bash
|
57
|
-
|
57
|
+
dydl open
|
58
58
|
```
|
59
59
|
|
60
60
|
* **`video <影片連結>`**: 下載單個影片。
|
61
61
|
```bash
|
62
62
|
# 下載影片到目前目錄
|
63
|
-
|
63
|
+
dydl video https://v.douyin.com/xxxxxxx/
|
64
64
|
|
65
65
|
# 指定下載目錄
|
66
|
-
|
66
|
+
dydl video -d ./downloads https://v.douyin.com/xxxxxxx/
|
67
67
|
|
68
68
|
# 指定下載目錄和檔案名稱 (注意: -f 僅適用於單個影片下載)
|
69
|
-
|
69
|
+
dydl video -d ./downloads -f my_video.mp4 https://v.douyin.com/xxxxxxx/
|
70
70
|
```
|
71
71
|
|
72
72
|
* **`info <影片連結>`**: 獲取影片資訊。
|
73
73
|
```bash
|
74
74
|
# 輸出資訊到控制台
|
75
|
-
|
75
|
+
dydl info https://v.douyin.com/xxxxxxx/
|
76
76
|
|
77
77
|
# 輸出資訊到 JSON 檔案
|
78
|
-
|
78
|
+
dydl info -f video_info.json https://v.douyin.com/xxxxxxx/
|
79
79
|
```
|
80
80
|
|
81
81
|
* **`list <用戶主頁連結>`**: 獲取用戶影片列表。
|
82
82
|
```bash
|
83
83
|
# 獲取用戶所有影片列表並輸出到控制台
|
84
|
-
|
84
|
+
dydl list https://www.douyin.com/user/MS4wLjABAAAAxxxxxxxxxxxxxxxx
|
85
85
|
|
86
86
|
# 獲取用戶最新的 10 個影片列表
|
87
|
-
|
87
|
+
dydl list -n 10 https://www.douyin.com/user/MS4wLjABAAAAxxxxxxxxxxxxxxxx
|
88
88
|
|
89
89
|
# 獲取用戶影片列表並輸出到 JSON 檔案
|
90
|
-
|
90
|
+
dydl list -f user_videos.json https://www.douyin.com/user/MS4wLjABAAAAxxxxxxxxxxxxxxxx
|
91
91
|
```
|
92
92
|
|
93
93
|
### 全局選項
|
@@ -97,7 +97,7 @@ dy-dl <命令> [選項] [參數]
|
|
97
97
|
|
98
98
|
## 🔑 身份驗證 (Cookie)
|
99
99
|
|
100
|
-
部分功能 (如下載某些受限影片或獲取完整的用戶列表) 可能需要登入狀態。使用 `
|
100
|
+
部分功能 (如下載某些受限影片或獲取完整的用戶列表) 可能需要登入狀態。使用 `dydl login` 命令登入後,Cookie 會被儲存。工具在執行需要驗證的操作時會自動載入儲存的 Cookie。您可以使用 `dydl check` 來確認 Cookie 的有效性。
|
101
101
|
|
102
102
|
Cookie 預設儲存路徑會根據您的作業系統而有所不同 (通常在用戶設定或應用程式資料目錄下)。
|
103
103
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "douyin-downloader",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.7",
|
4
4
|
"description": "抖音影片解析與下載套件",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -9,8 +9,7 @@
|
|
9
9
|
},
|
10
10
|
"scripts": {
|
11
11
|
"build": "tsc && chmod +x ./dist/bin/dydl.js",
|
12
|
-
"postbuild": "npm version patch --no-commit-hooks --no-git-tag-version"
|
13
|
-
"publish": "npm publish"
|
12
|
+
"postbuild": "npm version patch --no-commit-hooks --no-git-tag-version"
|
14
13
|
},
|
15
14
|
"files": [
|
16
15
|
"dist",
|