mirror of
https://github.com/Garmelon/PFERD.git
synced 2026-04-12 15:35:05 +02:00
Authenticate with ILIAS and get pages by refid
This commit is contained in:
parent
0803f196c8
commit
95646b0b29
5 changed files with 292 additions and 0 deletions
30
test.py
Normal file
30
test.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import PFERD
|
||||
import asyncio
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG, format=PFERD.LOG_FORMAT)
|
||||
#logging.basicConfig(level=logging.INFO, format=PFERD.LOG_FORMAT)
|
||||
|
||||
async def test_download():
|
||||
auth = PFERD.ShibbolethAuthenticator(cookie_path="cookie_jar")
|
||||
soup = await auth.get_webpage("885157")
|
||||
await auth.close()
|
||||
if soup:
|
||||
print("Soup acquired!")
|
||||
else:
|
||||
print("No soup acquired :(")
|
||||
|
||||
def main():
|
||||
#print(f" os.getcwd(): {os.getcwd()}")
|
||||
#print(f" sys.argv[0]: {sys.argv[0]}")
|
||||
#print(f" both: {os.path.dirname(os.getcwd() + '/' + sys.argv[0])}")
|
||||
#print(f" __file__: {__file__}")
|
||||
#print(f"stackoverflow: {os.path.dirname(os.path.abspath(__file__))}")
|
||||
|
||||
#asyncio.run(test_download(), debug=True)
|
||||
asyncio.run(test_download())
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue