aboutsummaryrefslogtreecommitdiff
path: root/readme.md
blob: def92044bef6aa58ea462b05c25555ed41069acf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# autonyaa

script that automatically adds new anime episodes from nyaa.si to a
transmission daemon, and symlinks them once they're done downloading

it's intentionally janky, because i don't expect it to work for a long time. if
it keeps working (well) for long enough i'll refactor/document the code better.

## configuration

autonyaa is configured through two files: configuration.an and
transmission.json. both have to be located in the same folder as the python
script itself. example config files are included.

transmission.json is a regular json file containing credentials for connecting
to the transmission daemon. note that if you've configured a localhost
whitelist for your transmission-daemon, that the `username` and `password` keys
can be either set to `null` or be omitted entirely.

configuration.an is a file with a custom key-value syntax for defining how
autonyaa should look up and match torrent titles. if you want to keep track of
multiple anime's, you can define multiple config sections by seperating them
with an empty line. here's a reference for all the configuration keys:

### name

```
name <string>
```

set the name and search query

### filename

```
filename <string>
```

set the filename for finished downloads. finished downloads are hard-linked
into [destination](#destination), with any variables replaced with values from
regex groups. for more info on variables, see [match-name](#match-name).

example:

```
filename Anime-name_s01e${e}.${x}
```

### match-name

```
match-name <regex> <groups>
```

filter torrent titles using regex. for a match to be successful, the entire
regex has to match. match groups are mapped onto the variable names defined
after the regex, and can be reused for the target filename.

example

```
match-name /\[coolgroup\] Anime name episode (\d{2}) - episode title \(1080p\)\.(.+)/ e x
```

> in this example, the variable e is set to the first group (`(\d{2})`), and x
> is set to (`(.+)`). for regex help, see [regexr](https://regexr.com)

### match-submitter

```
match-submitter <string>
```

filter torrent submitter using name.

example

```
match-name coolgroup
```

### destination

```
destination <folder>
```

destination folder

### episodes

```
episodes <var> <int>
```

limit episode download count using variable from [match-name](#match-name).

example

```
episodes e 12
```

## todo

- [x] implement episode limit
- [x] implement match-submitter