Skip to content

Commit

Permalink
0.0.1 - Build 0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rix1337 committed Nov 7, 2018
1 parent badfdf4 commit 77cf67b
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ venv

# PyCharm
.idea

# MyJD API files
*.conf
*.ini
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions myjd-api/myjdapi.py → myjd_api/myjdapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ def action(self, path, params=(), http_action="POST"):
action_url = self.__action_url()
if not self.__direct_connection_enabled or self.__direct_connection_info is None \
or time.time() < self.__direct_connection_cooldown:
# No direct connection available, we use My.JDownloader myjd-api.
# No direct connection available, we use My.JDownloader myjd_api.
response = self.myjd.request_api(path, http_action, params,
action_url)
if response is None:
Expand All @@ -750,7 +750,7 @@ def action(self, path, params=(), http_action="POST"):
connection = conn['conn']
api = "http://" + connection["ip"] + ":" + str(
connection["port"])
# if self.myjd-api.request_api("/device/ping", "POST", None, self.__action_url(), myjd-api):
# if self.myjd_api.request_api("/device/ping", "POST", None, self.__action_url(), myjd_api):
response = self.myjd.request_api(path, http_action, params,
action_url, api)
if response is not None:
Expand All @@ -766,7 +766,7 @@ def action(self, path, params=(), http_action="POST"):
self.__direct_connection_consecutive_failures += 1
self.__direct_connection_cooldown = time.time() + \
(60 * self.__direct_connection_consecutive_failures)
# None of the direct connections worked, we use the My.JDownloader myjd-api
# None of the direct connections worked, we use the My.JDownloader myjd_api
response = self.myjd.request_api(path, http_action, params,
action_url)
if response is None:
Expand All @@ -789,11 +789,11 @@ class Myjdapi:

def __init__(self):
"""
This functions initializates the myjd-api object.
This functions initializates the myjd_api object.
"""
self.__request_id = int(time.time() * 1000)
self.__api_url = "https://myjd-api.jdownloader.org"
self.__api_url = "https://myjd_api.jdownloader.org"
self.__app_key = "http://git.io/vmcsk"
self.__api_version = 1
self.__devices = None
Expand Down Expand Up @@ -897,7 +897,7 @@ def update_request_id(self):
self.__request_id = int(time.time())

def connect(self, email, password):
"""Establish connection to myjd-api
"""Establish connection to myjd_api
:param email: My.Jdownloader User email
:param password: My.Jdownloader User password
Expand Down Expand Up @@ -1020,7 +1020,7 @@ def request_api(self,
params={"test":"test"}
post_params={"test2":"test2"}
action=True
This would make a request to "https://myjd-api.jdownloader.org"
This would make a request to "https://myjd_api.jdownloader.org"
"""
if not api:
api = self.__api_url
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
required = f.read().splitlines()

setuptools.setup(
name="myjd-api",
name="myjd_api",
version="0.0.1",
author="rix1337",
author_email="",
description="A simple json interface for the MyJDownloader API",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/rix1337/myjd-api",
url="https://github.com/rix1337/myjd_api",
packages=setuptools.find_packages(),
include_package_data=True,
install_requires=required,
Expand All @@ -36,7 +36,7 @@
],
entry_points={
'console_scripts': [
'myjd-api = myjd-api.web:main',
'myjd_api = myjd_api.web:main',
],
},
)

0 comments on commit 77cf67b

Please sign in to comment.