weebcli 1.0.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.
Files changed (54) hide show
  1. package/.github/workflows/releases.yml +39 -0
  2. package/LICENSE +400 -0
  3. package/README-EN.md +134 -0
  4. package/README.md +134 -0
  5. package/aur/.SRCINFO +16 -0
  6. package/aur/PKGBUILD +43 -0
  7. package/eslint.config.js +49 -0
  8. package/jsconfig.json +9 -0
  9. package/package.json +45 -0
  10. package/src/constants.js +13 -0
  11. package/src/functions/episodes.js +38 -0
  12. package/src/functions/time.js +27 -0
  13. package/src/functions/variables.js +3 -0
  14. package/src/i18n/en.json +351 -0
  15. package/src/i18n/index.js +80 -0
  16. package/src/i18n/tr.json +348 -0
  17. package/src/index.js +307 -0
  18. package/src/jsdoc.js +72 -0
  19. package/src/sources/allanime.js +195 -0
  20. package/src/sources/animecix.js +223 -0
  21. package/src/sources/animely.js +100 -0
  22. package/src/sources/handlers/allanime.js +318 -0
  23. package/src/sources/handlers/animecix.js +316 -0
  24. package/src/sources/handlers/animely.js +338 -0
  25. package/src/sources/handlers/base.js +391 -0
  26. package/src/sources/handlers/index.js +4 -0
  27. package/src/sources/index.js +80 -0
  28. package/src/utils/anilist.js +193 -0
  29. package/src/utils/data_manager.js +27 -0
  30. package/src/utils/discord.js +86 -0
  31. package/src/utils/download/concurrency.js +27 -0
  32. package/src/utils/download/download.js +485 -0
  33. package/src/utils/download/progress.js +84 -0
  34. package/src/utils/players/mpv.js +251 -0
  35. package/src/utils/players/vlc.js +120 -0
  36. package/src/utils/process_queue.js +121 -0
  37. package/src/utils/resume_watch.js +137 -0
  38. package/src/utils/search.js +39 -0
  39. package/src/utils/search_download.js +21 -0
  40. package/src/utils/speedtest.js +30 -0
  41. package/src/utils/spinner.js +7 -0
  42. package/src/utils/storage/cache.js +42 -0
  43. package/src/utils/storage/config.js +71 -0
  44. package/src/utils/storage/history.js +69 -0
  45. package/src/utils/storage/queue.js +43 -0
  46. package/src/utils/storage/watch_progress.js +104 -0
  47. package/src/utils/system.js +176 -0
  48. package/src/utils/ui/box.js +140 -0
  49. package/src/utils/ui/settings_ui.js +322 -0
  50. package/src/utils/ui/show_history.js +92 -0
  51. package/src/utils/ui/stats.js +67 -0
  52. package/start.js +21 -0
  53. package/tanitim-en.md +66 -0
  54. package/tanitim-tr.md +66 -0
package/README.md ADDED
@@ -0,0 +1,134 @@
1
+ <div align="center">
2
+ <img src="https://raw.githubusercontent.com/ewgsta/weebcli/main/docs/img/phee.png" alt="weebcli" width="200">
3
+ </div>
4
+
5
+ <h1 align="center">weebcli</h1>
6
+
7
+ <p align="center">
8
+ <a href="https://www.npmjs.com/package/weebcli">
9
+ <img src="https://img.shields.io/npm/v/weebcli.svg" alt="npm version">
10
+ </a>
11
+ <a href="https://aur.archlinux.org/packages/weebcli">
12
+ <img src="https://img.shields.io/aur/version/weebcli" alt="AUR version">
13
+ </a>
14
+ <a href="https://creativecommons.org/licenses/by-nc-nd/4.0/">
15
+ <img src="https://img.shields.io/badge/license-CC%20BY--NC--ND%204.0-blue.svg" alt="License">
16
+ </a>
17
+ </p>
18
+
19
+ <p align="center">
20
+ <strong>Terminaliniz üzerinden anime izlemenizi ve indirmenizi sağlayan güçlü, şık ve basit bir CLI aracı.</strong>
21
+ </p>
22
+
23
+ <p align="center">
24
+ <a href="README-EN.md">🇬🇧 English</a>
25
+ </p>
26
+
27
+ ## Özellikler
28
+
29
+ - **Çoklu Kaynak Desteği:** Türkçe (Animely.net, Animecix.tv) ve İngilizce (AllAnime) kaynaklar
30
+ - **Çoklu Dil:** Türkçe ve İngilizce arayüz desteği
31
+ - **Dil Bazlı Kaynak Filtreleme:** Seçtiğiniz dile göre otomatik kaynak filtreleme
32
+ - **Sub/Dub Desteği:** AllAnime'de altyazılı veya dublajlı izleme seçeneği
33
+ - **Anında İzleme:** VLC veya MPV ile doğrudan streaming
34
+ - **Kaldığı Yerden Devam:** MPV ile izlerken kaldığınız dakikayı otomatik hatırlar
35
+ - **Kalite Seçimi:** Animecix ve AllAnime'de çoklu kalite seçenekleri
36
+ - **Anilist Entegrasyonu:** İzlediğiniz animeleri otomatik olarak Anilist'e ekleyin
37
+ - **Discord Rich Presence:** Ne izlediğiniz Discord profilinizde görünsün
38
+ - **Akıllı İndirme:** Kaldığı yerden devam, kuyruk sistemi, eşzamanlı indirme
39
+ - **Aria2 Desteği:** MP4 indirmelerinde 16x bağlantı ile hızlı indirme
40
+ - **yt-dlp Desteği:** M3U8 indirmelerinde paralel bağlantı ile hızlı indirme
41
+ - **Son İzlenen İşaretleme:** Bölüm listesinde son izlediğiniz ve sıradaki bölüm işaretli
42
+
43
+ ## Görseller
44
+
45
+ | Menü | Ayarlar |
46
+ |------|---------|
47
+ | ![menü](https://r2.fakecrime.bio/uploads/10b1f77e-f967-45bf-9a74-e4c539c52dfe.png) | ![ayarlar](https://r2.fakecrime.bio/uploads/6a01a11a-309c-4d3a-8d40-04ed81e4476b.png) |
48
+
49
+ | Arama | Anime |
50
+ |-------|-------|
51
+ | ![arama](https://r2.fakecrime.bio/uploads/95ff108b-dc25-44a2-a51a-1457b35ce99c.png) | ![anime](https://r2.fakecrime.bio/uploads/4f92ad64-056e-4661-bc3a-d7e9def1793f.png) |
52
+
53
+ ## Desteklenen Kaynaklar
54
+
55
+ | Kaynak | Dil | Arama | İzleme | İndirme | Kalite Seçimi | Sub/Dub |
56
+ |--------|-----|-------|--------|---------|---------------|---------|
57
+ | Animely.net | 🇹🇷 Türkçe | ✅ Fuzzy Search | ✅ | ✅ | - | - |
58
+ | Animecix.tv | 🇹🇷 Türkçe | ✅ API Search | ✅ | ✅ | ✅ 480p/720p/1080p | - |
59
+ | AllAnime | 🇬🇧 İngilizce | ✅ API Search | ✅ | ✅ | ✅ Çoklu | ✅ |
60
+
61
+ ## Kurulum
62
+
63
+ ### npm (Tüm platformlar)
64
+
65
+ ```bash
66
+ npm install -g weebcli
67
+ ```
68
+
69
+ ### Arch Linux (AUR)
70
+
71
+ ```bash
72
+ yay -S weebcli
73
+ # veya
74
+ paru -S weebcli
75
+ ```
76
+
77
+ ## Kullanım
78
+
79
+ ```bash
80
+ weebcli
81
+ ```
82
+
83
+ ## İndirme Yöneticileri
84
+
85
+ ### Aria2 (MP4 için)
86
+ MP4 dosyaları için hızlı indirme. Ayarlardan etkinleştirin, otomatik kurulur.
87
+
88
+ ### yt-dlp (M3U8 için)
89
+ M3U8/HLS stream'leri için hızlı indirme. Ayarlardan etkinleştirin, otomatik kurulur.
90
+
91
+ ## Gereksinimler
92
+
93
+ ### CLI
94
+ - **Node.js** v18+
95
+ - **Video Oynatıcı:** MPV (önerilen) veya VLC
96
+
97
+ ### Opsiyonel
98
+ - **Aria2:** Hızlı MP4 indirme (otomatik kurulur)
99
+ - **yt-dlp:** Hızlı M3U8 indirme (otomatik kurulur)
100
+
101
+ ### Web
102
+ - **Discord hesabı**
103
+ - **İnternet**
104
+
105
+ ## Katkıda Bulunun
106
+
107
+ 1. Fork'layın
108
+ 2. Feature branch oluşturun (`git checkout -b yeni-ozellik`)
109
+ 3. Değişikliklerinizi commit'leyin (`git commit -m 'Yeni özellik eklendi'`)
110
+ 4. Branch'inizi push'layın (`git push origin yeni-ozellik`)
111
+ 5. Pull Request açın
112
+
113
+ ### Geliştirme
114
+
115
+ ```bash
116
+ git clone https://github.com/ewgsta/weebcli.git
117
+ cd weebcli
118
+ pnpm install
119
+ pnpm start
120
+ ```
121
+
122
+ ## Destek
123
+
124
+ - **Bug Report:** [GitHub Issues](https://github.com/ewgsta/weebcli/issues)
125
+ - **Özellik İsteği:** [GitHub Issues](https://github.com/ewgsta/weebcli/issues)
126
+
127
+ ## Lisans
128
+
129
+ Bu proje [Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)](https://creativecommons.org/licenses/by-nc-nd/4.0/) lisansı ile lisanslanmıştır.
130
+
131
+ - **Paylaş:** Eseri her ortam veya formatta kopyalayabilir ve yeniden dağıtabilirsiniz.
132
+ - **Atıf:** Uygun referans vermeli, lisansa bağlantı sağlamalı ve değişiklik yapıldıysa bilgi vermelisiniz.
133
+ - **Ticari Olmayan:** Bu materyali ticari amaçlarla kullanamazsınız.
134
+ - **Türetilemez:** Değiştirilmiş materyali dağıtamazsınız.
package/aur/.SRCINFO ADDED
@@ -0,0 +1,16 @@
1
+ pkgbase = weebcli
2
+ pkgdesc = Terminal üzerinden anime izleme ve indirme CLI aracı
3
+ pkgver = 1.0.0
4
+ pkgrel = 1
5
+ url = https://github.com/ewgsta/weebcli
6
+ arch = any
7
+ license = custom:CC-BY-NC-ND-4.0
8
+ depends = nodejs>=18
9
+ depends = npm
10
+ optdepends = mpv: video oynatıcı (önerilen, kaldığı yerden devam desteği)
11
+ optdepends = vlc: alternatif video oynatıcı
12
+ optdepends = aria2: hızlı indirme için
13
+ source = weebcli-1.0.0.tar.gz::https://github.com/ewgsta/weebcli/archive/refs/tags/v1.0.0.tar.gz
14
+ sha256sums = SKIP
15
+
16
+ pkgname = weebcli
package/aur/PKGBUILD ADDED
@@ -0,0 +1,43 @@
1
+ # Maintainer: ewgsta <ewgsta@proton.me>
2
+ pkgname=weebcli
3
+ pkgver=1.0.0
4
+ pkgrel=1
5
+ pkgdesc="Terminal üzerinden anime izleme ve indirme CLI aracı"
6
+ arch=('any')
7
+ url="https://github.com/ewgsta/weebcli"
8
+ license=('custom:CC-BY-NC-ND-4.0')
9
+ depends=('nodejs>=18' 'npm')
10
+ optdepends=(
11
+ 'mpv: video oynatıcı (önerilen, kaldığı yerden devam desteği)'
12
+ 'vlc: alternatif video oynatıcı'
13
+ 'aria2: hızlı indirme için'
14
+ )
15
+ source=("${pkgname}-${pkgver}.tar.gz::https://github.com/ewgsta/${pkgname}/archive/refs/tags/v${pkgver}.tar.gz")
16
+ sha256sums=('SKIP')
17
+
18
+ package() {
19
+ cd "${srcdir}/${pkgname}-${pkgver}"
20
+
21
+ # Node modüllerini kur
22
+ npm install --production --ignore-scripts
23
+
24
+ # Uygulama dizini oluştur
25
+ install -dm755 "${pkgdir}/usr/lib/${pkgname}"
26
+
27
+ # Dosyaları kopyala
28
+ cp -r src package.json node_modules "${pkgdir}/usr/lib/${pkgname}/"
29
+
30
+ # Çalıştırılabilir script oluştur
31
+ install -dm755 "${pkgdir}/usr/bin"
32
+ cat > "${pkgdir}/usr/bin/${pkgname}" << 'EOF'
33
+ #!/bin/bash
34
+ exec node /usr/lib/weebcli/src/index.js "$@"
35
+ EOF
36
+ chmod +x "${pkgdir}/usr/bin/${pkgname}"
37
+
38
+ # Lisans dosyası
39
+ install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
40
+
41
+ # README
42
+ install -Dm644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
43
+ }
@@ -0,0 +1,49 @@
1
+ // @ts-check
2
+ import js from "@eslint/js";
3
+ import { defineConfig } from "eslint/config";
4
+ import globals from "globals";
5
+
6
+ const rules = {
7
+ "comma-dangle": ["error", "always-multiline"],
8
+ "comma-spacing": "error",
9
+ "comma-style": "error",
10
+ curly: ["error", "multi-line", "consistent"],
11
+ "dot-location": ["error", "property"],
12
+ "handle-callback-err": "off",
13
+ indent: ["error", "tab"],
14
+ "keyword-spacing": "error",
15
+ "max-nested-callbacks": ["error", { max: 4 }],
16
+ "max-statements-per-line": ["error", { max: 2 }],
17
+ "no-console": "off",
18
+ "no-empty-function": "error",
19
+ "no-floating-decimal": "error",
20
+ "no-lonely-if": "error",
21
+ "no-multi-spaces": "error",
22
+ "no-multiple-empty-lines": ["error", { max: 2, maxEOF: 1, maxBOF: 0 }],
23
+ "no-shadow": ["error", { allow: ["err", "resolve", "reject"] }],
24
+ "no-trailing-spaces": ["error"],
25
+ "no-var": "error",
26
+ "no-undef": "off",
27
+ "object-curly-spacing": ["error", "always"],
28
+ "prefer-const": "error",
29
+ quotes: ["error", "double"],
30
+ semi: ["error", "always"],
31
+ "space-before-blocks": "error",
32
+ "space-before-function-paren": ["error", {
33
+ anonymous: "never",
34
+ named: "never",
35
+ asyncArrow: "always",
36
+ }],
37
+ "space-in-parens": "error",
38
+ "space-infix-ops": "error",
39
+ "space-unary-ops": "error",
40
+ "spaced-comment": "error",
41
+ yoda: "error",
42
+ };
43
+
44
+ export default defineConfig([
45
+ { files: ["**/*.{js,mjs,cjs}"], plugins: { js }, extends: ["js/recommended"] },
46
+ { files: ["**/*.{js,mjs,cjs}"], languageOptions: { globals: globals.browser } },
47
+ // @ts-expect-error
48
+ { files: ["**/*.{js,mjs,cjs}"], rules },
49
+ ]);
package/jsconfig.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "NodeNext",
4
+ "moduleResolution": "nodenext",
5
+ "paths": {
6
+ "@/*": ["./src/*"]
7
+ }
8
+ }
9
+ }
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "weebcli",
3
+ "version": "1.0.0",
4
+ "description": "weebcli - Terminalden anime izleme ve indirme aracı",
5
+ "main": "src/index.js",
6
+ "type": "module",
7
+ "bin": {
8
+ "weebcli": "./src/index.js"
9
+ },
10
+ "scripts": {
11
+ "start": "node start.js"
12
+ },
13
+ "keywords": [
14
+ "anime",
15
+ "izle",
16
+ "indir",
17
+ "weebcli",
18
+ "weeb",
19
+ "türkanime",
20
+ "allanime"
21
+ ],
22
+ "author": "ewgsta",
23
+ "license": "CC-BY-NC-ND-4.0",
24
+ "devDependencies": {
25
+ "@eslint/js": "^9.27.0",
26
+ "eslint": "^9.27.0",
27
+ "globals": "^16.1.0"
28
+ },
29
+ "dependencies": {
30
+ "@types/node": "^24.0.10",
31
+ "axios": "^1.9.0",
32
+ "bytes": "^3.1.2",
33
+ "chalk": "^5.4.1",
34
+ "discord-rpc": "^4.0.1",
35
+ "ffmpeg-static": "^5.3.0",
36
+ "figures": "^6.1.0",
37
+ "fluent-ffmpeg": "^2.1.3",
38
+ "inquirer": "^12.6.1",
39
+ "mime-types": "^3.0.1",
40
+ "node-notifier": "^10.0.1",
41
+ "ora": "^8.2.0",
42
+ "strip-ansi": "^7.1.0",
43
+ "update-notifier": "^7.3.1"
44
+ }
45
+ }
@@ -0,0 +1,13 @@
1
+ export const API_URL = "https://animely.net/api";
2
+ export const ANILIST_ID = "33354";
3
+ export const DISCORD_ID = "1449760321764855858";
4
+ export const AUTH_URL = `https://anilist.co/api/v2/oauth/authorize?client_id=${ANILIST_ID}&response_type=token`;
5
+
6
+ export let EstSpeed = null;
7
+
8
+ export const setSpeed = (s) => {
9
+ EstSpeed = s;
10
+ };
11
+ export const LOGO_URL = "https://r2.fakecrime.bio/uploads/fbb7b3a0-7735-4253-af71-fd2e0a9c5110.png";
12
+
13
+ export const EP_SIZE = 250;
@@ -0,0 +1,38 @@
1
+ // @ts-check
2
+ import chalk from "chalk";
3
+
4
+ /**
5
+ * @param {string[]} links
6
+ * @returns {string}
7
+ */
8
+ export function getLink(links) {
9
+ if (!Array.isArray(links)) {
10
+ return "";
11
+ }
12
+ return links.find(link => link && typeof link === "string" && link.trim() !== "") || "";
13
+ }
14
+
15
+ /**
16
+ * @param {number|string|object} number
17
+ * @param {string} type
18
+ * @returns {string}
19
+ */
20
+ export function formatName(number, type) {
21
+ let episodeNumber;
22
+
23
+ if (typeof number === "object" && number !== null) {
24
+ console.warn("Episode number is an object:", number);
25
+ episodeNumber = "?";
26
+ } else if (typeof number === "string") {
27
+ const parsed = parseInt(number, 10);
28
+ episodeNumber = isNaN(parsed) ? "?" : parsed;
29
+ } else if (typeof number === "number" && !isNaN(number)) {
30
+ episodeNumber = number;
31
+ } else {
32
+ console.warn("Invalid episode number:", number);
33
+ episodeNumber = "?";
34
+ }
35
+
36
+ const typeLabel = type && typeof type === "string" && type.length ? chalk.red(`(${type})`) : "";
37
+ return `${episodeNumber}. Bölüm ${typeLabel}`;
38
+ }
@@ -0,0 +1,27 @@
1
+ // @ts-check
2
+ /**
3
+ * @param {Date} [date]
4
+ * @returns {string}
5
+ */
6
+ export function timeFormat(date = new Date()) {
7
+ try {
8
+ if (!(date instanceof Date) || isNaN(date.getTime())) {
9
+ date = new Date();
10
+ }
11
+
12
+ const formatter = new Intl.DateTimeFormat("tr-TR", {
13
+ day: "2-digit",
14
+ month: "2-digit",
15
+ year: "numeric",
16
+ hour: "2-digit",
17
+ minute: "2-digit",
18
+ second: "2-digit",
19
+ hour12: false,
20
+ });
21
+
22
+ return formatter.format(date).replace(",", "");
23
+ } catch {
24
+ const fallbackDate = new Date();
25
+ return `${fallbackDate.getDate().toString().padStart(2, "0")}.${(fallbackDate.getMonth() + 1).toString().padStart(2, "0")}.${fallbackDate.getFullYear()} ${fallbackDate.getHours().toString().padStart(2, "0")}:${fallbackDate.getMinutes().toString().padStart(2, "0")}:${fallbackDate.getSeconds().toString().padStart(2, "0")}`;
26
+ }
27
+ }
@@ -0,0 +1,3 @@
1
+ // @ts-check
2
+ /** @type {string} */
3
+ export const line = "-";