Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files
utils.py
CHANGED
@@ -5,12 +5,13 @@ import requests
|
|
5 |
|
6 |
def extract_instagram_code(url: str) -> str:
|
7 |
parts = [part for part in url.split('/') if part and '?' not in part]
|
8 |
-
# The
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
14 |
|
15 |
|
16 |
def get_users_from_keyword(keyword: str):
|
|
|
5 |
|
6 |
def extract_instagram_code(url: str) -> str:
|
7 |
parts = [part for part in url.split('/') if part and '?' not in part]
|
8 |
+
# The code is expected to be the part after 'p' or 'reel'
|
9 |
+
for key in ['p', 'reel']:
|
10 |
+
if key in parts:
|
11 |
+
code_index = parts.index(key) + 1
|
12 |
+
if code_index < len(parts):
|
13 |
+
return parts[code_index]
|
14 |
+
return "Invalid URL or code not found"
|
15 |
|
16 |
|
17 |
def get_users_from_keyword(keyword: str):
|