Skip to content

Commit

Permalink
Normalize line endings to avoid line endings merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
stickell committed Jul 21, 2013
1 parent 560bbc5 commit 37d898f
Show file tree
Hide file tree
Showing 41 changed files with 4,697 additions and 4,676 deletions.
21 changes: 21 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Set default behaviour, in case users don't have core.autocrlf set.
* text=auto

# Explicitly declare text files we want to always be normalized and converted
# to native line endings on checkout.
*.py text
*.js text
*.po text
*.cfg text
*.md text
*.in text
*.txt text
*.sh text
*.json text
*.html text
.htm text

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.mo binary
130 changes: 65 additions & 65 deletions module/config/default.conf
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
version: 1
remote - "Remote":
int port : "Port" = 7227
ip listenaddr : "Adress" = 0.0.0.0
bool nolocalauth : "No authentication on local connections" = True
bool activated : "Activated" = True
ssl - "SSL":
bool activated : "Activated"= False
file cert : "SSL Certificate" = ssl.crt
file key : "SSL Key" = ssl.key
webinterface - "Webinterface":
bool activated : "Activated" = True
builtin;threaded;fastcgi;lightweight server : "Server" = builtin
bool https : "Use HTTPS" = False
ip host : "IP" = 0.0.0.0
int port : "Port" = 8001
str template : "Template" = default
str prefix: "Path Prefix" =
log - "Log":
bool file_log : "File Log" = True
folder log_folder : "Folder" = Logs
int log_count : "Count" = 5
int log_size : "Size in kb" = 100
bool log_rotate : "Log Rotate" = True
general - "General":
en;de;fr;it;es;nl;sv;ru;pl;cs;sr;pt_BR language : "Language" = en
folder download_folder : "Download Folder" = Downloads
bool debug_mode : "Debug Mode" = False
bool checksum : "Use Checksum" = False
int min_free_space : "Min Free Space (MB)" = 200
bool folder_per_package : "Create folder for each package" = True
int renice : "CPU Priority" = 0
download - "Download":
int chunks : "Max connections for one download" = 3
int max_downloads : "Max Parallel Downloads" = 3
int max_speed : "Max Download Speed in kb/s" = -1
bool limit_speed : "Limit Download Speed" = False
str interface : "Download interface to bind (ip or Name)" = None
bool ipv6 : "Allow IPv6" = False
bool skip_existing : "Skip already existing files" = False
permission - "Permissions":
bool change_user : "Change user of running process" = False
str user : "Username" = user
str folder : "Folder Permission mode" = 0755
bool change_file : "Change file mode of downloads" = False
str file : "Filemode for Downloads" = 0644
bool change_group : "Change group of running process" = False
str group : "Groupname" = users
bool change_dl : "Change Group and User of Downloads" = False
reconnect - "Reconnect":
bool activated : "Use Reconnect" = False
str method : "Method" = None
time startTime : "Start" = 0:00
time endTime : "End" = 0:00
downloadTime - "Download Time":
time start : "Start" = 0:00
time end : "End" = 0:00
proxy - "Proxy":
str address : "Address" = "localhost"
int port : "Port" = 7070
http;socks4;socks5 type : "Protocol" = http
str username : "Username" = None
password password : "Password" = None
bool proxy : "Use Proxy" = False
version: 1

remote - "Remote":
int port : "Port" = 7227
ip listenaddr : "Adress" = 0.0.0.0
bool nolocalauth : "No authentication on local connections" = True
bool activated : "Activated" = True
ssl - "SSL":
bool activated : "Activated"= False
file cert : "SSL Certificate" = ssl.crt
file key : "SSL Key" = ssl.key
webinterface - "Webinterface":
bool activated : "Activated" = True
builtin;threaded;fastcgi;lightweight server : "Server" = builtin
bool https : "Use HTTPS" = False
ip host : "IP" = 0.0.0.0
int port : "Port" = 8001
str template : "Template" = default
str prefix: "Path Prefix" =
log - "Log":
bool file_log : "File Log" = True
folder log_folder : "Folder" = Logs
int log_count : "Count" = 5
int log_size : "Size in kb" = 100
bool log_rotate : "Log Rotate" = True
general - "General":
en;de;fr;it;es;nl;sv;ru;pl;cs;sr;pt_BR language : "Language" = en
folder download_folder : "Download Folder" = Downloads
bool debug_mode : "Debug Mode" = False
bool checksum : "Use Checksum" = False
int min_free_space : "Min Free Space (MB)" = 200
bool folder_per_package : "Create folder for each package" = True
int renice : "CPU Priority" = 0
download - "Download":
int chunks : "Max connections for one download" = 3
int max_downloads : "Max Parallel Downloads" = 3
int max_speed : "Max Download Speed in kb/s" = -1
bool limit_speed : "Limit Download Speed" = False
str interface : "Download interface to bind (ip or Name)" = None
bool ipv6 : "Allow IPv6" = False
bool skip_existing : "Skip already existing files" = False
permission - "Permissions":
bool change_user : "Change user of running process" = False
str user : "Username" = user
str folder : "Folder Permission mode" = 0755
bool change_file : "Change file mode of downloads" = False
str file : "Filemode for Downloads" = 0644
bool change_group : "Change group of running process" = False
str group : "Groupname" = users
bool change_dl : "Change Group and User of Downloads" = False
reconnect - "Reconnect":
bool activated : "Use Reconnect" = False
str method : "Method" = None
time startTime : "Start" = 0:00
time endTime : "End" = 0:00
downloadTime - "Download Time":
time start : "Start" = 0:00
time end : "End" = 0:00
proxy - "Proxy":
str address : "Address" = "localhost"
int port : "Port" = 7070
http;socks4;socks5 type : "Protocol" = http
str username : "Username" = None
password password : "Password" = None
bool proxy : "Use Proxy" = False
78 changes: 39 additions & 39 deletions module/plugins/accounts/AlldebridCom.py
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
from module.plugins.Account import Account
import xml.dom.minidom as dom
from BeautifulSoup import BeautifulSoup
from time import time
import re
from module.plugins.Account import Account
import xml.dom.minidom as dom
from BeautifulSoup import BeautifulSoup
from time import time
import re
import urllib

class AlldebridCom(Account):
__name__ = "AlldebridCom"
__version__ = "0.21"
__type__ = "account"
__description__ = """AllDebrid.com account plugin"""
__author_name__ = ("Andy, Voigt")
__author_mail__ = ("[email protected]")

def loadAccountInfo(self, user, req):
data = self.getAccountData(user)
page = req.load("http://www.alldebrid.com/account/")
soup=BeautifulSoup(page)
#Try to parse expiration date directly from the control panel page (better accuracy)
try:
time_text=soup.find('div',attrs={'class':'remaining_time_text'}).strong.string
self.log.debug("Account expires in: %s" % time_text)
p = re.compile('\d+')
exp_data=p.findall(time_text)
exp_time=time()+int(exp_data[0])*24*60*60+int(exp_data[1])*60*60+(int(exp_data[2])-1)*60
#Get expiration date from API
except:
data = self.getAccountData(user)
page = req.load("http://www.alldebrid.com/api.php?action=info_user&login=%s&pw=%s" % (user, data["password"]))
self.log.debug(page)
xml = dom.parseString(page)
exp_time=time()+int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue)*86400
account_info = {"validuntil": exp_time, "trafficleft": -1}
return account_info

def login(self, user, data, req):

class AlldebridCom(Account):
__name__ = "AlldebridCom"
__version__ = "0.21"
__type__ = "account"
__description__ = """AllDebrid.com account plugin"""
__author_name__ = ("Andy, Voigt")
__author_mail__ = ("[email protected]")

def loadAccountInfo(self, user, req):
data = self.getAccountData(user)
page = req.load("http://www.alldebrid.com/account/")
soup=BeautifulSoup(page)
#Try to parse expiration date directly from the control panel page (better accuracy)
try:
time_text=soup.find('div',attrs={'class':'remaining_time_text'}).strong.string
self.log.debug("Account expires in: %s" % time_text)
p = re.compile('\d+')
exp_data=p.findall(time_text)
exp_time=time()+int(exp_data[0])*24*60*60+int(exp_data[1])*60*60+(int(exp_data[2])-1)*60
#Get expiration date from API
except:
data = self.getAccountData(user)
page = req.load("http://www.alldebrid.com/api.php?action=info_user&login=%s&pw=%s" % (user, data["password"]))
self.log.debug(page)
xml = dom.parseString(page)
exp_time=time()+int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue)*86400
account_info = {"validuntil": exp_time, "trafficleft": -1}
return account_info

def login(self, user, data, req):

urlparams = urllib.urlencode({'action':'login','login_login':user,'login_password':data["password"]})
page = req.load("http://www.alldebrid.com/register/?%s" % (urlparams))

if "This login doesn't exist" in page:
self.wrongPassword()

if "This login doesn't exist" in page:
self.wrongPassword()

if "The password is not valid" in page:
self.wrongPassword()
Expand Down
44 changes: 22 additions & 22 deletions module/plugins/accounts/Premium4Me.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
from module.plugins.Account import Account

class Premium4Me(Account):
__name__ = "Premium4Me"
__version__ = "0.03"
__type__ = "account"
__description__ = """Premium.to account plugin"""
__author_name__ = ("RaNaN", "zoidberg", "stickell")
__author_mail__ = ("[email protected]", "[email protected]", "[email protected]")

def loadAccountInfo(self, user, req):
traffic = req.load("http://premium.to/api/traffic.php?authcode=%s" % self.authcode)

account_info = {"trafficleft": int(traffic) / 1024,
"validuntil": -1}

return account_info

def login(self, user, data, req):
self.authcode = req.load("http://premium.to/api/getauthcode.php?username=%s&password=%s" % (user, data["password"])).strip()

if "wrong username" in self.authcode:
from module.plugins.Account import Account

class Premium4Me(Account):
__name__ = "Premium4Me"
__version__ = "0.03"
__type__ = "account"
__description__ = """Premium.to account plugin"""
__author_name__ = ("RaNaN", "zoidberg", "stickell")
__author_mail__ = ("[email protected]", "[email protected]", "[email protected]")

def loadAccountInfo(self, user, req):
traffic = req.load("http://premium.to/api/traffic.php?authcode=%s" % self.authcode)

account_info = {"trafficleft": int(traffic) / 1024,
"validuntil": -1}

return account_info

def login(self, user, data, req):
self.authcode = req.load("http://premium.to/api/getauthcode.php?username=%s&password=%s" % (user, data["password"])).strip()

if "wrong username" in self.authcode:
self.wrongPassword()
88 changes: 44 additions & 44 deletions module/plugins/accounts/PremiumizeMe.py
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
from module.plugins.Account import Account

from module.common.json_layer import json_loads

class PremiumizeMe(Account):
__name__ = "PremiumizeMe"
__version__ = "0.11"
__type__ = "account"
__description__ = """Premiumize.Me account plugin"""

__author_name__ = ("Florian Franzen")
__author_mail__ = ("[email protected]")

def loadAccountInfo(self, user, req):

# Get user data from premiumize.me
status = self.getAccountStatus(user, req)
self.logDebug(status)

# Parse account info
account_info = {"validuntil": float(status['result']['expires']),
"trafficleft": max(0, status['result']['trafficleft_bytes'] / 1024)}

if status['result']['type'] == 'free':
account_info['premium'] = False

return account_info

def login(self, user, data, req):

# Get user data from premiumize.me
status = self.getAccountStatus(user, req)

# Check if user and password are valid
if status['status'] != 200:
self.wrongPassword()


def getAccountStatus(self, user, req):

# Use premiumize.me API v1 (see https://secure.premiumize.me/?show=api) to retrieve account info and return the parsed json answer
answer = req.load("https://api.premiumize.me/pm-api/v1.php?method=accountstatus&params[login]=%s&params[pass]=%s" % (user, self.accounts[user]['password']))
return json_loads(answer)

from module.plugins.Account import Account

from module.common.json_layer import json_loads

class PremiumizeMe(Account):
__name__ = "PremiumizeMe"
__version__ = "0.11"
__type__ = "account"
__description__ = """Premiumize.Me account plugin"""

__author_name__ = ("Florian Franzen")
__author_mail__ = ("[email protected]")

def loadAccountInfo(self, user, req):

# Get user data from premiumize.me
status = self.getAccountStatus(user, req)
self.logDebug(status)

# Parse account info
account_info = {"validuntil": float(status['result']['expires']),
"trafficleft": max(0, status['result']['trafficleft_bytes'] / 1024)}

if status['result']['type'] == 'free':
account_info['premium'] = False

return account_info

def login(self, user, data, req):

# Get user data from premiumize.me
status = self.getAccountStatus(user, req)

# Check if user and password are valid
if status['status'] != 200:
self.wrongPassword()


def getAccountStatus(self, user, req):

# Use premiumize.me API v1 (see https://secure.premiumize.me/?show=api) to retrieve account info and return the parsed json answer
answer = req.load("https://api.premiumize.me/pm-api/v1.php?method=accountstatus&params[login]=%s&params[pass]=%s" % (user, self.accounts[user]['password']))
return json_loads(answer)

Loading

0 comments on commit 37d898f

Please sign in to comment.