Fakelog URL fix
This commit is contained in:
parent
61f06fcb57
commit
effa320e2f
4 changed files with 18 additions and 18 deletions
|
@ -5,10 +5,10 @@ from bs4 import BeautifulSoup
|
|||
from .generate_cookies import autogenerate_cookies
|
||||
|
||||
def get_dashboard(register_id, students, s, diary_url, symbol):
|
||||
if diary_url != 'http://cufs.fakelog.cf/':
|
||||
if diary_url != 'http://cufs.fakelog.tk/':
|
||||
diary_url = 'http://uonetplus.vulcan.net.pl/'
|
||||
else:
|
||||
diary_url = 'http://uonetplus.fakelog.cf/'
|
||||
diary_url = 'http://uonetplus.fakelog.tk/'
|
||||
|
||||
cookies = autogenerate_cookies(students, s)
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@ def get_received_messages(register_id, students, oun, s, date, school_year, symb
|
|||
|
||||
now = calendar.timegm(time.gmtime())
|
||||
|
||||
if oun == 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458':
|
||||
received_messages = requests.get(f'http://uonetplus-uzytkownik.fakelog.cf/{symbol}/Wiadomosc.mvc/GetInboxMessages?_dc={now}&dataOd=&dataDo=&page=1&start=0&limit=25', headers=headers, cookies=s)
|
||||
if oun == 'http://uonetplus-uczen.fakelog.tk/powiatwulkanowy/123458':
|
||||
received_messages = requests.get(f'http://uonetplus-uzytkownik.fakelog.tk/{symbol}/Wiadomosc.mvc/GetInboxMessages?_dc={now}&dataOd=&dataDo=&page=1&start=0&limit=25', headers=headers, cookies=s)
|
||||
else:
|
||||
received_messages = requests.get(f'https://uonetplus-uzytkownik.vulcan.net.pl/{symbol}/Wiadomosc.mvc/GetInboxMessages?_dc={now}&dataOd=&dataDo=&page=1&start=0&limit=25', headers=headers, cookies=s)
|
||||
|
||||
|
@ -24,8 +24,8 @@ def get_sent_messages(register_id, students, oun, s, date, school_year, symbol):
|
|||
|
||||
now = calendar.timegm(time.gmtime())
|
||||
|
||||
if oun == 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458':
|
||||
sent_messages = requests.get(f'http://uonetplus-uzytkownik.fakelog.cf/{symbol}/Wiadomosc.mvc/GetInboxMessages?_dc={now}&dataOd=&dataDo=&page=1&start=0&limit=25', headers=headers, cookies=s)
|
||||
if oun == 'http://uonetplus-uczen.fakelog.tk/powiatwulkanowy/123458':
|
||||
sent_messages = requests.get(f'http://uonetplus-uzytkownik.fakelog.tk/{symbol}/Wiadomosc.mvc/GetInboxMessages?_dc={now}&dataOd=&dataDo=&page=1&start=0&limit=25', headers=headers, cookies=s)
|
||||
else:
|
||||
sent_messages = requests.get(f'https://uonetplus-uzytkownik.vulcan.net.pl/{symbol}/Wiadomosc.mvc/GetInboxMessages?_dc={now}&dataOd=&dataDo=&page=1&start=0&limit=25', headers=headers, cookies=s)
|
||||
|
||||
|
@ -37,8 +37,8 @@ def get_deleted_messages(register_id, students, oun, s, date, school_year, symbo
|
|||
|
||||
now = calendar.timegm(time.gmtime())
|
||||
|
||||
if oun == 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458':
|
||||
deleted_messages = requests.get(f'http://uonetplus-uzytkownik.fakelog.cf/{symbol}/Wiadomosc.mvc/GetOutboxMessages?_dc={now}&dataOd=&dataDo=&page=1&start=0&limit=25', headers=headers, cookies=s)
|
||||
if oun == 'http://uonetplus-uczen.fakelog.tk/powiatwulkanowy/123458':
|
||||
deleted_messages = requests.get(f'http://uonetplus-uzytkownik.fakelog.tk/{symbol}/Wiadomosc.mvc/GetOutboxMessages?_dc={now}&dataOd=&dataDo=&page=1&start=0&limit=25', headers=headers, cookies=s)
|
||||
else:
|
||||
deleted_messages = requests.get(f'https://uonetplus-uzytkownik.vulcan.net.pl/{symbol}/Wiadomosc.mvc/GetOutboxMessages?_dc={now}&dataOd=&dataDo=&page=1&start=0&limit=25', headers=headers, cookies=s)
|
||||
|
||||
|
@ -48,8 +48,8 @@ def get_recipients(register_id, students, oun, s, date, school_year, symbol):
|
|||
with open('app/API/headers.json') as f:
|
||||
headers = json.load(f)
|
||||
|
||||
if oun == 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458':
|
||||
link = f'http://uonetplus-uzytkownik.fakelog.cf/{symbol}'
|
||||
if oun == 'http://uonetplus-uczen.fakelog.tk/powiatwulkanowy/123458':
|
||||
link = f'http://uonetplus-uzytkownik.fakelog.tk/{symbol}'
|
||||
else:
|
||||
link = f'https://uonetplus-uzytkownik.vulcan.net.pl/{symbol}'
|
||||
|
||||
|
@ -66,8 +66,8 @@ def send_message(register_id, students, oun, s, date, school_year, symbol, send_
|
|||
with open('app/API/headers.json') as f:
|
||||
headers = json.load(f)
|
||||
|
||||
if oun == 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458':
|
||||
link = f'http://uonetplus-uzytkownik.fakelog.cf/{symbol}'
|
||||
if oun == 'http://uonetplus-uczen.fakelog.tk/powiatwulkanowy/123458':
|
||||
link = f'http://uonetplus-uzytkownik.fakelog.tk/{symbol}'
|
||||
else:
|
||||
link = f'https://uonetplus-uzytkownik.vulcan.net.pl/{symbol}'
|
||||
|
||||
|
@ -142,7 +142,7 @@ def get_message_content(register_id, students, oun, s, date, school_year, symbol
|
|||
with open('app/API/headers.json') as f:
|
||||
headers = json.load(f)
|
||||
|
||||
if oun == 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458':
|
||||
if oun == 'http://uonetplus-uczen.fakelog.tk/powiatwulkanowy/123458':
|
||||
link = f'http://uonetplus-uzytkownik.fakelog.cf/{symbol}'
|
||||
else:
|
||||
link = f'https://uonetplus-uzytkownik.vulcan.net.pl/{symbol}'
|
||||
|
|
|
@ -27,8 +27,8 @@ def send(url, data, fail, diary_url, symbol, s):
|
|||
if fail in page.text:
|
||||
return {'success': False}
|
||||
else:
|
||||
if diary_url == 'http://cufs.fakelog.cf/':
|
||||
page = s.get('http://cufs.fakelog.cf/powiatwulkanowy/FS/LS?wa=wsignin1.0&wtrealm=http://uonetplus.fakelog.localhost:300/powiatwulkanowy/LoginEndpoint.aspx&wctx=http://uonetplus.fakelog.localhost:300/powiatwulkanowy/LoginEndpoint.aspx')
|
||||
if diary_url == 'http://cufs.fakelog.tk/':
|
||||
page = s.get('http://cufs.fakelog.tk/powiatwulkanowy/FS/LS?wa=wsignin1.0&wtrealm=http://uonetplus.fakelog.localhost:300/powiatwulkanowy/LoginEndpoint.aspx&wctx=http://uonetplus.fakelog.localhost:300/powiatwulkanowy/LoginEndpoint.aspx')
|
||||
bs = BeautifulSoup(page.text, 'html.parser')
|
||||
wa = bs.find('input', {'name': 'wa'})['value']
|
||||
cert = bs.find('input', {'name': 'wresult'})['value']
|
||||
|
@ -44,8 +44,8 @@ def send(url, data, fail, diary_url, symbol, s):
|
|||
school_url = a['href']
|
||||
break
|
||||
|
||||
if diary_url == 'http://cufs.fakelog.cf/':
|
||||
school_url = 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458'
|
||||
if diary_url == 'http://cufs.fakelog.tk/':
|
||||
school_url = 'http://uonetplus-uczen.fakelog.tk/powiatwulkanowy/123458'
|
||||
|
||||
cookies = get_cookies(symbol, school_url, s, diary_url)
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ export default {
|
|||
loginName: email,
|
||||
Password: password,
|
||||
Symbol: symbol,
|
||||
diaryUrl: 'http://cufs.fakelog.cf/',
|
||||
diaryUrl: 'http://cufs.fakelog.tk/',
|
||||
},
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue