Handle extra slashes in url
Browse files
main.py
CHANGED
|
@@ -108,6 +108,10 @@ def index():
|
|
| 108 |
feed = random.randint(0, len(live_urls) - 1)
|
| 109 |
return redirect(f"/?id={feed}")
|
| 110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
id = int(id)
|
| 112 |
url = live_urls[id]
|
| 113 |
session['current_feed'] = id
|
|
|
|
| 108 |
feed = random.randint(0, len(live_urls) - 1)
|
| 109 |
return redirect(f"/?id={feed}")
|
| 110 |
|
| 111 |
+
if isinstance(id, str):
|
| 112 |
+
if "/" in id:
|
| 113 |
+
id = int(id.split('/')[0])
|
| 114 |
+
|
| 115 |
id = int(id)
|
| 116 |
url = live_urls[id]
|
| 117 |
session['current_feed'] = id
|