comfyclips 1.2.0 → 1.3.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # ComfyClips
2
2
 
3
- Interactive CLI to download video or audio from social media links (YouTube, Instagram, TikTok, Facebook, X/Twitter). Built on top of [yt-dlp](https://github.com/yt-dlp/yt-dlp).
3
+ Interactive CLI to download video or audio from social media links (YouTube, Instagram, TikTok, Reddit, Pinterest, Vimeo, Dailymotion, Rumble, LinkedIn, Snapchat, Facebook, X/Twitter). Built on top of [yt-dlp](https://github.com/yt-dlp/yt-dlp).
4
4
 
5
5
  ## Requirements
6
6
 
@@ -26,7 +26,7 @@ comfyclips
26
26
  ```
27
27
 
28
28
  You'll be prompted to:
29
- 1. Select a platform (YouTube, Instagram, TikTok, Facebook, X/Twitter)
29
+ 1. Select a platform (YouTube, TikTok, Instagram, Reddit, Pinterest, Vimeo, Dailymotion, Rumble, LinkedIn, Snapchat, Facebook, X/Twitter)
30
30
  2. Paste the video link
31
31
  3. Choose Video or Audio only
32
32
  4. Pick a quality (video) or format (audio: mp3/m4a/wav/opus)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "comfyclips",
3
- "version": "1.2.0",
4
- "description": "Interactive CLI to download video or audio from social media platforms (YouTube, Instagram, TikTok, Facebook, X/Twitter) via yt-dlp.",
3
+ "version": "1.3.0",
4
+ "description": "Interactive CLI to download video or audio from social media platforms (YouTube, TikTok, Instagram, Reddit, Pinterest, Vimeo, Dailymotion, Rumble, LinkedIn, Snapchat, Facebook, X/Twitter) via yt-dlp.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "comfyclips": "./src/index.js"
@@ -13,15 +13,25 @@
13
13
  "LICENSE"
14
14
  ],
15
15
  "scripts": {
16
- "start": "node src/index.js"
16
+ "start": "node src/index.js",
17
+ "test": "node --test test/**/*.test.js"
17
18
  },
18
19
  "keywords": [
19
20
  "cli",
20
21
  "video-downloader",
21
22
  "yt-dlp",
22
23
  "youtube",
24
+ "tiktok",
25
+ "reddit",
26
+ "pinterest",
27
+ "vimeo",
23
28
  "instagram",
24
- "tiktok"
29
+ "twitter",
30
+ "facebook",
31
+ "dailymotion",
32
+ "rumble",
33
+ "linkedin",
34
+ "snapchat"
25
35
  ],
26
36
  "author": "Hamza Imran",
27
37
  "license": "ISC",
package/src/binaries.js CHANGED
@@ -8,7 +8,12 @@ import chalk from 'chalk';
8
8
  import ora from 'ora';
9
9
  import YTDlpWrap from './ytdlp-lib.js';
10
10
 
11
- const CACHE_DIR = path.join(os.homedir(), '.comfyclips', 'bin');
11
+ // On Vercel (and other read-only-filesystem serverless hosts) only /tmp is
12
+ // writable, and it isn't guaranteed to survive across invocations — so this
13
+ // falls back to os.tmpdir() there instead of the user's home directory.
14
+ const CACHE_DIR = process.env.VERCEL
15
+ ? path.join(os.tmpdir(), 'comfyclips-bin')
16
+ : path.join(os.homedir(), '.comfyclips', 'bin');
12
17
  const YT_DLP_BIN_NAME = os.platform() === 'win32' ? 'yt-dlp.exe' : 'yt-dlp';
13
18
  const CACHED_YT_DLP_PATH = path.join(CACHE_DIR, YT_DLP_BIN_NAME);
14
19
  const DENO_BIN_NAME = os.platform() === 'win32' ? 'deno.exe' : 'deno';
package/src/downloader.js CHANGED
@@ -43,6 +43,10 @@ export function buildArgs({
43
43
  outputTemplate,
44
44
  '--no-playlist',
45
45
  '--newline',
46
+ // Some platforms (Facebook, Reddit, etc.) use the full post caption as the
47
+ // title, which can blow past the filesystem's filename length limit.
48
+ '--trim-filenames',
49
+ '150',
46
50
  ...jsRuntimeArgs,
47
51
  ...ffmpegLocationArgs,
48
52
  ];
@@ -56,7 +60,16 @@ export function buildArgs({
56
60
  );
57
61
  }
58
62
  } else if (ffmpegAvailable) {
59
- args.push('-f', videoFormatSelector(quality), '--merge-output-format', 'mp4');
63
+ args.push(
64
+ '-S',
65
+ 'vcodec:h264,acodec:aac',
66
+ '-f',
67
+ videoFormatSelector(quality),
68
+ '--merge-output-format',
69
+ 'mp4',
70
+ '--postprocessor-args',
71
+ 'Merger:-c:a aac -movflags +faststart'
72
+ );
60
73
  } else {
61
74
  const h = heightCap(quality);
62
75
  args.push('-f', `best[ext=mp4]${h}/best${h}`);
package/src/platforms.js CHANGED
@@ -15,15 +15,50 @@ export const PLATFORMS = [
15
15
  hostPattern: /(^|\.)tiktok\.com$/i,
16
16
  },
17
17
  {
18
- name: 'Facebook',
19
- value: 'facebook',
20
- hostPattern: /(^|\.)facebook\.com$|^fb\.watch$/i,
18
+ name: 'Reddit',
19
+ value: 'reddit',
20
+ hostPattern: /(^|\.)reddit\.com$|^v\.redd\.it$|^redd\.it$/i,
21
+ },
22
+ {
23
+ name: 'Pinterest',
24
+ value: 'pinterest',
25
+ hostPattern: /(^|\.)pinterest\.[a-z.]+$|^pin\.it$/i,
21
26
  },
22
27
  {
23
28
  name: 'X / Twitter',
24
29
  value: 'twitter',
25
30
  hostPattern: /(^|\.)twitter\.com$|(^|\.)x\.com$/i,
26
31
  },
32
+ {
33
+ name: 'Facebook',
34
+ value: 'facebook',
35
+ hostPattern: /(^|\.)facebook\.com$|^fb\.watch$/i,
36
+ },
37
+ {
38
+ name: 'Vimeo',
39
+ value: 'vimeo',
40
+ hostPattern: /(^|\.)vimeo\.com$/i,
41
+ },
42
+ {
43
+ name: 'Dailymotion',
44
+ value: 'dailymotion',
45
+ hostPattern: /(^|\.)dailymotion\.com$|^dai\.ly$/i,
46
+ },
47
+ {
48
+ name: 'Rumble',
49
+ value: 'rumble',
50
+ hostPattern: /(^|\.)rumble\.com$/i,
51
+ },
52
+ {
53
+ name: 'LinkedIn',
54
+ value: 'linkedin',
55
+ hostPattern: /(^|\.)linkedin\.com$|^lnkd\.in$/i,
56
+ },
57
+ {
58
+ name: 'Snapchat',
59
+ value: 'snapchat',
60
+ hostPattern: /(^|\.)snapchat\.com$/i,
61
+ },
27
62
  ];
28
63
 
29
64
  export function hostMatchesPlatform(url, platformValue) {