Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -144,7 +144,18 @@ def run_script(url: str, height: int, width: int, check_b,check_h,wait_time):
|
|
144 |
out_box.append(f'comb{i}-{uid}-tmp.png')
|
145 |
except Exception:
|
146 |
mes="<center>Some blocks returned an error"
|
147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
except WebDriverException as e:
|
149 |
return Image.new('RGB', (1, 1)), f'<center>Please enter a valid URL of a website/host.',out_box,out
|
150 |
finally:
|
|
|
144 |
out_box.append(f'comb{i}-{uid}-tmp.png')
|
145 |
except Exception:
|
146 |
mes="<center>Some blocks returned an error"
|
147 |
+
if out_box:
|
148 |
+
if len(out_box)>1:
|
149 |
+
im_roll = get_concat_v_cut(f'{out_box[0]}',f'{out_box[1]}')
|
150 |
+
im_roll.save(f'comb-{uid}-tmp.png')
|
151 |
+
for i in range(2,len(out_box)):
|
152 |
+
im_roll = get_concat_v_cut(f'comb-{uid}-tmp.png',f'{out_box[i]}')
|
153 |
+
im_roll.save(f'comb-{uid}-tmp.png')
|
154 |
+
out = f'comb-{uid}-tmp.png'
|
155 |
+
else:
|
156 |
+
tmp_im = Image.open(out_box[0])
|
157 |
+
tmp_im.save(f'comb-{uid}-tmp.png')
|
158 |
+
out = f'comb-{uid}-tmp.png'
|
159 |
except WebDriverException as e:
|
160 |
return Image.new('RGB', (1, 1)), f'<center>Please enter a valid URL of a website/host.',out_box,out
|
161 |
finally:
|