ani-cli-npm 1.0.3 → 1.0.4
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/bin/index.js +46 -15
- package/package.json +1 -1
package/bin/index.js
CHANGED
@@ -50,8 +50,8 @@ console.log(colors.Blue, "ANI-CLI-NPM \n")
|
|
50
50
|
console.log(colors.Cyan, `1) Player; ${temp.player}`)
|
51
51
|
console.log(colors.Cyan, `2) Proxy; ${temp.proxy}`)
|
52
52
|
console.log(colors.Cyan, `3) User agent; ${temp.user_agent}`)
|
53
|
-
console.log(colors.Cyan, "4) Save and
|
54
|
-
console.log(colors.Cyan, "5)
|
53
|
+
console.log(colors.Cyan, "4) Save and exit")
|
54
|
+
console.log(colors.Cyan, "5) Exit without saving changes")
|
55
55
|
let choice = parseInt(await input(""));
|
56
56
|
switch (choice){
|
57
57
|
case 1:
|
@@ -68,7 +68,7 @@ console.log(colors.Blue, "ANI-CLI-NPM \n")
|
|
68
68
|
}
|
69
69
|
return temp,0
|
70
70
|
case 2:
|
71
|
-
temp.proxy = (await(input("New Proxy;"))).
|
71
|
+
temp.proxy = (await(input("New Proxy;"))).replaceAll(" ", "")
|
72
72
|
return temp, 0
|
73
73
|
case 3:
|
74
74
|
temp.user_agent = await(input("New User agent;"))
|
@@ -127,7 +127,7 @@ async function search_anime(search){
|
|
127
127
|
let html = (await curl("https://gogoanime.dk//search.html?keyword="+search)).split("\n")
|
128
128
|
let lines = []
|
129
129
|
for (x in html){
|
130
|
-
html[x] = html[x].
|
130
|
+
html[x] = html[x].replaceAll(/ /g,'').replaceAll(/\t/g,'')
|
131
131
|
if (matchRuleShort(html[x], filter)){
|
132
132
|
html[x] = html[x].slice(html[x].indexOf("/category/")+10);
|
133
133
|
html[x] = html[x].slice(0, html[x].indexOf("\"title="));
|
@@ -273,34 +273,50 @@ console.log(colors.Blue, "ANI-CLI-NPM \n")
|
|
273
273
|
if (player === "VLC"){
|
274
274
|
console.log(colors.Yellow, "Loading VLC... ")
|
275
275
|
let player = new VLC(link)
|
276
|
-
console.log(colors.
|
276
|
+
console.log(colors.Yellow, `Playing episode ${anime.episode_number+1} of ${anime.anime_id.replaceAll("-", " ")}\n`)
|
277
277
|
console.log(colors.Cyan, "1) Show Link")
|
278
|
-
console.log(colors.Cyan, "2)
|
278
|
+
console.log(colors.Cyan, "2) Next Episode")
|
279
|
+
console.log(colors.Cyan, "3) Quit")
|
279
280
|
choice = parseInt(await input("select;"))
|
280
281
|
switch (choice){
|
281
282
|
case 1:
|
282
283
|
console.clear()
|
283
|
-
console.log(colors.Blue, "ANI-CLI-NPM \n")
|
284
|
-
console.log
|
284
|
+
console.log(colors.Blue, "ANI-CLI-NPM \n")
|
285
285
|
console.log(colors.Yellow, "Link: "+link)
|
286
286
|
break
|
287
287
|
case 2:
|
288
|
+
link = await get_video_link(anime.episodes[anime.episode_number+1])
|
289
|
+
await play(link, anime, config.player)
|
290
|
+
process.exit()
|
291
|
+
break
|
292
|
+
case 3:
|
293
|
+
console.clear()
|
294
|
+
await main()
|
288
295
|
process.exit()
|
289
296
|
break
|
290
297
|
}
|
291
|
-
console.log(colors.Cyan, "1)
|
298
|
+
console.log(colors.Cyan, "1) Next Episode")
|
299
|
+
console.log(colors.Cyan, "2) Quit")
|
292
300
|
choice = parseInt(await input("select;"))
|
293
301
|
switch (choice){
|
294
302
|
case 1:
|
303
|
+
link = await get_video_link(anime.episodes[anime.episode_number+1])
|
304
|
+
await play(link, anime, config.player)
|
305
|
+
process.exit()
|
306
|
+
break
|
307
|
+
case 2:
|
308
|
+
console.clear()
|
309
|
+
await main()
|
295
310
|
process.exit()
|
296
311
|
break
|
297
312
|
}
|
298
313
|
}else if (player === "BROWSER"){
|
299
314
|
console.log(colors.Yellow, "Opening video in browser... ")
|
300
315
|
open(link)
|
301
|
-
console.log(colors.Yellow, `Playing episode ${anime.episode_number+1} of ${anime.anime_id.
|
316
|
+
console.log(colors.Yellow, `Playing episode ${anime.episode_number+1} of ${anime.anime_id.replaceAll("-", " ")}\n`)
|
302
317
|
console.log(colors.Cyan, "1) Show Link")
|
303
|
-
console.log(colors.Cyan, "2)
|
318
|
+
console.log(colors.Cyan, "2) Next Episode")
|
319
|
+
console.log(colors.Cyan, "3) Quit")
|
304
320
|
choice = parseInt(await input("select;"))
|
305
321
|
switch (choice){
|
306
322
|
case 1:
|
@@ -309,13 +325,28 @@ console.log(colors.Blue, "ANI-CLI-NPM \n")
|
|
309
325
|
console.log(colors.Yellow, "Link: "+link)
|
310
326
|
break
|
311
327
|
case 2:
|
328
|
+
link = await get_video_link(anime.episodes[anime.episode_number+1])
|
329
|
+
await play(link, anime, config.player)
|
330
|
+
process.exit()
|
331
|
+
break
|
332
|
+
case 3:
|
333
|
+
console.clear()
|
334
|
+
await main()
|
312
335
|
process.exit()
|
313
336
|
break
|
314
337
|
}
|
315
|
-
console.log(colors.Cyan, "1)
|
338
|
+
console.log(colors.Cyan, "1) Next Episode")
|
339
|
+
console.log(colors.Cyan, "2) Quit")
|
316
340
|
choice = parseInt(await input("select;"))
|
317
341
|
switch (choice){
|
318
342
|
case 1:
|
343
|
+
link = await get_video_link(anime.episodes[anime.episode_number+1])
|
344
|
+
await play(link, anime, config.player)
|
345
|
+
process.exit()
|
346
|
+
break
|
347
|
+
case 2:
|
348
|
+
console.clear()
|
349
|
+
await main()
|
319
350
|
process.exit()
|
320
351
|
break
|
321
352
|
}
|
@@ -341,7 +372,7 @@ console.log(colors.Blue, "ANI-CLI-NPM \n")
|
|
341
372
|
console.log(colors.Yellow, "Sorry for any inconvenience, this should soon by implemented. We appreciate your patience.")
|
342
373
|
process.exit()
|
343
374
|
}
|
344
|
-
console.log(colors.Blue, `Episode ${anime.episode_number+1} of ${anime.anime_id.
|
375
|
+
console.log(colors.Blue, `Episode ${anime.episode_number+1} of ${anime.anime_id.replaceAll("-", " ")} found.\n`)
|
345
376
|
console.log(colors.Cyan, "1) Play")
|
346
377
|
console.log(colors.Cyan, "2) Download")
|
347
378
|
console.log(colors.Cyan, "3) Show Link")
|
@@ -384,13 +415,13 @@ async function main(){
|
|
384
415
|
config = temp
|
385
416
|
proxyAgent = new HttpsProxyAgent(config.proxy);
|
386
417
|
console.clear()
|
387
|
-
console.log(colors.Blue, "ANI-CLI-NPM \n")
|
418
|
+
console.log(colors.Blue, "ANI-CLI-NPM \n")
|
388
419
|
console.log(colors.Yellow, "Config changed.")
|
389
420
|
break
|
390
421
|
} else if (exit_code === 2) {
|
391
422
|
temp = config
|
392
423
|
console.clear()
|
393
|
-
console.log(colors.Blue, "ANI-CLI-NPM \n")
|
424
|
+
console.log(colors.Blue, "ANI-CLI-NPM \n")
|
394
425
|
console.log(colors.Yellow, "Config changes disregarded.")
|
395
426
|
break
|
396
427
|
}
|