forked from vadyur/script.media.aggregator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.py
161 lines (130 loc) · 5.4 KB
/
settings.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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# -*- coding: utf-8 -*-
import os, filesystem
class QulityType:
Q720 = '720p'
Q1080 = '1080'
Q2160 = '2160'
class CodecType:
MPGSD = 'MPEG2/MPEG4 ASP'
MPGHD = 'H264/AVC'
MPGUHD = 'H265/HEVC'
class TorrentPlayer:
YATP = 'YATP'
TORR2HTTP = 'torrent2http'
class FakeProgressDlg(object):
def update(self, *args):
pass
_addon_name = '[COLOR=FF008000]Media[/COLOR] [COLOR=FFA0522D]Aggregator[/COLOR]'
class Settings:
# feed=dl&
base_url = 'http://hdclub.org/rss.php'
current_settings = None
def __init__(self, base_path,
movies_path = u'Movies',
animation_path = u'Animation',
documentary_path = u'Documentary',
anime_path = u'Anime',
hdclub_passkey = '',
bluebird_passkey = None, bluebird_preload_torrents = False, bluebird_login = '', bluebird_password = '', bluebird_nouhd = True,
anidub_login = '', anidub_password = '', anidub_rss=True, anidub_favorite=True,
nnmclub_login = '', nnmclub_password = '', nnmclub_pages = 1, nnmclub_hours=168, nnmclub_domain='nnm-club.me', nnmclub_use_ssl=False,
rutor_domain = 'rutor.info',
rutor_filter = 'CAMRip TS TC VHSRip TVRip SATRip IPTVRip HDTV HDTVRip WEBRip DVD5 DVD9 DVDRip Blu-Ray SuperTS SCR VHSScr DVDScr WP',
soap4me_login = '', soap4me_password = '', soap4me_rss='',
preffered_bitrate = 10000, preffered_type = QulityType.Q1080, preffered_codec = CodecType.MPGHD,
torrent_player = TorrentPlayer.YATP, storage_path = '',
movies_save = True,
animation_save = True,
documentary_save = True,
anime_save = True,
tvshows_save = True,
animation_tvshows_save = True,
torrent_path = '',
addon_data_path = '',
kp_googlecache = False,
kp_usezaborona = False,
rutor_nosd = True):
#--------------------------------------------------------------------------------
Settings.current_settings = self
#--------------------------------------------------------------------------------
self.movies_url = self.base_url + '?cat=71&passkey=' + hdclub_passkey
self.animation_url = self.base_url + '?cat=70&passkey=' + hdclub_passkey
self.documentary_url = self.base_url + '?cat=78&passkey=' + hdclub_passkey
self.hdclub_passkey = hdclub_passkey
self.bluebird_passkey = bluebird_passkey
self.bluebird_login = bluebird_login
self.bluebird_password = bluebird_password
self.bluebird_preload_torrents = bluebird_preload_torrents
self.bluebird_nouhd = bluebird_nouhd
self.__base_path = filesystem.abspath(base_path)
self.__movies_path = movies_path
self.__animation_path = animation_path
self.__documentary_path = documentary_path
self.anidub_url = 'http://tr.anidub.com/rss.xml'
self.__anime_tvshow_path = anime_path
self.anidub_login = anidub_login
self.anidub_password = anidub_password
self.anidub_rss = anidub_rss
self.anidub_favorite = anidub_favorite
self.nnmclub_domain = nnmclub_domain
self.nnmclub_use_ssl = nnmclub_use_ssl
self.nnmclub_login = nnmclub_login
self.nnmclub_password = nnmclub_password
self.nnmclub_pages = nnmclub_pages
self.nnmclub_hours = nnmclub_hours
self.use_kinopoisk = True
self.use_worldart = True
self.show_sources = False
self.rutor_domain = rutor_domain
self.rutor_filter = rutor_filter
self.soap4me_login = soap4me_login
self.soap4me_password = soap4me_password
self.soap4me_rss = soap4me_rss
self.preffered_bitrate = preffered_bitrate
self.preffered_type = preffered_type
self.preffered_codec = preffered_codec if preffered_codec else CodecType.MPGHD
self.torrent_player = torrent_player
self.storage_path = storage_path
self.movies_save = movies_save
self.animation_save = animation_save
self.documentary_save = documentary_save
self.anime_save = anime_save
self.tvshows_save = tvshows_save
self.animation_tvshows_save = animation_tvshows_save
self.torrent_path = torrent_path
self.addon_data_path = addon_data_path
self.kp_googlecache = kp_googlecache
self.kp_usezaborona = kp_usezaborona
self.rutor_nosd = rutor_nosd
self.progress_dialog = FakeProgressDlg()
def __repr__(self):
attrs = vars(self)
#return ', \n'.join("%s: %s" % item for item in attrs.items() )
result = ''
for key, value in attrs.items():
if 'pass' in key:
continue
if result != '':
result += '\n'
key = key.replace('_Settings__', '')
result += "%s: %s" % (key, value)
return result
@property
def addon_name(self):
return _addon_name
def base_path(self):
return self.__base_path
def movies_path(self):
return filesystem.join(self.__base_path, self.__movies_path)
def animation_path(self):
return filesystem.join(self.__base_path, self.__animation_path)
def documentary_path(self):
return filesystem.join(self.__base_path, self.__documentary_path)
def anime_tvshow_path(self):
return filesystem.join(self.__base_path, self.__anime_tvshow_path)
def animation_tvshow_path(self):
return filesystem.join(self.__base_path, 'Animation TVShows')
def tvshow_path(self):
return filesystem.join(self.__base_path, 'TVShows')
def torrents_path(self):
return self.torrent_path if self.torrent_path else self.addon_data_path