Skip to content

Commit

Permalink
Check session before extracting images (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kapppa authored Mar 12, 2024
1 parent c5ad99c commit 3d99895
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions vspreview/toolbars/comp/toolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,15 @@ def run(self, conf: WorkerConfiguration) -> None:
all_images = list[list[Path]]()
conf.path.mkdir(parents=True, exist_ok=False)

if conf.browser_id and conf.session_id:
with Session() as sess:
sess.cookies.set('SLP-SESSION', conf.session_id, domain='slow.pics')
browser_id = conf.browser_id
base_page = sess.get('https://slow.pics/comparison')
if base_page.text.find('id="logoutBtn"') == -1:
self.progress_status.emit(conf.uuid, 'Session Expired', 0, 0)
return

try:
for i, output in enumerate(conf.outputs):
if self.isFinished():
Expand Down

0 comments on commit 3d99895

Please sign in to comment.