aw-cli 1.8.1__tar.gz → 2.1__tar.gz
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.
- {aw-cli-1.8.1 → aw_cli-2.1}/PKG-INFO +14 -13
- {aw-cli-1.8.1 → aw_cli-2.1}/README.md +4 -10
- {aw-cli-1.8.1 → aw_cli-2.1}/aw_cli.egg-info/PKG-INFO +14 -13
- {aw-cli-1.8.1 → aw_cli-2.1}/aw_cli.egg-info/SOURCES.txt +0 -1
- {aw-cli-1.8.1 → aw_cli-2.1}/aw_cli.egg-info/requires.txt +0 -1
- {aw-cli-1.8.1 → aw_cli-2.1}/awcli/anilist.py +20 -52
- {aw-cli-1.8.1 → aw_cli-2.1}/awcli/anime.py +6 -4
- {aw-cli-1.8.1 → aw_cli-2.1}/awcli/arg_parser.py +1 -0
- aw_cli-2.1/awcli/run.py +782 -0
- {aw-cli-1.8.1 → aw_cli-2.1}/awcli/utilities.py +103 -104
- aw_cli-2.1/awcli/version.py +1 -0
- {aw-cli-1.8.1 → aw_cli-2.1}/setup.py +1 -2
- aw-cli-1.8.1/awcli/run.py +0 -779
- aw-cli-1.8.1/awcli/version.py +0 -1
- aw-cli-1.8.1/tests/test_run.py +0 -19
- {aw-cli-1.8.1 → aw_cli-2.1}/LICENSE +0 -0
- {aw-cli-1.8.1 → aw_cli-2.1}/aw_cli.egg-info/dependency_links.txt +0 -0
- {aw-cli-1.8.1 → aw_cli-2.1}/aw_cli.egg-info/entry_points.txt +0 -0
- {aw-cli-1.8.1 → aw_cli-2.1}/aw_cli.egg-info/top_level.txt +0 -0
- {aw-cli-1.8.1 → aw_cli-2.1}/awcli/__init__.py +0 -0
- {aw-cli-1.8.1 → aw_cli-2.1}/setup.cfg +0 -0
- {aw-cli-1.8.1 → aw_cli-2.1}/tests/test_anime.py +0 -0
- {aw-cli-1.8.1 → aw_cli-2.1}/tests/test_utilities.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: aw-cli
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.1
|
|
4
4
|
Summary: guarda anime dal terminale e molto altro!
|
|
5
5
|
Home-page: https://github.com/fexh10/aw-cli
|
|
6
6
|
Author: fexh10
|
|
@@ -8,12 +8,19 @@ License: GPL-3.0
|
|
|
8
8
|
Requires-Python: >3.10
|
|
9
9
|
Description-Content-Type: text/markdown
|
|
10
10
|
License-File: LICENSE
|
|
11
|
-
Requires-Dist: bs4
|
|
12
11
|
Requires-Dist: requests
|
|
13
12
|
Requires-Dist: lxml
|
|
14
13
|
Requires-Dist: pySmartDL
|
|
15
14
|
Requires-Dist: wheel
|
|
16
15
|
Requires-Dist: regex
|
|
16
|
+
Dynamic: author
|
|
17
|
+
Dynamic: description
|
|
18
|
+
Dynamic: description-content-type
|
|
19
|
+
Dynamic: home-page
|
|
20
|
+
Dynamic: license
|
|
21
|
+
Dynamic: requires-dist
|
|
22
|
+
Dynamic: requires-python
|
|
23
|
+
Dynamic: summary
|
|
17
24
|
|
|
18
25
|
# aw-cli
|
|
19
26
|
<h3 align="center">
|
|
@@ -23,7 +30,7 @@ Guarda anime dal terminale e molto altro!<br /> Gli anime vengono presi da <a hr
|
|
|
23
30
|
</h3>
|
|
24
31
|
|
|
25
32
|
## Anteprima
|
|
26
|
-
https://
|
|
33
|
+
https://github.com/fexh10/aw-cli/assets/90156014/88e1c2e2-bb7f-4002-8784-26f70861e164
|
|
27
34
|
|
|
28
35
|
## Indice
|
|
29
36
|
|
|
@@ -41,6 +48,8 @@ https://user-images.githubusercontent.com/90156014/210212814-e73ba7af-ce12-43ad-
|
|
|
41
48
|
|
|
42
49
|
Lo script funziona sia con [MPV](https://mpv.io/installation/) che con [VLC](https://www.videolan.org/vlc/index.it.html). <br />
|
|
43
50
|
|
|
51
|
+
È richiesta l'installazione di [fzf](https://github.com/junegunn/fzf?tab=readme-ov-file#installation).<br />
|
|
52
|
+
|
|
44
53
|
<details><summary><b>Linux, MacOS</b></summary>
|
|
45
54
|
È possibile installare aw-cli da pip:
|
|
46
55
|
|
|
@@ -60,21 +69,13 @@ L'ultima versione per Windows richiede installare <a href="https://learn.microso
|
|
|
60
69
|
```
|
|
61
70
|
wsl --install
|
|
62
71
|
```
|
|
63
|
-
Per installare MPV su WSL, basta eseguire:
|
|
64
|
-
```
|
|
65
|
-
sudo apt install mpv
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
Per VLC:
|
|
69
|
-
```
|
|
70
|
-
sudo apt install vlc
|
|
71
|
-
```
|
|
72
72
|
|
|
73
73
|
Il programma dovrà essere installato e avviato da WSL:
|
|
74
74
|
|
|
75
75
|
```
|
|
76
76
|
python3 -m pip install aw-cli
|
|
77
77
|
```
|
|
78
|
+
|
|
78
79
|
</details>
|
|
79
80
|
<details><summary><b>Versione Legacy</b></summary>
|
|
80
81
|
Per installare la versione Legacy, è necessario avere <a href="https://www.git-scm.com/download/win">git</a>.
|
|
@@ -6,7 +6,7 @@ Guarda anime dal terminale e molto altro!<br /> Gli anime vengono presi da <a hr
|
|
|
6
6
|
</h3>
|
|
7
7
|
|
|
8
8
|
## Anteprima
|
|
9
|
-
https://
|
|
9
|
+
https://github.com/fexh10/aw-cli/assets/90156014/88e1c2e2-bb7f-4002-8784-26f70861e164
|
|
10
10
|
|
|
11
11
|
## Indice
|
|
12
12
|
|
|
@@ -24,6 +24,8 @@ https://user-images.githubusercontent.com/90156014/210212814-e73ba7af-ce12-43ad-
|
|
|
24
24
|
|
|
25
25
|
Lo script funziona sia con [MPV](https://mpv.io/installation/) che con [VLC](https://www.videolan.org/vlc/index.it.html). <br />
|
|
26
26
|
|
|
27
|
+
È richiesta l'installazione di [fzf](https://github.com/junegunn/fzf?tab=readme-ov-file#installation).<br />
|
|
28
|
+
|
|
27
29
|
<details><summary><b>Linux, MacOS</b></summary>
|
|
28
30
|
È possibile installare aw-cli da pip:
|
|
29
31
|
|
|
@@ -43,21 +45,13 @@ L'ultima versione per Windows richiede installare <a href="https://learn.microso
|
|
|
43
45
|
```
|
|
44
46
|
wsl --install
|
|
45
47
|
```
|
|
46
|
-
Per installare MPV su WSL, basta eseguire:
|
|
47
|
-
```
|
|
48
|
-
sudo apt install mpv
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Per VLC:
|
|
52
|
-
```
|
|
53
|
-
sudo apt install vlc
|
|
54
|
-
```
|
|
55
48
|
|
|
56
49
|
Il programma dovrà essere installato e avviato da WSL:
|
|
57
50
|
|
|
58
51
|
```
|
|
59
52
|
python3 -m pip install aw-cli
|
|
60
53
|
```
|
|
54
|
+
|
|
61
55
|
</details>
|
|
62
56
|
<details><summary><b>Versione Legacy</b></summary>
|
|
63
57
|
Per installare la versione Legacy, è necessario avere <a href="https://www.git-scm.com/download/win">git</a>.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: aw-cli
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.1
|
|
4
4
|
Summary: guarda anime dal terminale e molto altro!
|
|
5
5
|
Home-page: https://github.com/fexh10/aw-cli
|
|
6
6
|
Author: fexh10
|
|
@@ -8,12 +8,19 @@ License: GPL-3.0
|
|
|
8
8
|
Requires-Python: >3.10
|
|
9
9
|
Description-Content-Type: text/markdown
|
|
10
10
|
License-File: LICENSE
|
|
11
|
-
Requires-Dist: bs4
|
|
12
11
|
Requires-Dist: requests
|
|
13
12
|
Requires-Dist: lxml
|
|
14
13
|
Requires-Dist: pySmartDL
|
|
15
14
|
Requires-Dist: wheel
|
|
16
15
|
Requires-Dist: regex
|
|
16
|
+
Dynamic: author
|
|
17
|
+
Dynamic: description
|
|
18
|
+
Dynamic: description-content-type
|
|
19
|
+
Dynamic: home-page
|
|
20
|
+
Dynamic: license
|
|
21
|
+
Dynamic: requires-dist
|
|
22
|
+
Dynamic: requires-python
|
|
23
|
+
Dynamic: summary
|
|
17
24
|
|
|
18
25
|
# aw-cli
|
|
19
26
|
<h3 align="center">
|
|
@@ -23,7 +30,7 @@ Guarda anime dal terminale e molto altro!<br /> Gli anime vengono presi da <a hr
|
|
|
23
30
|
</h3>
|
|
24
31
|
|
|
25
32
|
## Anteprima
|
|
26
|
-
https://
|
|
33
|
+
https://github.com/fexh10/aw-cli/assets/90156014/88e1c2e2-bb7f-4002-8784-26f70861e164
|
|
27
34
|
|
|
28
35
|
## Indice
|
|
29
36
|
|
|
@@ -41,6 +48,8 @@ https://user-images.githubusercontent.com/90156014/210212814-e73ba7af-ce12-43ad-
|
|
|
41
48
|
|
|
42
49
|
Lo script funziona sia con [MPV](https://mpv.io/installation/) che con [VLC](https://www.videolan.org/vlc/index.it.html). <br />
|
|
43
50
|
|
|
51
|
+
È richiesta l'installazione di [fzf](https://github.com/junegunn/fzf?tab=readme-ov-file#installation).<br />
|
|
52
|
+
|
|
44
53
|
<details><summary><b>Linux, MacOS</b></summary>
|
|
45
54
|
È possibile installare aw-cli da pip:
|
|
46
55
|
|
|
@@ -60,21 +69,13 @@ L'ultima versione per Windows richiede installare <a href="https://learn.microso
|
|
|
60
69
|
```
|
|
61
70
|
wsl --install
|
|
62
71
|
```
|
|
63
|
-
Per installare MPV su WSL, basta eseguire:
|
|
64
|
-
```
|
|
65
|
-
sudo apt install mpv
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
Per VLC:
|
|
69
|
-
```
|
|
70
|
-
sudo apt install vlc
|
|
71
|
-
```
|
|
72
72
|
|
|
73
73
|
Il programma dovrà essere installato e avviato da WSL:
|
|
74
74
|
|
|
75
75
|
```
|
|
76
76
|
python3 -m pip install aw-cli
|
|
77
77
|
```
|
|
78
|
+
|
|
78
79
|
</details>
|
|
79
80
|
<details><summary><b>Versione Legacy</b></summary>
|
|
80
81
|
Per installare la versione Legacy, è necessario avere <a href="https://www.git-scm.com/download/win">git</a>.
|
|
@@ -10,74 +10,42 @@ class TokenError(Exception):
|
|
|
10
10
|
pass
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
def
|
|
13
|
+
def updateAnilist(id_anilist: int, ep: int, status_list: str, score: float, favourite: bool = False) -> None:
|
|
14
14
|
"""
|
|
15
|
-
Collegamento alle API di AniList per aggiornare
|
|
16
|
-
automaticamente gli anime.
|
|
17
|
-
|
|
18
|
-
Args:
|
|
19
|
-
id_anilist (int): l'id dell'anime su AniList.
|
|
20
|
-
ep (int): il numero dell'episodio visualizzato.
|
|
21
|
-
voto (float): il voto dell'anime.
|
|
22
|
-
"""
|
|
23
|
-
|
|
24
|
-
query = """
|
|
25
|
-
mutation ($idAnime: Int, $status: MediaListStatus, $episodio : Int, $score: Float) {
|
|
26
|
-
SaveMediaListEntry (mediaId: $idAnime, status: $status, progress : $episodio, score: $score) {
|
|
27
|
-
status
|
|
28
|
-
progress
|
|
29
|
-
score
|
|
30
|
-
},
|
|
31
|
-
ToggleFavourite(animeId:$idAnime){
|
|
32
|
-
anime {
|
|
33
|
-
nodes {
|
|
34
|
-
id
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
"""
|
|
40
|
-
|
|
41
|
-
var = {
|
|
42
|
-
"idAnime": id_anilist,
|
|
43
|
-
"status": "COMPLETED",
|
|
44
|
-
"episodio": ep,
|
|
45
|
-
"score": voto
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
requestModifyAnilist(query, var)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
def addToAnilist(id_anilist: int, ep: int, status_list: str, voto: float) -> None:
|
|
52
|
-
"""
|
|
53
|
-
Collegamento alle API di AniList per aggiornare
|
|
54
|
-
automaticamente gli anime.
|
|
15
|
+
Collegamento alle API di AniList per aggiornare lo stato dell'anime
|
|
55
16
|
|
|
56
17
|
Args:
|
|
57
18
|
id_anilist (int): l'id dell'anime su AniList.
|
|
58
19
|
ep (int): il numero dell'episodio visualizzato.
|
|
59
20
|
voto (float): il voto dell'anime.
|
|
60
21
|
status_list (str): lo stato dell'anime per l'utente. Se è in corso verrà impostato su "CURRENT", se completato su "COMPLETED".
|
|
22
|
+
favourite (bool): se True, aggiunge l'anime ai preferiti.
|
|
61
23
|
"""
|
|
62
|
-
|
|
63
24
|
query = """
|
|
64
|
-
mutation ($idAnime: Int, $status: MediaListStatus, $
|
|
65
|
-
SaveMediaListEntry (mediaId: $idAnime, status: $status, progress : $
|
|
25
|
+
mutation ($idAnime: Int, $status: MediaListStatus, $episode : Int, $score: Float) {
|
|
26
|
+
SaveMediaListEntry (mediaId: $idAnime, status: $status, progress : $episode, score: $score) {
|
|
66
27
|
status
|
|
67
28
|
progress
|
|
68
29
|
score
|
|
69
|
-
}
|
|
30
|
+
},""" + ("""
|
|
31
|
+
ToggleFavourite(animeId:$idAnime){
|
|
32
|
+
anime {
|
|
33
|
+
nodes {
|
|
34
|
+
id
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}""" if favourite else "") + """
|
|
70
38
|
}
|
|
71
39
|
"""
|
|
72
40
|
|
|
73
41
|
var = {
|
|
74
42
|
"idAnime": id_anilist,
|
|
75
43
|
"status": status_list,
|
|
76
|
-
"
|
|
44
|
+
"episode": ep,
|
|
77
45
|
}
|
|
78
46
|
|
|
79
|
-
if
|
|
80
|
-
var["score"] =
|
|
47
|
+
if score != 0:
|
|
48
|
+
var["score"] = score
|
|
81
49
|
|
|
82
50
|
requestModifyAnilist(query, var)
|
|
83
51
|
|
|
@@ -109,7 +77,7 @@ def getAnilistUserId() -> int:
|
|
|
109
77
|
return user_id
|
|
110
78
|
|
|
111
79
|
|
|
112
|
-
def getAnimePrivateRating(id_anime: int) ->
|
|
80
|
+
def getAnimePrivateRating(id_anime: int) -> (float | None):
|
|
113
81
|
"""
|
|
114
82
|
Collegamento alle API di AniList per trovare
|
|
115
83
|
il voto dato all'anime dall'utente.
|
|
@@ -118,7 +86,7 @@ def getAnimePrivateRating(id_anime: int) -> int:
|
|
|
118
86
|
id_anime (int): l'id dell'anime su Anilist.
|
|
119
87
|
|
|
120
88
|
Returns:
|
|
121
|
-
|
|
89
|
+
float: il voto dell'utente.
|
|
122
90
|
"""
|
|
123
91
|
|
|
124
92
|
query = """
|
|
@@ -140,9 +108,9 @@ def getAnimePrivateRating(id_anime: int) -> int:
|
|
|
140
108
|
|
|
141
109
|
risposta = requests.post('https://graphql.anilist.co',headers=header_anilist, json={'query': query, 'variables': var})
|
|
142
110
|
if risposta.status_code != 200:
|
|
143
|
-
return
|
|
111
|
+
return None
|
|
144
112
|
|
|
145
|
-
return
|
|
113
|
+
return float(risposta.json()["data"]["MediaList"]["score"])
|
|
146
114
|
|
|
147
115
|
|
|
148
116
|
def requestModifyAnilist(query: str, var: dict):
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from collections import defaultdict
|
|
1
2
|
import awcli.utilities as utilities
|
|
2
3
|
|
|
3
4
|
class Anime:
|
|
@@ -14,7 +15,8 @@ class Anime:
|
|
|
14
15
|
def __init__(self, name, url, ep=0, ep_totali="") -> None:
|
|
15
16
|
self.name = name
|
|
16
17
|
self.url = url
|
|
17
|
-
self.ep_corrente = ep
|
|
18
|
+
self.ep_corrente = ep-1
|
|
19
|
+
self.progress = defaultdict(int)
|
|
18
20
|
self.ep = ep
|
|
19
21
|
self.ep_totali = ep_totali
|
|
20
22
|
self.ep_ini = 1
|
|
@@ -98,14 +100,14 @@ class Anime:
|
|
|
98
100
|
utilities.my_print("Stato: ", end="", color="azzurro")
|
|
99
101
|
match self.status:
|
|
100
102
|
case 0:
|
|
101
|
-
utilities.my_print("Finito", format=0)
|
|
102
|
-
case 1:
|
|
103
103
|
utilities.my_print("In corso", format=0)
|
|
104
|
+
case 1:
|
|
105
|
+
utilities.my_print("Finito", format=0)
|
|
104
106
|
case 2:
|
|
105
107
|
utilities.my_print("Non rilasciato", format=0)
|
|
106
108
|
utilities.my_print("Visualizzazioni: ", end="", color="azzurro")
|
|
107
109
|
utilities.my_print(self.views, format=0)
|
|
108
110
|
utilities.my_print("Trama: ", end="", color="azzurro")
|
|
109
|
-
utilities.my_print(self.plot, format=0)
|
|
111
|
+
utilities.my_print(self.plot, end="\n\n", format=0)
|
|
110
112
|
|
|
111
113
|
|