ani-cli-npm 2.0.9 → 2.0.10

Sign up to get free protection for your applications and to get access to all the features.
package/bin/Anime.js CHANGED
@@ -122,7 +122,8 @@ class Anime {
122
122
  this.player = await new PlayerController({
123
123
  app: 'mpv',
124
124
  args: ['--fullscreen'],
125
- media: await this.get_episode_link(episode, config.player)
125
+ media: await this.get_episode_link(episode, config.player),
126
+ ipcPath: config.mpv_socket_path
126
127
  });
127
128
  // @ts-ignore
128
129
  await this.player.launch(err => {
@@ -15,6 +15,7 @@ async function config_(temp) {
15
15
  "Proxy; " + temp.proxy,
16
16
  "User agent; " + temp.user_agent,
17
17
  "Downloads folder; " + temp.download_folder,
18
+ "mpv socket connection file; " + temp.mpv_socket_path,
18
19
  "Save and exit",
19
20
  "Exit without saving"
20
21
  ], [], ((item) => { return chalk.cyan(item); }), ((item) => { return chalk.cyan(item); }));
@@ -58,9 +59,14 @@ async function config_(temp) {
58
59
  // @ts-ignore
59
60
  return temp, 0;
60
61
  case 4:
62
+ console.log(chalk.cyan("New socket file"));
63
+ temp.mpv_socket_path = await ((0, input_1.input)());
61
64
  // @ts-ignore
62
- return temp, 1;
65
+ return temp, 0;
63
66
  case 5:
67
+ // @ts-ignore
68
+ return temp, 1;
69
+ case 6:
64
70
  // @ts-ignore
65
71
  return temp, 2;
66
72
  }
@@ -57,7 +57,8 @@ function load_config(cache_dir) {
57
57
  anime_id: ""
58
58
  },
59
59
  download_folder: ".",
60
- debug_mode: false
60
+ debug_mode: false,
61
+ mpv_socket_path: "",
61
62
  };
62
63
  if (fs.existsSync(cache_dir + "/config.conf")) {
63
64
  // @ts-ignore
@@ -83,6 +84,9 @@ function load_config(cache_dir) {
83
84
  // @ts-ignore
84
85
  if (tmp.download_folder !== undefined)
85
86
  config.download_folder = tmp.download_folder;
87
+ // @ts-ignore
88
+ if (tmp.mpv_socket_path !== undefined)
89
+ config.mpv_socket_path = tmp.mpv_socket_path;
86
90
  }
87
91
  write_config(cache_dir, config);
88
92
  return config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ani-cli-npm",
3
- "version": "2.0.9",
3
+ "version": "2.0.10",
4
4
  "description": "ani-cli tool rewritten as npm package",
5
5
  "main": "bin/index.js",
6
6
  "scripts": {
package/temp DELETED
@@ -1,16 +0,0 @@
1
- et_video_quality_mp4() {
2
- case $quality in
3
- best)
4
- video_url=$(printf '%s' "$1" | tail -n 1 | cut -d">" -f2) ;;
5
- worst)
6
- video_url=$(printf '%s' "$1" | head -n 1 | cut -d">" -f2) ;;
7
- *)
8
- video_url=$(printf '%s' "$1" | grep -i "${quality}p" | head -n 1 | cut -d">" -f2)
9
- if [ -z "$video_url" ]; then
10
- err "Current video quality is not available (defaulting to best quality)"
11
- video_url=$(printf '%s' "$1" | tail -n 1 | cut -d">" -f2)
12
- fi
13
- ;;
14
- esac
15
- printf '%s' "$video_url"
16
- }