forked from lad1337/adba
-
Notifications
You must be signed in to change notification settings - Fork 2
/
groupstatus_test.py
executable file
·60 lines (51 loc) · 1.79 KB
/
groupstatus_test.py
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
#!/usr/bin/env python
#
# This file is part of aDBa.
#
# aDBa is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# aDBa is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with aDBa. If not, see <http://www.gnu.org/licenses/>.
import sys
import os
import getopt
from test_lib import *
####################################################
# here starts the stuff that is interresting for you
####################################################
# you only need to import the module
import adba
# lets see the version
print(adba.version)
# make a connection object
# log = True great for testing not so great for a running system (default is False)
connection = adba.Connection()
# we can always ping to see if we can reach the server
try:
connection.ping()
except Exception as e :
print(("exception msg: " + str(e)))
print("if we cant even ping stop right here")
exit()
# ok lets try to authenticate. we need username and pw for that
try:
connection.auth(user, pw)
pass
except Exception as e :
print(("exception msg: " + str(e)))
animeList = ["Bleach", "Naruto Shippuuden", "Blue Exorcist"]
for animeName in animeList:
print(("########################### " + animeName + " ###########################"))
anime = adba.Anime(connection, name=animeName, paramsA=['aid'], load=True)
groups = anime.get_groups()
for group in groups:
print(("- " + str(group)))
connection.logout()