Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config_example.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
plex_accessible_ip = 0.0.0.0
locast_username=username@example.com
locast_password=1234567
locast_clientid=api_client_id_here

#disable_ssdp = False
#plex_accessible_port = 6077
Expand Down
10 changes: 7 additions & 3 deletions lib/locast_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self, location):


@handle_url_except
def login(self, username, password):
def login(self, username, password, clientid):

# check environment vars
if (username is None):
Expand All @@ -44,15 +44,19 @@ def login(self, username, password):
print("Password not specified in config.ini. Exiting...")
return False

# login
if (clientid is None):
print("ClientID Token not specified in config.ini. Exiting...")
return False

# login
print("Logging into Locast using username " + username + "...")

# https://api.locastnet.org/api/user/login
# POST
# {"username":"thomas_vg1@hotmail.com","password":"xxxxxxxx"}


loginReq = urllib.request.Request('https://api.locastnet.org/api/user/login?client_id=9qXBrVzpTjUZmVGsZRnnWQ-7GvGeJ48QWtV9v%2Bbsen4%3D',
loginReq = urllib.request.Request('https://api.locastnet.org/api/user/login?client_id=' + clientid,
('{"username":"' + username + '","password":"' + password + '"}').encode("utf-8"),
{'Content-Type': 'application/json', 'User-agent': self.DEFAULT_USER_AGENT})

Expand Down
1 change: 1 addition & 0 deletions lib/user_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class UserConfig():
"cache_dir": None,
"locast_username": None,
"locast_password": None,
"locast_clientid": None,
'disable_ssdp': False,
'epg_update_frequency': 43200, # 12 hours
'epg_update_days': 7,
Expand Down